mirror of
https://github.com/wiiu-env/region_free_plugin.git
synced 2024-11-22 03:19:17 +01:00
Format the code via clang-format
This commit is contained in:
parent
b75edb5863
commit
d493bc3424
67
.clang-format
Normal file
67
.clang-format
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
# Generated from CLion C/C++ Code Style settings
|
||||||
|
BasedOnStyle: LLVM
|
||||||
|
AccessModifierOffset: -4
|
||||||
|
AlignAfterOpenBracket: Align
|
||||||
|
AlignConsecutiveAssignments: Consecutive
|
||||||
|
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
|
||||||
|
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: 1
|
||||||
|
SpacesInAngles: false
|
||||||
|
SpacesInCStyleCastParentheses: false
|
||||||
|
SpacesInContainerLiterals: false
|
||||||
|
SpacesInParentheses: false
|
||||||
|
SpacesInSquareBrackets: false
|
||||||
|
TabWidth: 4
|
||||||
|
UseTab: Never
|
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@ -6,8 +6,16 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
clang-format:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: clang-format
|
||||||
|
run: |
|
||||||
|
docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./src
|
||||||
build-binary:
|
build-binary:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
|
needs: clang-format
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: build binary
|
- name: build binary
|
||||||
|
8
.github/workflows/pr.yml
vendored
8
.github/workflows/pr.yml
vendored
@ -3,8 +3,16 @@ name: CI-PR
|
|||||||
on: [pull_request]
|
on: [pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
clang-format:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: clang-format
|
||||||
|
run: |
|
||||||
|
docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./src
|
||||||
build-binary:
|
build-binary:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
|
needs: clang-format
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: build binary
|
- name: build binary
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
[![CI-Release](https://github.com/wiiu-env/region_free_plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/wiiu-env/region_free_plugin/actions/workflows/ci.yml)
|
||||||
|
|
||||||
# Region Free Plugin
|
# Region Free Plugin
|
||||||
|
|
||||||
This plugin allows you to launch an title of an other region and / or force a language of an title.
|
This plugin allows you to launch an title of an other region and / or force a language of an title.
|
||||||
@ -44,3 +46,7 @@ docker run -it --rm -v ${PWD}:/project regionfree_plugin-builder make
|
|||||||
# make clean
|
# make clean
|
||||||
docker run -it --rm -v ${PWD}:/project regionfree_plugin-builder make clean
|
docker run -it --rm -v ${PWD}:/project regionfree_plugin-builder make clean
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Format the code via docker
|
||||||
|
|
||||||
|
`docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./src -i`
|
@ -1,17 +1,17 @@
|
|||||||
#include "ConfigUtils.h"
|
#include "ConfigUtils.h"
|
||||||
|
|
||||||
#include "utils/logger.h"
|
|
||||||
#include "DrawUtils.h"
|
#include "DrawUtils.h"
|
||||||
|
#include "utils/logger.h"
|
||||||
|
|
||||||
|
#include "globals.h"
|
||||||
|
#include <coreinit/mcp.h>
|
||||||
|
#include <coreinit/screen.h>
|
||||||
|
#include <map>
|
||||||
|
#include <memory/mappedmemory.h>
|
||||||
|
#include <padscore/kpad.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <coreinit/screen.h>
|
|
||||||
#include <memory/mappedmemory.h>
|
|
||||||
#include <vpad/input.h>
|
#include <vpad/input.h>
|
||||||
#include <padscore/kpad.h>
|
|
||||||
#include <coreinit/mcp.h>
|
|
||||||
#include <map>
|
|
||||||
#include "globals.h"
|
|
||||||
|
|
||||||
#define COLOR_BACKGROUND Color(238, 238, 238, 255)
|
#define COLOR_BACKGROUND Color(238, 238, 238, 255)
|
||||||
#define COLOR_TEXT Color(51, 51, 51, 255)
|
#define COLOR_TEXT Color(51, 51, 51, 255)
|
||||||
@ -311,7 +311,6 @@ void ConfigUtils::displayMenu() {
|
|||||||
DrawUtils::beginDraw();
|
DrawUtils::beginDraw();
|
||||||
DrawUtils::clear(COLOR_BLACK);
|
DrawUtils::clear(COLOR_BLACK);
|
||||||
DrawUtils::endDraw();
|
DrawUtils::endDraw();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigUtils::openConfigMenu() {
|
void ConfigUtils::openConfigMenu() {
|
||||||
|
@ -189,7 +189,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);
|
||||||
@ -229,7 +230,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);
|
||||||
|
41
src/main.cpp
41
src/main.cpp
@ -1,22 +1,22 @@
|
|||||||
#include <wups.h>
|
|
||||||
#include <nn/acp.h>
|
|
||||||
#include <coreinit/title.h>
|
|
||||||
#include <coreinit/mcp.h>
|
|
||||||
#include <coreinit/userconfig.h>
|
|
||||||
#include <coreinit/filesystem.h>
|
|
||||||
#include <sysapp/title.h>
|
|
||||||
#include <coreinit/thread.h>
|
|
||||||
#include "utils/logger.h"
|
|
||||||
#include "ConfigUtils.h"
|
#include "ConfigUtils.h"
|
||||||
#include <malloc.h>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <wups/config/WUPSConfigItemMultipleValues.h>
|
|
||||||
#include <map>
|
|
||||||
#include <coreinit/screen.h>
|
|
||||||
#include <vpad/input.h>
|
|
||||||
#include <padscore/kpad.h>
|
|
||||||
#include <wups/config/WUPSConfigItemBoolean.h>
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
#include "utils/logger.h"
|
||||||
|
#include <coreinit/filesystem.h>
|
||||||
|
#include <coreinit/mcp.h>
|
||||||
|
#include <coreinit/screen.h>
|
||||||
|
#include <coreinit/thread.h>
|
||||||
|
#include <coreinit/title.h>
|
||||||
|
#include <coreinit/userconfig.h>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <map>
|
||||||
|
#include <nn/acp.h>
|
||||||
|
#include <padscore/kpad.h>
|
||||||
|
#include <sysapp/title.h>
|
||||||
|
#include <vpad/input.h>
|
||||||
|
#include <wups.h>
|
||||||
|
#include <wups/config/WUPSConfigItemBoolean.h>
|
||||||
|
#include <wups/config/WUPSConfigItemMultipleValues.h>
|
||||||
|
|
||||||
WUPS_PLUGIN_NAME("Region Free Plugin");
|
WUPS_PLUGIN_NAME("Region Free Plugin");
|
||||||
WUPS_PLUGIN_DESCRIPTION("Allows the user to load titles from other regions");
|
WUPS_PLUGIN_DESCRIPTION("Allows the user to load titles from other regions");
|
||||||
@ -110,7 +110,8 @@ ON_FUNCTIONS_PATCHED() {
|
|||||||
gDefaultProductArea = MCP_REGION_JAPAN;
|
gDefaultProductArea = MCP_REGION_JAPAN;
|
||||||
gDefaultLanguage = gDefaultLangForJPN;
|
gDefaultLanguage = gDefaultLangForJPN;
|
||||||
gDefaultCountry = gDefaultCountryForJPN;
|
gDefaultCountry = gDefaultCountryForJPN;
|
||||||
}if(real_product_area == MCP_REGION_USA){
|
}
|
||||||
|
if (real_product_area == MCP_REGION_USA) {
|
||||||
gDefaultProductArea = MCP_REGION_USA;
|
gDefaultProductArea = MCP_REGION_USA;
|
||||||
gDefaultLanguage = gDefaultLangForUSA;
|
gDefaultLanguage = gDefaultLangForUSA;
|
||||||
gDefaultCountry = gDefaultCountryForUSA;
|
gDefaultCountry = gDefaultCountryForUSA;
|
||||||
@ -411,8 +412,7 @@ WUPS_GET_CONFIG() {
|
|||||||
{LANG_ENGLISH, "English"},
|
{LANG_ENGLISH, "English"},
|
||||||
{LANG_FRANCAIS, "Francais"},
|
{LANG_FRANCAIS, "Francais"},
|
||||||
{LANG_ESPANOL, "Espanol"},
|
{LANG_ESPANOL, "Espanol"},
|
||||||
{LANG_PORTUGUES, "Portugues"}
|
{LANG_PORTUGUES, "Portugues"}};
|
||||||
};
|
|
||||||
|
|
||||||
ConfigItemMultipleValuesPair lang_eur_pair[eur_lang_map.size()];
|
ConfigItemMultipleValuesPair lang_eur_pair[eur_lang_map.size()];
|
||||||
uint32_t number_lang_eur_values = 0;
|
uint32_t number_lang_eur_values = 0;
|
||||||
@ -587,4 +587,3 @@ WUPS_MUST_REPLACE(ACPGetLaunchMetaXml, WUPS_LOADER_LIBRARY_NN_ACP, ACPGetLaunchM
|
|||||||
WUPS_MUST_REPLACE(MCP_GetSysProdSettings, WUPS_LOADER_LIBRARY_COREINIT, MCP_GetSysProdSettings);
|
WUPS_MUST_REPLACE(MCP_GetSysProdSettings, WUPS_LOADER_LIBRARY_COREINIT, MCP_GetSysProdSettings);
|
||||||
WUPS_MUST_REPLACE(UCReadSysConfig, WUPS_LOADER_LIBRARY_COREINIT, UCReadSysConfig);
|
WUPS_MUST_REPLACE(UCReadSysConfig, WUPS_LOADER_LIBRARY_COREINIT, UCReadSysConfig);
|
||||||
WUPS_MUST_REPLACE(_SYSGetSystemApplicationTitleIdByProdArea, WUPS_LOADER_LIBRARY_SYSAPP, _SYSGetSystemApplicationTitleIdByProdArea);
|
WUPS_MUST_REPLACE(_SYSGetSystemApplicationTitleIdByProdArea, WUPS_LOADER_LIBRARY_SYSAPP, _SYSGetSystemApplicationTitleIdByProdArea);
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <whb/log_udp.h>
|
|
||||||
#include <whb/log_cafe.h>
|
#include <whb/log_cafe.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;
|
||||||
|
@ -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" {
|
||||||
@ -14,11 +14,13 @@ extern "C" {
|
|||||||
|
|
||||||
#define DEBUG_FUNCTION_LINE_VERBOSE(FMT, ARGS...) while (0)
|
#define DEBUG_FUNCTION_LINE_VERBOSE(FMT, ARGS...) while (0)
|
||||||
|
|
||||||
#define DEBUG_FUNCTION_LINE(FMT, ARGS...)do { \
|
#define DEBUG_FUNCTION_LINE(FMT, ARGS...) \
|
||||||
|
do { \
|
||||||
WHBLogPrintf("[%23s]%30s@L%04d: " FMT "", __FILENAME__, __FUNCTION__, __LINE__, ##ARGS); \
|
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...) \
|
||||||
|
do { \
|
||||||
WHBLogWritef("[%23s]%30s@L%04d: " FMT "", __FILENAME__, __FUNCTION__, __LINE__, ##ARGS); \
|
WHBLogWritef("[%23s]%30s@L%04d: " FMT "", __FILENAME__, __FUNCTION__, __LINE__, ##ARGS); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@ -39,4 +41,3 @@ void deinitLogging();
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user