-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from DaniElectra/module
- Loading branch information
Showing
37 changed files
with
1,024 additions
and
371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
.cache/ | ||
.vscode/ | ||
.idea/ | ||
/build | ||
/plugin/build | ||
/dist | ||
*.elf | ||
*.wms | ||
*.wps | ||
certs/ | ||
*.lst | ||
*.lst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// Created by ash on 21/11/24. | ||
// | ||
|
||
#include "lang.h" | ||
|
||
config_strings get_config_strings(nn::swkbd::LanguageType language) { | ||
switch (language) { | ||
case nn::swkbd::LanguageType::English: | ||
default: return { | ||
#include "en_US.lang" | ||
}; | ||
case nn::swkbd::LanguageType::Spanish: return { | ||
#include "es_ES.lang" | ||
}; | ||
case nn::swkbd::LanguageType::French: return { | ||
#include "fr_FR.lang" | ||
}; | ||
case nn::swkbd::LanguageType::Italian: return { | ||
#include "it_IT.lang" | ||
}; | ||
case nn::swkbd::LanguageType::German: return { | ||
#include "de_DE.lang" | ||
}; | ||
case nn::swkbd::LanguageType::SimplifiedChinese: return { | ||
#include "zh_CN.lang" | ||
}; | ||
case nn::swkbd::LanguageType::TraditionalChinese: return { | ||
#include "zh_Hant.lang" | ||
}; | ||
case nn::swkbd::LanguageType::Portuguese: return { | ||
#include "pt_BR.lang" | ||
}; | ||
case nn::swkbd::LanguageType::Japanese: return { | ||
#include "ja_JP.lang" | ||
}; | ||
case nn::swkbd::LanguageType::Dutch: return { | ||
#include "nl_NL.lang" | ||
}; | ||
case nn::swkbd::LanguageType::Russian: return { | ||
#include "ru_RU.lang" | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#include <string_view> | ||
#include <nn/swkbd.h> | ||
|
||
struct config_strings { | ||
const char *plugin_name; | ||
std::string_view network_category; | ||
std::string_view connect_to_network_setting; | ||
std::string_view other_category; | ||
std::string_view reset_wwp_setting; | ||
std::string_view press_a_action; | ||
std::string_view restart_to_apply_action; | ||
std::string_view need_menu_action; | ||
std::string_view using_nintendo_network; | ||
std::string_view using_pretendo_network; | ||
std::string_view multiplayer_port_display; | ||
std::string_view module_not_found; | ||
std::string_view module_init_not_found; | ||
}; | ||
|
||
config_strings get_config_strings(nn::swkbd::LanguageType language); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
/* Copyright 2024 Pretendo Network contributors <pretendo.network> | ||
Copyright 2024 Ash Logan <[email protected]> | ||
Copyright 2023 Maschell | ||
Copyright 2020-2022 V10lator <[email protected]> | ||
Copyright 2022 Xpl0itU <[email protected]> | ||
|
@@ -81,8 +80,8 @@ static void get_mcp_config() { | |
mcp_os_version = os_version; | ||
|
||
DEBUG_FUNCTION_LINE_VERBOSE("Running on %d.%d.%d%c; %s%s", | ||
os_version.major, os_version.minor, os_version.patch, os_version.region | ||
config.code_id, config.serial_id | ||
os_version.major, os_version.minor, os_version.patch, os_version.region | ||
config.code_id, config.serial_id | ||
); | ||
} | ||
|
||
|
@@ -97,3 +96,20 @@ MCPSystemVersion get_console_os_version() { | |
|
||
return mcp_os_version.value_or((MCPSystemVersion) { .major = 5, .minor = 5, .patch = 5, .region = 'E' }); | ||
} | ||
|
||
static inline int digit(char a) { | ||
if (a < '0' || a > '9') return 0; | ||
return a - '0'; | ||
} | ||
|
||
uint16_t get_console_peertopeer_port() { | ||
const char * serial = get_console_serial(); | ||
|
||
uint16_t port = 50000 + | ||
(digit(serial[4]) * 1000) + | ||
(digit(serial[5]) * 100 ) + | ||
(digit(serial[6]) * 10 ) + | ||
(digit(serial[7]) * 1 ); | ||
|
||
return port; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.