Skip to content

Commit

Permalink
Merge pull request #18737 from hrydgard/warn-about-extracted-isos
Browse files Browse the repository at this point in the history
Warn that extracted ISOs might not work
  • Loading branch information
hrydgard committed Jan 20, 2024
2 parents 7cff030 + 96dcf40 commit 789c7e5
Show file tree
Hide file tree
Showing 50 changed files with 82 additions and 10 deletions.
1 change: 1 addition & 0 deletions Common/System/OSD.h
Expand Up @@ -14,6 +14,7 @@ enum class OSDType {
MESSAGE_ERROR,
MESSAGE_ERROR_DUMP, // displays lots of text (after the first line), small size
MESSAGE_FILE_LINK,
MESSAGE_CENTERED_WARNING,

ACHIEVEMENT_UNLOCKED,

Expand Down
1 change: 1 addition & 0 deletions Core/ConfigValues.h
Expand Up @@ -151,6 +151,7 @@ enum class ScreenEdgePosition {
TOP_RIGHT = 5,
CENTER_LEFT = 6,
CENTER_RIGHT = 7,
CENTER = 8, // Used for REALLY important messages! Not RetroAchievements notifications.
VALUE_COUNT,
};

Expand Down
8 changes: 6 additions & 2 deletions Core/HLE/sceDisplay.cpp
Expand Up @@ -484,7 +484,9 @@ static void DoFrameIdleTiming() {
sleep_ms(1);
#else
const double left = goal - cur_time;
usleep((long)(left * 1000000));
if (left > 0.0f && left < 1.0f) { // Sanity check
usleep((long)(left * 1000000));
}
#endif
}

Expand Down Expand Up @@ -743,7 +745,9 @@ void hleLagSync(u64 userdata, int cyclesLate) {
// Tight loop on win32 - intentionally, as timing is otherwise not precise enough.
#ifndef _WIN32
const double left = goal - now;
usleep((long)(left * 1000000.0));
if (left > 0.0f && left < 1.0f) { // Sanity check
usleep((long)(left * 1000000.0));
}
#else
yield();
#endif
Expand Down
25 changes: 21 additions & 4 deletions Tools/langtool/src/main.rs
Expand Up @@ -27,6 +27,11 @@ enum Command {
section: String,
key: String,
},
AddNewKeyValue {
section: String,
key: String,
value: String,
},
MoveKey {
old: String,
new: String,
Expand Down Expand Up @@ -116,9 +121,9 @@ fn remove_key(target_ini: &mut IniFile, section: &str, key: &str) -> io::Result<
Ok(())
}

fn add_new_key(target_ini: &mut IniFile, section: &str, key: &str) -> io::Result<()> {
fn add_new_key(target_ini: &mut IniFile, section: &str, key: &str, value: &str) -> io::Result<()> {
if let Some(section) = target_ini.get_section_mut(section) {
section.insert_line_if_missing(&format!("{} = {}", key, key));
section.insert_line_if_missing(&format!("{} = {}", key, value));
} else {
println!("No section {}", section);
}
Expand Down Expand Up @@ -206,7 +211,12 @@ fn main() {
Command::AddNewKey {
ref section,
ref key,
} => add_new_key(&mut target_ini, section, key).unwrap(),
} => add_new_key(&mut target_ini, section, key, key).unwrap(),
Command::AddNewKeyValue {
ref section,
ref key,
ref value,
} => add_new_key(&mut target_ini, section, key, value).unwrap(),
Command::MoveKey {
ref old,
ref new,
Expand Down Expand Up @@ -235,7 +245,14 @@ fn main() {
ref section,
ref key,
} => {
add_new_key(&mut reference_ini, section, key).unwrap();
add_new_key(&mut reference_ini, section, key, key).unwrap();
}
Command::AddNewKeyValue {
ref section,
ref key,
ref value,
} => {
add_new_key(&mut reference_ini, section, key, value).unwrap();
}
Command::SortSection { ref section } => sort_section(&mut reference_ini, section).unwrap(),
Command::RenameKey {
Expand Down
6 changes: 5 additions & 1 deletion UI/EmuScreen.cpp
Expand Up @@ -273,6 +273,11 @@ void EmuScreen::bootGame(const Path &filename) {
if (!info || info->pending)
return;

auto sc = GetI18NCategory(I18NCat::SCREEN);
if (info->fileType == IdentifiedFileType::PSP_DISC_DIRECTORY) {
g_OSD.Show(OSDType::MESSAGE_CENTERED_WARNING, sc->T("ExtractedIsoWarning", "Extracted ISOs often don't work.\nPlay the ISO file directly."), gamePath_.ToVisualString(), 7.0f);
}

extraAssertInfoStr_ = info->id + " " + info->GetTitle();
SetExtraAssertInfo(extraAssertInfoStr_.c_str());

Expand All @@ -283,7 +288,6 @@ void EmuScreen::bootGame(const Path &filename) {

g_Discord.SetPresenceGame(info->GetTitle().c_str());
} else {
auto sc = GetI18NCategory(I18NCat::SCREEN);
g_Discord.SetPresenceGame(sc->T("Untitled PSP game"));
}

Expand Down
2 changes: 0 additions & 2 deletions UI/GameInfoCache.cpp
Expand Up @@ -600,8 +600,6 @@ class GameInfoWorkItem : public Task {
// Let's use the comparison screenshot as an icon, if it exists.
if (ReadLocalFileToString(screenshotPath, &info_->icon.data, &info_->lock)) {
info_->icon.dataLoaded = true;
} else {
ERROR_LOG(G3D, "Error loading screenshot data: '%s'", screenshotPath.c_str());
}
break;
}
Expand Down
6 changes: 5 additions & 1 deletion UI/OnScreenDisplay.cpp
Expand Up @@ -53,7 +53,9 @@ static NoticeLevel GetNoticeLevel(OSDType type) {
case OSDType::MESSAGE_INFO: return NoticeLevel::INFO;
case OSDType::MESSAGE_ERROR:
case OSDType::MESSAGE_ERROR_DUMP: return NoticeLevel::ERROR;
case OSDType::MESSAGE_WARNING: return NoticeLevel::WARN;
case OSDType::MESSAGE_WARNING:
case OSDType::MESSAGE_CENTERED_WARNING:
return NoticeLevel::WARN;
case OSDType::MESSAGE_SUCCESS: return NoticeLevel::SUCCESS;
default: return NoticeLevel::SUCCESS;
}
Expand Down Expand Up @@ -290,6 +292,7 @@ void OnScreenMessagesView::Draw(UIContext &dc) {
typeEdges[(size_t)OSDType::LEADERBOARD_STARTED_FAILED] = (ScreenEdgePosition)g_Config.iAchievementsLeaderboardStartedOrFailedPos;
typeEdges[(size_t)OSDType::LEADERBOARD_SUBMITTED] = (ScreenEdgePosition)g_Config.iAchievementsLeaderboardSubmittedPos;
typeEdges[(size_t)OSDType::ACHIEVEMENT_UNLOCKED] = (ScreenEdgePosition)g_Config.iAchievementsUnlockedPos;
typeEdges[(size_t)OSDType::MESSAGE_CENTERED_WARNING] = ScreenEdgePosition::CENTER;

dc.SetFontScale(1.0f, 1.0f);

Expand Down Expand Up @@ -390,6 +393,7 @@ void OnScreenMessagesView::Draw(UIContext &dc) {
case ScreenEdgePosition::BOTTOM_RIGHT: horizAdj = 1; vertAdj = 1; break;
case ScreenEdgePosition::TOP_CENTER: vertAdj = -1; break;
case ScreenEdgePosition::BOTTOM_CENTER: vertAdj = 1; break;
case ScreenEdgePosition::CENTER: break;
default: break;
}

Expand Down
1 change: 1 addition & 0 deletions assets/lang/ar_AE.ini
Expand Up @@ -1131,6 +1131,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = WARNING: Chainfire3D detected, may cause problems.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Failed to load state
Failed to save state = Failed to save state
fixed = ‎السرعة: الجانبي
Expand Down
1 change: 1 addition & 0 deletions assets/lang/az_AZ.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = WARNING: Chainfire3D detected, may cause problems.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Failed to load state
Failed to save state = Failed to save state
fixed = Speed: alternate
Expand Down
1 change: 1 addition & 0 deletions assets/lang/bg_BG.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = ВНИМАНИЕ: Chainfire3D засечен, може да създаде проблеми
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Failed to load state
Failed to save state = Failed to save state
fixed = Speed: alternate
Expand Down
1 change: 1 addition & 0 deletions assets/lang/ca_ES.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Mida
[Screen]
Cardboard VR OFF = Cardboard VR apagat
Chainfire3DWarning = AVÍS: "Chainfire3D" detectat, pot causar problemes.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Error en carregar l'estat.
Failed to save state = Error en desar l'estat.
fixed = Velocitat: alternativa
Expand Down
1 change: 1 addition & 0 deletions assets/lang/cz_CZ.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = VAROVÁNÍ: Zjištěn Chainfire3D, může způsobit problémy.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Načtení stavu selhalo
Failed to save state = Uložení stavu selhalo
fixed = Rychlost: alternativní
Expand Down
1 change: 1 addition & 0 deletions assets/lang/da_DK.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = ADVARSEL: Chainfire3D detekteret, kan give problemer
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Kunne ikke hente tilstand
Failed to save state = Kunne ikke gemme tilstand
fixed = Hastighed: fast
Expand Down
1 change: 1 addition & 0 deletions assets/lang/de_DE.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Größe
[Screen]
Cardboard VR OFF = Cardboard VR aus
Chainfire3DWarning = WARNUNG: Chainfire3D erkannt, möglicherweise problematisch
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Laden des Standes fehlgeschlagen
Failed to save state = Speichern des Standes fehlgeschlagen
fixed = Geschwindigkeit: Fest
Expand Down
1 change: 1 addition & 0 deletions assets/lang/dr_ID.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = WARNING: Chainfire3D detected, may cause problems.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Failed to load state
Failed to save state = Failed to save state
fixed = Lassinna: sembarang
Expand Down
1 change: 1 addition & 0 deletions assets/lang/en_US.ini
Expand Up @@ -1147,6 +1147,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = WARNING: Chainfire3D detected, may cause problems.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Failed to load state
Failed to save state = Failed to save state
fixed = Speed: alternate
Expand Down
1 change: 1 addition & 0 deletions assets/lang/es_ES.ini
Expand Up @@ -1124,6 +1124,7 @@ Size = Tamaño
[Screen]
Cardboard VR OFF = Cardboard VR apagado
Chainfire3DWarning = AVISO: "Chainfire3D" detectado, puede causar problemas.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Error al cargar el estado.
Failed to save state = Error al guardar el estado.
fixed = Velocidad: alternativa
Expand Down
1 change: 1 addition & 0 deletions assets/lang/es_LA.ini
Expand Up @@ -1125,6 +1125,7 @@ Size = Tamaño
[Screen]
Cardboard VR OFF = Cardboard VR apagado
Chainfire3DWarning = ADVERTENCIA: Chainfire3D detectado, puede causar problemas.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Error al abrir el estado.
Failed to save state = Error al guardar el estado.
fixed = Velocidad: fija
Expand Down
1 change: 1 addition & 0 deletions assets/lang/fa_IR.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = WARNING: Chainfire3D detected, may cause problems.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Failed to load state
Failed to save state = Failed to save state
fixed = ‎سرعت: متناوب
Expand Down
1 change: 1 addition & 0 deletions assets/lang/fi_FI.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Koko
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = WARNING: Chainfire3D detected, may cause problems.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Failed to load state
Failed to save state = Failed to save state
fixed = Nopeus: vaihtoehtoinen
Expand Down
1 change: 1 addition & 0 deletions assets/lang/fr_FR.ini
Expand Up @@ -1114,6 +1114,7 @@ Size = Taille
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = Avertissement : Chainfire3D détecté, cela peut poser des problèmes.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Échec du chargement de l'état
Failed to save state = Échec de la sauvegarde de l'état
fixed = Vitesse alternative 1
Expand Down
1 change: 1 addition & 0 deletions assets/lang/gl_ES.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = AVISO: Chainfire3D detectado, pode causar problemas.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Erro ó cargar o estado
Failed to save state = Error ó gardar o estado
fixed = Velocidad: alternativa
Expand Down
1 change: 1 addition & 0 deletions assets/lang/gr_EL.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Μέγεθος
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = ΠΡΟΣΟΧΗ: Η εφαρμογή Chainfire3D εντοπίστηκε, ενδέχεται να προκαλέσει προβλήματα.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Σφάλμα φόρτωσης σημείου αποθήκευσης
Failed to save state = Σφάλμα αποθήκευσης σημείου αποθήκευσης
fixed = Ταχύτητα: καθορισμένη
Expand Down
1 change: 1 addition & 0 deletions assets/lang/he_IL.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = WARNING: Chainfire3D detected, may cause problems.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Failed to load state
Failed to save state = Failed to save state
fixed = יותר מהיר
Expand Down
1 change: 1 addition & 0 deletions assets/lang/he_IL_invert.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = WARNING: Chainfire3D detected, may cause problems.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Failed to load state
Failed to save state = Failed to save state
fixed = ריהמ רתוי
Expand Down
1 change: 1 addition & 0 deletions assets/lang/hr_HR.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Veličina
[Screen]
Cardboard VR OFF = Cardboard VR isključen
Chainfire3DWarning = UPOZORENJE: Chainfire3D uočen, može stvarati probleme.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Nije moguće učitati save
Failed to save state = Nije moguće spremiti state
fixed = Speed: alternate
Expand Down
1 change: 1 addition & 0 deletions assets/lang/hu_HU.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Méret
[Screen]
Cardboard VR OFF = Cardboard VR ki
Chainfire3DWarning = FIGYELMEZTETÉS: Chainfire3D észlelve, problémákat okozhat
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Állapotmentés betöltése sikertelen
Failed to save state = Állápotmentés készítése sikertelen
fixed = Sebesség: alternatív
Expand Down
1 change: 1 addition & 0 deletions assets/lang/id_ID.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Ukuran
[Screen]
Cardboard VR OFF = Cardboard VR mati
Chainfire3DWarning = Peringatan: Chainfire3D terdeteksi, mungkin akan menyebabkan masalah.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Gagal memuat status permainan
Failed to save state = Gagal menyimpan status permainan
fixed = Kecepatan: alternatif
Expand Down
1 change: 1 addition & 0 deletions assets/lang/it_IT.ini
Expand Up @@ -1124,6 +1124,7 @@ Size = Dimensioni
[Screen]
Cardboard VR OFF = Cardboard VR spenta
Chainfire3DWarning = AVVISO: rilevato Chainfire3D, potrebbe causare problemi
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Impossibile caricare il salvataggio di stato
Failed to save state = Impossibile salvare il salvataggio di stato
Loaded. Game may refuse to save over different savedata. = Caricato. Il gioco potrebbe rifiutarsi da salvare su dati di salvataggio differenti.
Expand Down
1 change: 1 addition & 0 deletions assets/lang/ja_JP.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = サイズ
[Screen]
Cardboard VR OFF = Cardboard VRオフ
Chainfire3DWarning = 警告: Chainfire3Dを検出しました。問題が起きるかもしれません。
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = ステートのロードに失敗しました
Failed to save state = ステートのセーブに失敗しました
fixed = 速度: カスタム速度1
Expand Down
1 change: 1 addition & 0 deletions assets/lang/jv_ID.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = PERINGATAN: Chainfire3D terdeteksi, mungkin menyebabkan masalah.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Failed to load state
Failed to save state = Failed to save state
fixed = Kecepatan: ora-tetep
Expand Down
1 change: 1 addition & 0 deletions assets/lang/ko_KR.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = 크기
[Screen]
Cardboard VR OFF = 카드보드 VR 끔
Chainfire3DWarning = 경고: Chainfire3D가 감지되어 문제를 일으킬 수 있습니다.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = 상태를 불러오지 못함
Failed to save state = 상태를 저장하지 못함
fixed = 속도: 대체
Expand Down
1 change: 1 addition & 0 deletions assets/lang/lo_LA.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = ລະວັງ: ກວດພົບ Chainfire3D, ອາດເກີດບັນຫາໄດ້.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = ລົ້ມເຫຼວໃນການໂຫຼດໄຟລ໌ບັນທຶກ
Failed to save state = ລົ້ມເຫຼວໃນການບັນທຶກໄຟລ໌ບັນທຶກ
fixed = ຄວາມໄວ: ຕາມທີ່ປັບໃຊ້
Expand Down
1 change: 1 addition & 0 deletions assets/lang/lt-LT.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = ĮSPĖJIMAS: "Chainfire3D" surastas, gali kelti problemų!
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Failed to load state
Failed to save state = Failed to save state
fixed = Greitis: alternatyvus
Expand Down
1 change: 1 addition & 0 deletions assets/lang/ms_MY.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = AMARAN: Chainfire3D dikesan, boleh menyebabkan masalah
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Failed to load state
Failed to save state = Failed to save state
fixed = Kelajuan: Alternatif
Expand Down
1 change: 1 addition & 0 deletions assets/lang/nl_NL.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = WAARSCHUWING: Chainfire3D gedetecteerd, kan problemen veroorzaken.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Kon de savestate niet laden
Failed to save state = Kon de savestate niet opslaan
fixed = Snelheid: alternatief
Expand Down
1 change: 1 addition & 0 deletions assets/lang/no_NO.ini
Expand Up @@ -1123,6 +1123,7 @@ Size = Size
[Screen]
Cardboard VR OFF = Cardboard VR off
Chainfire3DWarning = WARNING: Chainfire3D detected, may cause problems.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Failed to load state
Failed to save state = Failed to save state
fixed = Hastighet: alternativ
Expand Down
1 change: 1 addition & 0 deletions assets/lang/pl_PL.ini
Expand Up @@ -1129,6 +1129,7 @@ Size = Rozmiar
[Screen]
Cardboard VR OFF = Wył. Cardboard VR
Chainfire3DWarning = UWAGA: Wykryto Chainfire3D, może powodować problemy.
ExtractedISOWarning = Extracted ISOs often don't work.\nPlay the ISO file directly.
Failed to load state = Nie można wczytać zapisu stanu
Failed to save state = Nie można zapisać stanu
fixed = Prędkość: alternatywna
Expand Down

0 comments on commit 789c7e5

Please sign in to comment.