Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Never show region free language select screen for Health and Safety Information #31

Merged
merged 2 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <coreinit/mcp.h>
#include <optional>

#define VERSION "v0.2.4"
#define VERSION "v0.2.5"
#define VERSION_FULL VERSION VERSION_EXTRA

enum Languages {
Expand Down
24 changes: 14 additions & 10 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,20 @@ void SetupRegionSpoofing() {
*/

bool forceOpenConfigMenu = false;
bool isWiiUMenu = false;
if (OSGetTitleID() == 0x0005001010040000L || // Wii U Menu JPN
OSGetTitleID() == 0x0005001010040100L || // Wii U Menu USA
OSGetTitleID() == 0x0005001010040200L) { // Wii U Menu EUR
isWiiUMenu = true;
bool isWiiUMenuOrHS = false;
auto curTitleID = OSGetTitleID();
if (curTitleID == 0x0005001010040000L || // Wii U Menu JPN
curTitleID == 0x0005001010040100L || // Wii U Menu USA
curTitleID == 0x0005001010040200L || // Wii U Menu EUR
curTitleID == 0x000500101004E000L || // Health and Safety Information JPN
curTitleID == 0x000500101004E100L || // Health and Safety Information USA
curTitleID == 0x000500101004E200L) { // Health and Safety Information EUR
isWiiUMenuOrHS = true;
}

if (!isWiiUMenu) {
if (!isWiiUMenuOrHS) {
// Set current values based on title xml
auto regionForCurrentTitleOpt = getRegionForTitle(OSGetTitleID());
auto regionForCurrentTitleOpt = getRegionForTitle(curTitleID);
if (regionForCurrentTitleOpt) {
auto region_from_xml = regionForCurrentTitleOpt.value();
if ((region_from_xml & gCurrentProductArea) == gCurrentProductArea) {
Expand Down Expand Up @@ -90,7 +94,7 @@ void SetupRegionSpoofing() {
// Read per-title settings. Give current lang/region as default values.
// If we don't have values yet for this title, we only create them if we could get the region for the current title
bool allowDefaultValues = !forceOpenConfigMenu;
auto titleRegionInfoOpt = getTitleRegionInfo(OSGetTitleID(), gCurrentLanguage, gCurrentProductArea, allowDefaultValues);
auto titleRegionInfoOpt = getTitleRegionInfo(curTitleID, gCurrentLanguage, gCurrentProductArea, allowDefaultValues);
if (titleRegionInfoOpt) {
gCurrentProductArea = titleRegionInfoOpt->product_area;
gCurrentLanguage = titleRegionInfoOpt->language;
Expand All @@ -107,10 +111,10 @@ void SetupRegionSpoofing() {
}
}

if (forceOpenConfigMenu || (!isWiiUMenu && showMenu)) {
if (forceOpenConfigMenu || (!isWiiUMenuOrHS && showMenu)) {
ConfigUtils::openConfigMenu();
// Save (updated) title settings to the storage
if (!saveTitleRegionInfo({OSGetTitleID(), gCurrentLanguage, gCurrentProductArea})) {
if (!saveTitleRegionInfo({curTitleID, gCurrentLanguage, gCurrentProductArea})) {
DEBUG_FUNCTION_LINE_ERR("Failed to save current title region info to storage");
} else {
WUPSStorageError err;
Expand Down