From 936c344a5232e0b32a1195667e43c729b3996501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 9 Feb 2026 16:41:14 +0100 Subject: [PATCH] misc --- Core/HLE/ReplaceTables.cpp | 2 ++ Core/HLE/ReplaceTables.h | 7 ++++++- Core/MIPS/IR/IRInterpreter.cpp | 2 +- Core/MIPS/MIPSAnalyst.h | 1 - UI/GameScreen.cpp | 14 +++++++------- UI/ReportScreen.cpp | 2 +- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Core/HLE/ReplaceTables.cpp b/Core/HLE/ReplaceTables.cpp index 381f9c1900..dcc46dbe37 100644 --- a/Core/HLE/ReplaceTables.cpp +++ b/Core/HLE/ReplaceTables.cpp @@ -1848,6 +1848,8 @@ std::map SaveAndClearReplacements() { Memory::Write_U32(instr, addr); } } + + // TODO: Should we not also call replacedInstructions.clear(); ? return saved; } diff --git a/Core/HLE/ReplaceTables.h b/Core/HLE/ReplaceTables.h index c8dd61f400..0115ffa9df 100644 --- a/Core/HLE/ReplaceTables.h +++ b/Core/HLE/ReplaceTables.h @@ -15,14 +15,19 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. + // Regular replacement funcs are just C functions. These take care of their // own parameter parsing using the old school PARAM macros. // The return value is the number of cycles to eat. +// Replacement functions are replaced by function hash, also checking the size to reduce +// collisions. This is not really super safe, and we probably should restrict them by +// game ID, really... + // JIT replacefuncs can be for inline or "outline" replacement. // With inline replacement, we recognize the call to the functions // at jal time already. With outline replacement, we just replace the -// implementation. +// implementation, which gets jumped to from other functions. // In both cases the jit needs to know how much to subtract downcount. // diff --git a/Core/MIPS/IR/IRInterpreter.cpp b/Core/MIPS/IR/IRInterpreter.cpp index 87a2f28477..6ddbf77586 100644 --- a/Core/MIPS/IR/IRInterpreter.cpp +++ b/Core/MIPS/IR/IRInterpreter.cpp @@ -771,7 +771,7 @@ u32 IRInterpret(MIPSState *mips, const IRInst *inst) { case IROp::Mult: { s64 result = (s64)(s32)mips->r[inst->src1] * (s64)(s32)mips->r[inst->src2]; - memcpy(&mips->lo, &result, 8); + memcpy(&mips->lo, &result, 8); // note: lo is followed by hi, so this is ok (little-endian). break; } case IROp::MultU: diff --git a/Core/MIPS/MIPSAnalyst.h b/Core/MIPS/MIPSAnalyst.h index 2c8ed6df6f..5908f5d882 100644 --- a/Core/MIPS/MIPSAnalyst.h +++ b/Core/MIPS/MIPSAnalyst.h @@ -108,7 +108,6 @@ namespace MIPSAnalyst { void FinalizeScan(bool insertSymbols); void ForgetFunctions(u32 startAddr, u32 endAddr); - void SetHashMapFilename(const std::string& filename = ""); void LoadBuiltinHashMap(); void LoadHashMap(const Path &filename); void StoreHashMap(Path filename = Path()); diff --git a/UI/GameScreen.cpp b/UI/GameScreen.cpp index ece862f6f9..153a27baa0 100644 --- a/UI/GameScreen.cpp +++ b/UI/GameScreen.cpp @@ -206,14 +206,14 @@ void GameScreen::CreateContentViews(UI::ViewGroup *parent) { std::vector dbInfos; const bool inGameDB = g_gameDB.GetGameInfos(info_->id_version, &dbInfos); + // Show the game ID title below the icon. The top title will be from the DB. + std::string title = info_->GetTitle(); + if (knownFlags_ & GameInfoFlags::PARAM_SFO) { std::string regionID = ReplaceAll(info_->id_version, "_", " v"); if (!regionID.empty()) { regionID += ": "; - // Show the game ID title below the icon. The top title will be from the DB. - std::string title = info_->GetTitle(); - TextView *tvTitle = mainGameInfo->Add(new TextView(title, ALIGN_LEFT | FLAG_WRAP_TEXT, false, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT))); tvTitle->SetShadow(true); } @@ -278,7 +278,7 @@ void GameScreen::CreateContentViews(UI::ViewGroup *parent) { auto di = GetI18NCategory(I18NCat::DIALOG); Choice *btnResetTime = timeHoriz->Add(new Choice(di->T("Reset"), new LinearLayoutParams(0.0f, Gravity::G_VCENTER))); - btnResetTime->OnClick.Add([this, ga, timeStr](UI::EventParams &) { + btnResetTime->OnClick.Add([this, ga, timeStr, title](UI::EventParams &) { auto di = GetI18NCategory(I18NCat::DIALOG); auto gta = GetI18NCategory(I18NCat::GAME); std::string id = info_->id; @@ -286,12 +286,12 @@ void GameScreen::CreateContentViews(UI::ViewGroup *parent) { questionText += "\n"; questionText += timeStr; screenManager()->push( - new PromptScreen(gamePath_, questionText, di->T("Reset"), di->T("Cancel"), [id](bool yes) { - if (yes) { + new UI::MessagePopupScreen(title, questionText, di->T("Reset"), di->T("Cancel"), [this, id](bool reset) { + if (reset) { g_Config.TimeTracker().Reset(id); + RecreateViews(); } })); - RecreateViews(); }); } diff --git a/UI/ReportScreen.cpp b/UI/ReportScreen.cpp index f3dec1ce9e..55523be59a 100644 --- a/UI/ReportScreen.cpp +++ b/UI/ReportScreen.cpp @@ -428,7 +428,7 @@ void ReportFinishScreen::CreateDialogViews(UI::ViewGroup *parent) { parent->Add(new Spacer(20.0f)); - parent->Add(new Choice(rp->T("View Feedback"), ImageID("I_LINK_OUT")))->OnClick.Handle(this, &ReportFinishScreen::HandleViewFeedback); + parent->Add(new Choice(rp->T("View Feedback"), ImageID("I_LINK_OUT"), new LayoutParams(WRAP_CONTENT, ITEM_HEIGHT)))->OnClick.Handle(this, &ReportFinishScreen::HandleViewFeedback); } void ReportFinishScreen::update() {