Fix region changed consoles

This commit is contained in:
PabloMK7 2025-04-13 19:22:08 +02:00
parent 1f37bab17b
commit f42b38196d
4 changed files with 16 additions and 5 deletions

View File

@ -1,6 +1,6 @@
VERSION_MAJOR := 1 VERSION_MAJOR := 1
VERSION_MINOR := 0 VERSION_MINOR := 0
VERSION_REVISION := 2 VERSION_REVISION := 3
all: all:
mkdir -p plugin/build mkdir -p plugin/build

View File

@ -26,7 +26,7 @@ LIBRARIES := ctru
VERSION_MAJOR := 1 VERSION_MAJOR := 1
VERSION_MINOR := 0 VERSION_MINOR := 0
VERSION_MICRO := 2 VERSION_MICRO := 3
BUILD_FLAGS := -march=armv6k -mtune=mpcore -mfloat-abi=hard BUILD_FLAGS := -march=armv6k -mtune=mpcore -mfloat-abi=hard
BUILD_FLAGS_CC := -g -Wall -Wno-strict-aliasing -O3 -mword-relocations \ BUILD_FLAGS_CC := -g -Wall -Wno-strict-aliasing -O3 -mword-relocations \

View File

@ -16,7 +16,7 @@ SOURCES := ArticProtocol/sources sources sources/CTRPluginFramework
VERSION_MAJOR := 1 VERSION_MAJOR := 1
VERSION_MINOR := 0 VERSION_MINOR := 0
VERSION_REVISION := 2 VERSION_REVISION := 3
SERVER_PORT := 5543 SERVER_PORT := 5543
IP := 19 IP := 19

View File

@ -15,7 +15,7 @@ extern "C" {
} }
extern bool isControllerMode; extern bool isControllerMode;
constexpr u32 INITIAL_SETUP_APP_VERSION = 1; constexpr u32 INITIAL_SETUP_APP_VERSION = 2;
enum class HandleType { enum class HandleType {
FILE, FILE,
@ -619,12 +619,23 @@ namespace ArticFunctions {
strcpy(file_name, files[type]); strcpy(file_name, files[type]);
char* end = file_name + strlen(files[type]); char* end = file_name + strlen(files[type]);
if (type == 0 || type == 1) { if (type == 0) {
// Check for region changed file first
*end = 'C';
} else if (type == 1) {
*end = 'A'; *end = 'A';
} }
FSPXI_File file; FSPXI_File file;
res = FSPXI_OpenFile(fspxiHandle, &file, archive, fsMakePath(PATH_ASCII, file_name), FS_OPEN_READ, 0); res = FSPXI_OpenFile(fspxiHandle, &file, archive, fsMakePath(PATH_ASCII, file_name), FS_OPEN_READ, 0);
if (type == 0) {
if (R_SUCCEEDED(res)) {
logger.Info("NOTE: This console is region changed,\n some functionality may not work properly.");
} else {
*end = 'A';
res = FSPXI_OpenFile(fspxiHandle, &file, archive, fsMakePath(PATH_ASCII, file_name), FS_OPEN_READ, 0);
}
}
if (R_FAILED(res)) { if (R_FAILED(res)) {
*end = 'B'; *end = 'B';
res = FSPXI_OpenFile(fspxiHandle, &file, archive, fsMakePath(PATH_ASCII, file_name), FS_OPEN_READ, 0); res = FSPXI_OpenFile(fspxiHandle, &file, archive, fsMakePath(PATH_ASCII, file_name), FS_OPEN_READ, 0);