mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Merge pull request #20515 from hrydgard/more-misc-fixes
Additional fixes for 1.19.2
This commit is contained in:
@@ -322,6 +322,10 @@ void ConvertUTF8ToJavaModifiedUTF8(std::string *output, std::string_view input)
|
||||
output[out_idx++] = (char)0x80;
|
||||
i++;
|
||||
} else if ((c & 0xF0) == 0xF0) { // 4-byte sequence (U+10000 to U+10FFFF)
|
||||
if (i + 4 > input.length()) {
|
||||
// Bad.
|
||||
break;
|
||||
}
|
||||
// Decode the Unicode code point from the UTF-8 sequence
|
||||
uint32_t code_point = ((input[i] & 0x07) << 18) |
|
||||
((input[i + 1] & 0x3F) << 12) |
|
||||
@@ -345,6 +349,9 @@ void ConvertUTF8ToJavaModifiedUTF8(std::string *output, std::string_view input)
|
||||
} else if ((c & 0xF0) == 0xE0) {
|
||||
utf8_len = 3; // 3-byte sequence
|
||||
}
|
||||
if (i + utf8_len > input.length()) {
|
||||
break;
|
||||
}
|
||||
memcpy(output->data() + out_idx, input.data() + i, utf8_len);
|
||||
out_idx += utf8_len;
|
||||
i += utf8_len;
|
||||
|
||||
@@ -338,10 +338,12 @@ bool ReadSingleFileFromZip(Path zipFile, const char *path, std::string *data, st
|
||||
|
||||
struct zip_stat zstat;
|
||||
if (zip_stat(zip, path, ZIP_FL_NOCASE | ZIP_FL_UNCHANGED, &zstat) != 0) {
|
||||
zip_close(zip);
|
||||
return false;
|
||||
}
|
||||
zip_file *file = zip_fopen_index(zip, zstat.index, ZIP_FL_UNCHANGED);
|
||||
if (!file) {
|
||||
zip_close(zip);
|
||||
return false;
|
||||
}
|
||||
if (mutex) {
|
||||
|
||||
@@ -30,9 +30,9 @@ public:
|
||||
return true;
|
||||
|
||||
uint32_t us = budget_s > 0 ? (uint32_t)(budget_s * 1000000.0) : 0;
|
||||
if (us == 0)
|
||||
if (us == 0) {
|
||||
return false;
|
||||
|
||||
}
|
||||
std::unique_lock<std::mutex> lock(mutex_);
|
||||
return cond_.wait_for(lock, std::chrono::microseconds(us), [&] { return triggered_.load(); });
|
||||
}
|
||||
|
||||
@@ -313,8 +313,10 @@ void ScreenManager::sendMessage(UIMessage message, const char *value) {
|
||||
|
||||
// NOTE: Changed this to send the message to all screens, instead of just the top one,
|
||||
// to allow EmuScreen to receive messages from popup menus. Hope this didn't break anything..
|
||||
for (auto &iter : stack_) {
|
||||
iter.screen->sendMessage(message, value);
|
||||
for (const auto &iter : stack_) {
|
||||
if (iter.screen) {
|
||||
iter.screen->sendMessage(message, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +160,10 @@ void ControlMapper::SetCallbacks(
|
||||
}
|
||||
|
||||
void ControlMapper::SetPSPAxis(int device, int stick, char axis, float value) {
|
||||
int axisId = axis == 'X' ? 0 : 1;
|
||||
const int axisId = axis == 'X' ? 0 : 1;
|
||||
if (stick != 0 && stick != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
float position[2];
|
||||
position[0] = history_[stick][0];
|
||||
|
||||
@@ -1359,6 +1359,8 @@ static PSPModule *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 load
|
||||
}
|
||||
|
||||
if (scan) {
|
||||
// TODO: Limit this to the newly loaded range! This is expensive, well, at least in debug builds
|
||||
// and the cause of stutter during Wipeout Pure initialization.
|
||||
MIPSAnalyst::FinalizeScan(insertSymbols);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
#include "Core/MIPS/JitCommon/JitState.h"
|
||||
|
||||
JitCompareScreen::JitCompareScreen() : UIDialogScreenWithBackground() {
|
||||
if (!MIPSComp::jit) {
|
||||
return;
|
||||
}
|
||||
JitBlockCacheDebugInterface *blockCacheDebug = MIPSComp::jit->GetBlockCacheDebugInterface();
|
||||
// The only defaults that make sense.
|
||||
if (blockCacheDebug->SupportsProfiling()) {
|
||||
|
||||
+10
-10
@@ -16,15 +16,15 @@ private:
|
||||
// Uses the current ListType
|
||||
void FillBlockList();
|
||||
|
||||
UI::LinearLayout *comparisonView_;
|
||||
UI::LinearLayout *leftDisasm_;
|
||||
UI::LinearLayout *rightDisasm_;
|
||||
UI::LinearLayout *comparisonView_ = nullptr;
|
||||
UI::LinearLayout *leftDisasm_ = nullptr;
|
||||
UI::LinearLayout *rightDisasm_ = nullptr;
|
||||
|
||||
UI::LinearLayout *blockListView_;
|
||||
UI::LinearLayout *blockListContainer_;
|
||||
UI::LinearLayout *blockListView_ = nullptr;
|
||||
UI::LinearLayout *blockListContainer_ = nullptr;
|
||||
|
||||
UI::LinearLayout *statsView_;
|
||||
UI::LinearLayout *statsContainer_;
|
||||
UI::LinearLayout *statsView_ = nullptr;
|
||||
UI::LinearLayout *statsContainer_ = nullptr;
|
||||
|
||||
UI::EventReturn OnSelectBlock(UI::EventParams &e);
|
||||
UI::EventReturn OnBlockAddress(UI::EventParams &e);
|
||||
@@ -60,9 +60,9 @@ private:
|
||||
int64_t sumExecutions_ = 0;
|
||||
std::vector<int> blockList_; // for BLOCK_LIST mode
|
||||
|
||||
UI::TextView *blockName_;
|
||||
UI::TextEdit *blockAddr_;
|
||||
UI::TextView *blockStats_;
|
||||
UI::TextView *blockName_ = nullptr;
|
||||
UI::TextEdit *blockAddr_ = nullptr;
|
||||
UI::TextView *blockStats_ = nullptr;
|
||||
};
|
||||
|
||||
class AddressPromptScreen : public PopupScreen {
|
||||
|
||||
+3
-1
@@ -1191,7 +1191,9 @@ void SettingInfoMessage::Show(std::string_view text, const UI::View *refView) {
|
||||
}
|
||||
}
|
||||
}
|
||||
text_->SetText(text);
|
||||
if (text_) {
|
||||
text_->SetText(text);
|
||||
}
|
||||
timeShown_ = time_now_d();
|
||||
}
|
||||
|
||||
|
||||
@@ -116,8 +116,10 @@ void TabbedUIDialogScreenWithGameBackground::RecreateViews() {
|
||||
}
|
||||
|
||||
void TabbedUIDialogScreenWithGameBackground::EnsureTabs() {
|
||||
_assert_(tabHolder_);
|
||||
tabHolder_->EnsureAllCreated();
|
||||
_dbg_assert_(tabHolder_);
|
||||
if (tabHolder_) {
|
||||
tabHolder_->EnsureAllCreated();
|
||||
}
|
||||
}
|
||||
|
||||
void TabbedUIDialogScreenWithGameBackground::ApplySearchFilter() {
|
||||
|
||||
+1
-1
@@ -699,7 +699,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string
|
||||
{
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
std::string_view backendSwitchError = err->T("GenericBackendSwitchCrash", "PPSSPP crashed while starting. This usually means a graphics driver problem. Try upgrading your graphics drivers.\n\nGraphics backend has been switched:");
|
||||
std::wstring full_error = ConvertUTF8ToWString(StringFromFormat("%s %s", backendSwitchError, param1.c_str()));
|
||||
std::wstring full_error = ConvertUTF8ToWString(StringFromFormat("%.*s %s", (int)backendSwitchError.size(), backendSwitchError.data(), param1.c_str()));
|
||||
std::wstring title = ConvertUTF8ToWString(err->T("GenericGraphicsError", "Graphics Error"));
|
||||
MessageBox(MainWindow::GetHWND(), full_error.c_str(), title.c_str(), MB_OK);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user