CustomShardFont: Error Popup if a custom shared font was generated

This commit is contained in:
B3n30 2017-08-30 10:44:07 +02:00
parent ce1f25d133
commit 4c06dd953a
4 changed files with 31 additions and 2 deletions

View File

@ -52,7 +52,7 @@ elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
export Qt5_DIR=$(brew --prefix)/opt/qt5 export Qt5_DIR=$(brew --prefix)/opt/qt5
mkdir build && cd build mkdir build && cd build
cmake .. make .. -GXcode -DENABLE_CUSTOM_SYSTEM_ARCHIVES=1 cmake .. -GXcode -DENABLE_CUSTOM_SYSTEM_ARCHIVES=1
xcodebuild -configuration Release xcodebuild -configuration Release
ctest -VV -C Release ctest -VV -C Release

View File

@ -421,6 +421,22 @@ bool GMainWindow::LoadROM(const QString& filename) {
} }
return false; return false;
} }
Core::System::Integrity integrity = system.GetSystemIntegrity();
if (integrity && Core::System::Integrity::SharedFont) {
#ifdef ENABLE_CUSTOM_SYSTEM_ARCHIVES
QMessageBox::critical(
this, tr("Shared Font Created."),
tr("The Shared Font is missing. A custom Shared Font was created. This could result in "
"some ugly or wrong glyphs. It is recomended to dump the Shared Font from your 3ds. "
"For more information on dumping these files, please see the "
"following wiki page: <a "
"href='https://citra-emu.org/wiki/"
"dumping-system-archives-and-the-shared-fonts-from-a-3ds-console/'>Dumping System "
"Archives and the Shared Fonts from a 3DS Console</a>."));
#endif
// Don't show an error meassage if the Shared Font is missing. This Message will popup
// anyway if the game requires it
}
return true; return true;
} }

View File

@ -208,7 +208,7 @@ void System::Shutdown() {
} }
void System::SystemIntegrityCheck() { void System::SystemIntegrityCheck() {
system_integrity = static_cast<Integrity>(0);
// Shared Font // Shared Font
// TODO(B3N30): check/create font archive for region CHN/KOR/TWN // TODO(B3N30): check/create font archive for region CHN/KOR/TWN
std::string nand_directory = FileUtil::GetUserPath(D_NAND_IDX); std::string nand_directory = FileUtil::GetUserPath(D_NAND_IDX);
@ -228,8 +228,10 @@ void System::SystemIntegrityCheck() {
if (file->IsOpen()) { if (file->IsOpen()) {
file->Close(); file->Close();
LOG_INFO(Core, "SystemCheck: Shared Font(legacy) exists."); LOG_INFO(Core, "SystemCheck: Shared Font(legacy) exists.");
return true;
} else { } else {
LOG_ERROR(Core, "SystemCheck: Shared Font missing."); LOG_ERROR(Core, "SystemCheck: Shared Font missing.");
system_integrity = static_cast<Integrity>(system_integrity | Integrity::SharedFont);
#ifdef ENABLE_CUSTOM_SYSTEM_ARCHIVES #ifdef ENABLE_CUSTOM_SYSTEM_ARCHIVES
file = std::make_shared<FileUtil::IOFile>(shared_font_path, "w+b"); file = std::make_shared<FileUtil::IOFile>(shared_font_path, "w+b");
file->WriteBytes(SHARED_FONT_DATA, SHARED_FONT_DATA_len); file->WriteBytes(SHARED_FONT_DATA, SHARED_FONT_DATA_len);

View File

@ -43,6 +43,10 @@ public:
ErrorUnknown ///< Any other error ErrorUnknown ///< Any other error
}; };
enum Integrity : u32 {
SharedFont = 1 << 0,
};
/** /**
* Run the core CPU loop * Run the core CPU loop
* This function runs the core for the specified number of CPU instructions before trying to * This function runs the core for the specified number of CPU instructions before trying to
@ -116,6 +120,10 @@ public:
return status_details; return status_details;
} }
const Integrity GetSystemIntegrity() const {
return system_integrity;
}
Loader::AppLoader& GetAppLoader() const { Loader::AppLoader& GetAppLoader() const {
return *app_loader; return *app_loader;
} }
@ -150,6 +158,9 @@ private:
static System s_instance; static System s_instance;
/// Integrity of the system
Integrity system_integrity;
ResultStatus status = ResultStatus::Success; ResultStatus status = ResultStatus::Success;
std::string status_details = ""; std::string status_details = "";
}; };