mirror of
https://github.com/wiiu-env/AutobootModule.git
synced 2024-11-22 10:59:15 +01:00
Format the code via clang-format (#3)
This commit is contained in:
parent
ad693c94ff
commit
beedc7513c
66
.clang-format
Normal file
66
.clang-format
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
# Generated from CLion C/C++ Code Style settings
|
||||||
|
BasedOnStyle: LLVM
|
||||||
|
AccessModifierOffset: -4
|
||||||
|
AlignAfterOpenBracket: Align
|
||||||
|
AlignConsecutiveAssignments: None
|
||||||
|
AlignOperands: Align
|
||||||
|
AllowAllArgumentsOnNextLine: false
|
||||||
|
AllowAllConstructorInitializersOnNextLine: false
|
||||||
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
|
AllowShortBlocksOnASingleLine: Always
|
||||||
|
AllowShortCaseLabelsOnASingleLine: false
|
||||||
|
AllowShortFunctionsOnASingleLine: All
|
||||||
|
AllowShortIfStatementsOnASingleLine: Always
|
||||||
|
AllowShortLambdasOnASingleLine: All
|
||||||
|
AllowShortLoopsOnASingleLine: true
|
||||||
|
AlwaysBreakAfterReturnType: None
|
||||||
|
AlwaysBreakTemplateDeclarations: Yes
|
||||||
|
BreakBeforeBraces: Custom
|
||||||
|
BraceWrapping:
|
||||||
|
AfterCaseLabel: false
|
||||||
|
AfterClass: false
|
||||||
|
AfterControlStatement: Never
|
||||||
|
AfterEnum: false
|
||||||
|
AfterFunction: false
|
||||||
|
AfterNamespace: false
|
||||||
|
AfterUnion: false
|
||||||
|
BeforeCatch: false
|
||||||
|
BeforeElse: false
|
||||||
|
IndentBraces: false
|
||||||
|
SplitEmptyFunction: false
|
||||||
|
SplitEmptyRecord: true
|
||||||
|
BreakBeforeBinaryOperators: None
|
||||||
|
BreakBeforeTernaryOperators: true
|
||||||
|
BreakConstructorInitializers: BeforeColon
|
||||||
|
BreakInheritanceList: BeforeColon
|
||||||
|
ColumnLimit: 0
|
||||||
|
CompactNamespaces: false
|
||||||
|
ContinuationIndentWidth: 8
|
||||||
|
IndentCaseLabels: true
|
||||||
|
IndentPPDirectives: None
|
||||||
|
IndentWidth: 4
|
||||||
|
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||||
|
MaxEmptyLinesToKeep: 2
|
||||||
|
NamespaceIndentation: All
|
||||||
|
ObjCSpaceAfterProperty: false
|
||||||
|
ObjCSpaceBeforeProtocolList: true
|
||||||
|
PointerAlignment: Right
|
||||||
|
ReflowComments: false
|
||||||
|
SpaceAfterCStyleCast: true
|
||||||
|
SpaceAfterLogicalNot: false
|
||||||
|
SpaceAfterTemplateKeyword: false
|
||||||
|
SpaceBeforeAssignmentOperators: true
|
||||||
|
SpaceBeforeCpp11BracedList: false
|
||||||
|
SpaceBeforeCtorInitializerColon: true
|
||||||
|
SpaceBeforeInheritanceColon: true
|
||||||
|
SpaceBeforeParens: ControlStatements
|
||||||
|
SpaceBeforeRangeBasedForLoopColon: true
|
||||||
|
SpaceInEmptyParentheses: false
|
||||||
|
SpacesBeforeTrailingComments: 0
|
||||||
|
SpacesInAngles: false
|
||||||
|
SpacesInCStyleCastParentheses: false
|
||||||
|
SpacesInContainerLiterals: false
|
||||||
|
SpacesInParentheses: false
|
||||||
|
SpacesInSquareBrackets: false
|
||||||
|
TabWidth: 4
|
||||||
|
UseTab: Never
|
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
@ -6,18 +6,18 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
clang-format:
|
||||||
build-binary:
|
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Checkout submodules using a PAT
|
- name: clang-format
|
||||||
run: |
|
run: |
|
||||||
git config --file .gitmodules --get-regexp url | while read url; do
|
docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source
|
||||||
git config --file=.gitmodules $(echo "$url" | sed -E "s/git@github.com:|https:\/\/github.com\//https:\/\/${{ secrets.CI_PAT }}:${{ secrets.CI_PAT }}@github.com\//")
|
build-binary:
|
||||||
done
|
runs-on: ubuntu-18.04
|
||||||
git submodule sync
|
needs: clang-format
|
||||||
git submodule update --init --recursive
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
- name: build binary
|
- name: build binary
|
||||||
run: |
|
run: |
|
||||||
docker build . -t builder
|
docker build . -t builder
|
||||||
|
15
.github/workflows/pr.yml
vendored
15
.github/workflows/pr.yml
vendored
@ -3,17 +3,18 @@ name: CI-PR
|
|||||||
on: [pull_request]
|
on: [pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-binary:
|
clang-format:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Checkout submodules using a PAT
|
- name: clang-format
|
||||||
run: |
|
run: |
|
||||||
git config --file .gitmodules --get-regexp url | while read url; do
|
docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source
|
||||||
git config --file=.gitmodules $(echo "$url" | sed -E "s/git@github.com:|https:\/\/github.com\//https:\/\/${{ secrets.CI_PAT }}:${{ secrets.CI_PAT }}@github.com\//")
|
build-binary:
|
||||||
done
|
runs-on: ubuntu-18.04
|
||||||
git submodule sync
|
needs: clang-format
|
||||||
git submodule update --init --recursive
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
- name: build binary
|
- name: build binary
|
||||||
run: |
|
run: |
|
||||||
docker build . -t builder
|
docker build . -t builder
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
[![CI-Release](https://github.com/wiiu-env/AutobootModule/actions/workflows/ci.yml/badge.svg)](https://github.com/wiiu-env/AutobootModule/actions/workflows/ci.yml)
|
||||||
# AutobootModule
|
# AutobootModule
|
||||||
This is a bootmenu targetted to be loaded with the [EnvironmentLoader](https://github.com/wiiu-env/EnvironmentLoader). It allows you to boot into the Wii U Menu, Homebrew Channel, vWii System Menu or vWii Homebrew Channel.
|
This is a bootmenu targetted to be loaded with the [EnvironmentLoader](https://github.com/wiiu-env/EnvironmentLoader). It allows you to boot into the Wii U Menu, Homebrew Channel, vWii System Menu or vWii Homebrew Channel.
|
||||||
|
|
||||||
@ -33,6 +34,10 @@ docker run -it --rm -v ${PWD}:/project autobootmodule-builder make
|
|||||||
docker run -it --rm -v ${PWD}:/project autobootmodule-builder make clean
|
docker run -it --rm -v ${PWD}:/project autobootmodule-builder make clean
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Format the code via docker
|
||||||
|
|
||||||
|
`docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source -i`
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
- GaryOderNichts
|
- GaryOderNichts
|
||||||
- Maschell
|
- Maschell
|
@ -1,4 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
#include <nn/act.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class AccountInfo {
|
class AccountInfo {
|
||||||
public:
|
public:
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
#include <malloc.h>
|
|
||||||
#include <string>
|
|
||||||
#include <map>
|
|
||||||
#include <locale>
|
|
||||||
#include <vector>
|
|
||||||
#include <codecvt>
|
#include <codecvt>
|
||||||
|
#include <locale>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "ACTAccountInfo.h"
|
||||||
#include "BootUtils.h"
|
#include "BootUtils.h"
|
||||||
#include "logger.h"
|
|
||||||
#include "DrawUtils.h"
|
#include "DrawUtils.h"
|
||||||
#include "MenuUtils.h"
|
#include "MenuUtils.h"
|
||||||
#include "ACTAccountInfo.h"
|
#include "logger.h"
|
||||||
|
|
||||||
#include <coreinit/debug.h>
|
#include <coreinit/debug.h>
|
||||||
#include <coreinit/screen.h>
|
#include <coreinit/screen.h>
|
||||||
#include <nn/cmpt/cmpt.h>
|
#include <gx2/state.h>
|
||||||
#include <nn/act.h>
|
#include <nn/act.h>
|
||||||
|
#include <nn/cmpt/cmpt.h>
|
||||||
|
#include <padscore/kpad.h>
|
||||||
#include <sysapp/launch.h>
|
#include <sysapp/launch.h>
|
||||||
#include <sysapp/title.h>
|
#include <sysapp/title.h>
|
||||||
#include <padscore/kpad.h>
|
|
||||||
#include <vpad/input.h>
|
#include <vpad/input.h>
|
||||||
#include <gx2/state.h>
|
|
||||||
|
|
||||||
#include <iosuhax.h>
|
#include <iosuhax.h>
|
||||||
|
|
||||||
@ -32,9 +32,9 @@ void bootWiiUMenu() {
|
|||||||
nn::act::SlotNo defaultSlot = nn::act::GetDefaultAccount();
|
nn::act::SlotNo defaultSlot = nn::act::GetDefaultAccount();
|
||||||
nn::act::Finalize();
|
nn::act::Finalize();
|
||||||
|
|
||||||
if (defaultSlot) { //normal menu boot
|
if (defaultSlot) {//normal menu boot
|
||||||
SYSLaunchMenu();
|
SYSLaunchMenu();
|
||||||
} else { //show mii select
|
} else {//show mii select
|
||||||
_SYSLaunchMenuWithCheckingAccount(slot);
|
_SYSLaunchMenuWithCheckingAccount(slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ void handleAccountSelection() {
|
|||||||
nn::act::Initialize();
|
nn::act::Initialize();
|
||||||
nn::act::SlotNo defaultSlot = nn::act::GetDefaultAccount();
|
nn::act::SlotNo defaultSlot = nn::act::GetDefaultAccount();
|
||||||
|
|
||||||
if (!defaultSlot) { // No default account is set.
|
if (!defaultSlot) {// No default account is set.
|
||||||
std::vector<std::shared_ptr<AccountInfo>> accountInfoList;
|
std::vector<std::shared_ptr<AccountInfo>> accountInfoList;
|
||||||
for (int32_t i = 0; i < 13; i++) {
|
for (int32_t i = 0; i < 13; i++) {
|
||||||
if (!nn::act::IsSlotOccupied(i)) {
|
if (!nn::act::IsSlotOccupied(i)) {
|
||||||
@ -134,9 +134,9 @@ void bootHomebrewChannel() {
|
|||||||
|
|
||||||
// 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 (IOSUHAX_FSA_GetStat(fsaFd, "/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 (IOSUHAX_FSA_GetStat(fsaFd, "/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, booting vWii System Menu");
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <coreinit/cache.h>
|
||||||
#include <coreinit/memory.h>
|
#include <coreinit/memory.h>
|
||||||
#include <coreinit/screen.h>
|
#include <coreinit/screen.h>
|
||||||
#include <coreinit/cache.h>
|
|
||||||
#include <png.h>
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
#include <png.h>
|
||||||
#include FT_FREETYPE_H
|
#include FT_FREETYPE_H
|
||||||
#include "MenuUtils.h"
|
#include "MenuUtils.h"
|
||||||
|
|
||||||
@ -266,7 +266,8 @@ void DrawUtils::print(uint32_t x, uint32_t y, const char *string, bool alignRigh
|
|||||||
buffer[num] = 0;
|
buffer[num] = 0;
|
||||||
} else {
|
} else {
|
||||||
wchar_t *tmp = buffer;
|
wchar_t *tmp = buffer;
|
||||||
while ((*tmp++ = *string++));
|
while ((*tmp++ = *string++))
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
print(x, y, buffer, alignRight);
|
print(x, y, buffer, alignRight);
|
||||||
@ -306,7 +307,8 @@ uint32_t DrawUtils::getTextWidth(const char *string) {
|
|||||||
buffer[num] = 0;
|
buffer[num] = 0;
|
||||||
} else {
|
} else {
|
||||||
wchar_t *tmp = buffer;
|
wchar_t *tmp = buffer;
|
||||||
while ((*tmp++ = *string++));
|
while ((*tmp++ = *string++))
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t width = getTextWidth(buffer);
|
uint32_t width = getTextWidth(buffer);
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
#include <malloc.h>
|
|
||||||
#include <cstdint>
|
|
||||||
#include <cstring>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include "MenuUtils.h"
|
#include "MenuUtils.h"
|
||||||
#include "DrawUtils.h"
|
#include "DrawUtils.h"
|
||||||
|
#include <cstdint>
|
||||||
|
#include <cstring>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include <coreinit/screen.h>
|
|
||||||
#include <coreinit/debug.h>
|
#include <coreinit/debug.h>
|
||||||
#include <vpad/input.h>
|
#include <coreinit/screen.h>
|
||||||
#include <gx2/state.h>
|
#include <gx2/state.h>
|
||||||
#include <nn/act/client_cpp.h>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <nn/act/client_cpp.h>
|
||||||
|
#include <vpad/input.h>
|
||||||
|
|
||||||
#include "icon_png.h"
|
|
||||||
#include "ACTAccountInfo.h"
|
#include "ACTAccountInfo.h"
|
||||||
|
#include "icon_png.h"
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
|
|
||||||
const char *menu_options[] = {
|
const char *menu_options[] = {
|
||||||
@ -31,13 +31,13 @@ const char *autoboot_config_strings[] = {
|
|||||||
"vwii_homebrew_channel",
|
"vwii_homebrew_channel",
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename ... Args>
|
template<typename... Args>
|
||||||
std::string string_format(const std::string &format, Args ... args) {
|
std::string string_format(const std::string &format, Args... args) {
|
||||||
int size_s = std::snprintf(nullptr, 0, format.c_str(), args ...) + 1; // Extra space for '\0'
|
int size_s = std::snprintf(nullptr, 0, format.c_str(), args...) + 1;// Extra space for '\0'
|
||||||
auto size = static_cast<size_t>( size_s );
|
auto size = static_cast<size_t>(size_s);
|
||||||
auto buf = std::make_unique<char[]>(size);
|
auto buf = std::make_unique<char[]>(size);
|
||||||
std::snprintf(buf.get(), size, format.c_str(), args ...);
|
std::snprintf(buf.get(), size, format.c_str(), args...);
|
||||||
return std::string(buf.get(), buf.get() + size - 1); // We don't want the '\0' inside
|
return std::string(buf.get(), buf.get() + size - 1);// We don't want the '\0' inside
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t readAutobootOption(std::string &configPath) {
|
int32_t readAutobootOption(std::string &configPath) {
|
||||||
@ -220,9 +220,9 @@ nn::act::SlotNo handleAccountSelectScreen(const std::vector<std::shared_ptr<Acco
|
|||||||
auto yOffset = index;
|
auto yOffset = index;
|
||||||
for (uint32_t y = 0; y < target_height; y++) {
|
for (uint32_t y = 0; y < target_height; y++) {
|
||||||
for (uint32_t x = 0; x < target_width; x++) {
|
for (uint32_t x = 0; x < target_width; x++) {
|
||||||
uint32_t col = (((x) * width / target_width) + ((target_height - y - 1) * height / target_height) * width) * 4;
|
uint32_t col = (((x) *width / target_width) + ((target_height - y - 1) * height / target_height) * width) * 4;
|
||||||
uint32_t colVal = ((uint32_t *) &val->miiImageBuffer[col + 1])[0];
|
uint32_t colVal = ((uint32_t *) &val->miiImageBuffer[col + 1])[0];
|
||||||
if (colVal == 0x00808080) { // Remove the green background.
|
if (colVal == 0x00808080) {// Remove the green background.
|
||||||
DrawUtils::drawPixel(x + xOffset, y + yOffset, COLOR_BACKGROUND.r, COLOR_BACKGROUND.g, COLOR_BACKGROUND.b, COLOR_BACKGROUND.a);
|
DrawUtils::drawPixel(x + xOffset, y + yOffset, COLOR_BACKGROUND.r, COLOR_BACKGROUND.g, COLOR_BACKGROUND.b, COLOR_BACKGROUND.a);
|
||||||
} else {
|
} else {
|
||||||
DrawUtils::drawPixel(x + xOffset, y + yOffset, val->miiImageBuffer[col + 1], val->miiImageBuffer[col + 2], val->miiImageBuffer[col + 3], val->miiImageBuffer[col]);
|
DrawUtils::drawPixel(x + xOffset, y + yOffset, val->miiImageBuffer[col + 1], val->miiImageBuffer[col + 2], val->miiImageBuffer[col + 3], val->miiImageBuffer[col]);
|
||||||
@ -289,7 +289,7 @@ nn::act::SlotNo handleAccountSelectScreen(const std::vector<std::shared_ptr<Acco
|
|||||||
|
|
||||||
auto i = 0;
|
auto i = 0;
|
||||||
nn::act::SlotNo resultSlot = 0;
|
nn::act::SlotNo resultSlot = 0;
|
||||||
for (auto const &val: data) {
|
for (auto const &val : data) {
|
||||||
if (i == selected) {
|
if (i == selected) {
|
||||||
resultSlot = val->slot;
|
resultSlot = val->slot;
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "ACTAccountInfo.h"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <nn/act.h>
|
#include <nn/act.h>
|
||||||
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "ACTAccountInfo.h"
|
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#define COLOR_WHITE Color(0xffffffff)
|
#define COLOR_WHITE Color(0xffffffff)
|
||||||
#define COLOR_BLACK Color(0, 0, 0, 255)
|
#define COLOR_BLACK Color(0, 0, 0, 255)
|
||||||
#define COLOR_BACKGROUND COLOR_BLACK
|
#define COLOR_BACKGROUND COLOR_BLACK
|
||||||
@ -15,6 +16,7 @@
|
|||||||
#define COLOR_AUTOBOOT Color(0xaeea00ff)
|
#define COLOR_AUTOBOOT Color(0xaeea00ff)
|
||||||
#define COLOR_BORDER Color(204, 204, 204, 255)
|
#define COLOR_BORDER Color(204, 204, 204, 255)
|
||||||
#define COLOR_BORDER_HIGHLIGHTED Color(0x3478e4ff)
|
#define COLOR_BORDER_HIGHLIGHTED Color(0x3478e4ff)
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
BOOT_OPTION_WII_U_MENU,
|
BOOT_OPTION_WII_U_MENU,
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
|
#include "BootUtils.h"
|
||||||
#include "QuickStartUtils.h"
|
#include "QuickStartUtils.h"
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
#include "BootUtils.h"
|
|
||||||
|
|
||||||
#include <coreinit/exit.h>
|
#include <coreinit/exit.h>
|
||||||
#include <coreinit/thread.h>
|
|
||||||
#include <coreinit/memdefaultheap.h>
|
|
||||||
#include <coreinit/foreground.h>
|
#include <coreinit/foreground.h>
|
||||||
|
#include <coreinit/memdefaultheap.h>
|
||||||
|
#include <coreinit/thread.h>
|
||||||
#include <nn/acp/title.h>
|
#include <nn/acp/title.h>
|
||||||
#include <nn/act/client_cpp.h>
|
#include <nn/act/client_cpp.h>
|
||||||
#include <nn/ccr/sys_caffeine.h>
|
#include <nn/ccr/sys_caffeine.h>
|
||||||
#include <nn/sl.h>
|
#include <nn/sl.h>
|
||||||
#include <sysapp/title.h>
|
|
||||||
#include <sysapp/launch.h>
|
|
||||||
#include <proc_ui/procui.h>
|
#include <proc_ui/procui.h>
|
||||||
|
#include <sysapp/launch.h>
|
||||||
|
#include <sysapp/title.h>
|
||||||
|
|
||||||
extern "C" void __fini_wut();
|
extern "C" void __fini_wut();
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ bool getQuickBoot() {
|
|||||||
if (bootCheck == 0) {
|
if (bootCheck == 0) {
|
||||||
nn::sl::Initialize(MEMAllocFromDefaultHeapEx, MEMFreeToDefaultHeap);
|
nn::sl::Initialize(MEMAllocFromDefaultHeapEx, MEMFreeToDefaultHeap);
|
||||||
char path[0x80];
|
char path[0x80];
|
||||||
nn::sl::GetDefaultDatabasePath(path, 0x80, 0x0005001010066000); // ECO process
|
nn::sl::GetDefaultDatabasePath(path, 0x80, 0x0005001010066000);// ECO process
|
||||||
FSCmdBlock cmdBlock;
|
FSCmdBlock cmdBlock;
|
||||||
FSInitCmdBlock(&cmdBlock);
|
FSInitCmdBlock(&cmdBlock);
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ bool getQuickBoot() {
|
|||||||
auto database = new nn::sl::LaunchInfoDatabase;
|
auto database = new nn::sl::LaunchInfoDatabase;
|
||||||
database->Load(fileStream, nn::sl::REGION_EUR);
|
database->Load(fileStream, nn::sl::REGION_EUR);
|
||||||
|
|
||||||
CCRAppLaunchParam data; // load sys caffeine data
|
CCRAppLaunchParam data;// load sys caffeine data
|
||||||
// load app launch param
|
// load app launch param
|
||||||
CCRSysCaffeineGetAppLaunchParam(&data);
|
CCRSysCaffeineGetAppLaunchParam(&data);
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ bool getQuickBoot() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.titleId == 0x0005001010004000L) { // OSv0
|
if (info.titleId == 0x0005001010004000L) {// OSv0
|
||||||
DEBUG_FUNCTION_LINE("Launching vWii System Menu");
|
DEBUG_FUNCTION_LINE("Launching vWii System Menu");
|
||||||
bootvWiiMenu();
|
bootvWiiMenu();
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
#include <coreinit/thread.h>
|
#include <coreinit/thread.h>
|
||||||
#include <coreinit/title.h>
|
#include <coreinit/title.h>
|
||||||
#include <nn/spm.h>
|
|
||||||
#include <nn/acp/save.h>
|
#include <nn/acp/save.h>
|
||||||
|
#include <nn/spm.h>
|
||||||
#include <nsysuhs/uhs.h>
|
#include <nsysuhs/uhs.h>
|
||||||
#include <sysapp/title.h>
|
#include <sysapp/title.h>
|
||||||
|
|
||||||
@ -56,8 +56,7 @@ static int numberUSBStorageDevicesConnected() {
|
|||||||
|
|
||||||
UhsInterfaceProfile profiles[10];
|
UhsInterfaceProfile profiles[10];
|
||||||
UhsInterfaceFilter filter = {
|
UhsInterfaceFilter filter = {
|
||||||
.match_params = MATCH_ANY
|
.match_params = MATCH_ANY};
|
||||||
};
|
|
||||||
|
|
||||||
UHSStatus result;
|
UHSStatus result;
|
||||||
if ((result = UhsQueryInterfaces(handle, &filter, profiles, 10)) <= UHS_STATUS_OK) {
|
if ((result = UhsQueryInterfaces(handle, &filter, profiles, 10)) <= UHS_STATUS_OK) {
|
||||||
@ -106,7 +105,7 @@ void initExternalStorage() {
|
|||||||
int tries = 0;
|
int tries = 0;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
while (tries < 1200) { // Wait up to 20 seconds, like the Wii U Menu
|
while (tries < 1200) {// Wait up to 20 seconds, like the Wii U Menu
|
||||||
int32_t numItems = nn::spm::GetStorageList(items, 0x20);
|
int32_t numItems = nn::spm::GetStorageList(items, 0x20);
|
||||||
|
|
||||||
DEBUG_FUNCTION_LINE("Number of items: %d", numItems);
|
DEBUG_FUNCTION_LINE("Number of items: %d", numItems);
|
||||||
@ -141,4 +140,3 @@ void initExternalStorage() {
|
|||||||
|
|
||||||
nn::spm::Finalize();
|
nn::spm::Finalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <whb/log_cafe.h>
|
#include <whb/log_cafe.h>
|
||||||
#include <whb/log_udp.h>
|
|
||||||
#include <whb/log_module.h>
|
#include <whb/log_module.h>
|
||||||
|
#include <whb/log_udp.h>
|
||||||
|
|
||||||
uint32_t moduleLogInit = false;
|
uint32_t moduleLogInit = false;
|
||||||
uint32_t cafeLogInit = false;
|
uint32_t cafeLogInit = false;
|
||||||
@ -17,7 +17,7 @@ void initLogging() {
|
|||||||
cafeLogInit = WHBLogCafeInit();
|
cafeLogInit = WHBLogCafeInit();
|
||||||
udpLogInit = WHBLogUdpInit();
|
udpLogInit = WHBLogUdpInit();
|
||||||
}
|
}
|
||||||
#endif // DEBUG
|
#endif// DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
void deinitLogging() {
|
void deinitLogging() {
|
||||||
@ -34,5 +34,5 @@ void deinitLogging() {
|
|||||||
WHBLogUdpDeinit();
|
WHBLogUdpDeinit();
|
||||||
udpLogInit = false;
|
udpLogInit = false;
|
||||||
}
|
}
|
||||||
#endif // DEBUG
|
#endif// DEBUG
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <whb/log.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <whb/log.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -12,12 +12,14 @@ extern "C" {
|
|||||||
#define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
|
#define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
|
||||||
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__)
|
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__)
|
||||||
|
|
||||||
#define DEBUG_FUNCTION_LINE(FMT, ARGS...)do { \
|
#define DEBUG_FUNCTION_LINE(FMT, ARGS...) \
|
||||||
WHBLogPrintf("[%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \
|
do { \
|
||||||
|
WHBLogPrintf("[%23s]%30s@L%04d: " FMT "", __FILENAME__, __FUNCTION__, __LINE__, ##ARGS); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...)do { \
|
#define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...) \
|
||||||
WHBLogWritef("[%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \
|
do { \
|
||||||
|
WHBLogWritef("[%23s]%30s@L%04d: " FMT "", __FILENAME__, __FUNCTION__, __LINE__, ##ARGS); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@ -35,4 +37,3 @@ void deinitLogging();
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
#include "DrawUtils.h"
|
||||||
|
#include "QuickStartUtils.h"
|
||||||
|
#include "StorageUtils.h"
|
||||||
|
#include "logger.h"
|
||||||
|
#include <coreinit/debug.h>
|
||||||
|
#include <gx2/state.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vpad/input.h>
|
#include <vpad/input.h>
|
||||||
#include <coreinit/debug.h>
|
|
||||||
#include <gx2/state.h>
|
|
||||||
#include "StorageUtils.h"
|
|
||||||
#include "QuickStartUtils.h"
|
|
||||||
#include "DrawUtils.h"
|
|
||||||
#include "logger.h"
|
|
||||||
|
|
||||||
#include "BootUtils.h"
|
#include "BootUtils.h"
|
||||||
#include "MenuUtils.h"
|
#include "MenuUtils.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user