diff --git a/CMakeLists.txt b/CMakeLists.txt index 44e31829aa..43030de041 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2869,7 +2869,6 @@ set(NativeAssets assets/ppge_atlas.zim assets/ppge_atlas.meta assets/rargray.png - assets/unknown.png assets/zip.png assets/sfx_back.wav assets/sfx_confirm.wav diff --git a/Common/File/PathBrowser.cpp b/Common/File/PathBrowser.cpp index 3f1a26fa1b..008e0f5394 100644 --- a/Common/File/PathBrowser.cpp +++ b/Common/File/PathBrowser.cpp @@ -152,7 +152,7 @@ void PathBrowser::HandlePath() { if (pendingThread_.joinable()) return; - pendingThread_ = std::thread([&] { + pendingThread_ = std::thread([this] { SetCurrentThreadName("PathBrowser"); AndroidJNIThreadContext jniContext; // destructor detaches diff --git a/Common/GPU/OpenGL/GLQueueRunner.cpp b/Common/GPU/OpenGL/GLQueueRunner.cpp index 803e22d2f1..e85d830e5a 100644 --- a/Common/GPU/OpenGL/GLQueueRunner.cpp +++ b/Common/GPU/OpenGL/GLQueueRunner.cpp @@ -59,7 +59,7 @@ void GLQueueRunner::CreateDeviceObjects() { // Populate some strings from the GL thread so they can be queried from thin3d. // TODO: Merge with GLFeatures.cpp/h - auto populate = [&](int name) { + auto populate = [this](int name) { const GLubyte *value = glGetString(name); if (!value) glStrings_[name] = "?"; diff --git a/Common/GPU/Vulkan/VulkanContext.h b/Common/GPU/Vulkan/VulkanContext.h index 7786727240..842bcdf6b0 100644 --- a/Common/GPU/Vulkan/VulkanContext.h +++ b/Common/GPU/Vulkan/VulkanContext.h @@ -437,6 +437,10 @@ public: return vulkanDeviceApiVersion_; } + WindowSystem GetWindowSystem() const { + return winsys_; + } + private: bool ChooseQueue(); diff --git a/Common/GPU/Vulkan/VulkanRenderManager.cpp b/Common/GPU/Vulkan/VulkanRenderManager.cpp index 4c26d78187..50b694819d 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.cpp +++ b/Common/GPU/Vulkan/VulkanRenderManager.cpp @@ -106,6 +106,19 @@ bool VKRGraphicsPipeline::Create(VulkanContext *vulkan, VkRenderPass compatibleR VkPipelineInputAssemblyStateCreateInfo inputAssembly{ VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO }; inputAssembly.topology = desc->topology; + inputAssembly.primitiveRestartEnable = VK_FALSE; + +#if PPSSPP_PLATFORM(MAC) + if (vulkan->GetWindowSystem() == WindowSystem::WINDOWSYSTEM_METAL_EXT) { + if (desc->topology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP || + desc->topology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN || + desc->topology == VK_PRIMITIVE_TOPOLOGY_LINE_STRIP) { + // Metal requires primitive restart to be on to not warn - having it off + // simply isn't supported. + inputAssembly.primitiveRestartEnable = VK_TRUE; + } + } +#endif // We will use dynamic viewport state. pipe.pVertexInputState = &desc->vis; diff --git a/Common/Log/ConsoleListener.cpp b/Common/Log/ConsoleListener.cpp index 1e48743f83..dd1feeaf4c 100644 --- a/Common/Log/ConsoleListener.cpp +++ b/Common/Log/ConsoleListener.cpp @@ -124,7 +124,7 @@ void ConsoleListener::Open() { } if (useThread_ && hTriggerEvent != NULL && !thread_.joinable()) { - thread_ = std::thread([&] { + thread_ = std::thread([this] { SetCurrentThreadName("Console"); LogWriterThread(); }); diff --git a/Common/Thread/ParallelLoop.cpp b/Common/Thread/ParallelLoop.cpp index 4f4036d4e3..25fbaddbe4 100644 --- a/Common/Thread/ParallelLoop.cpp +++ b/Common/Thread/ParallelLoop.cpp @@ -129,7 +129,7 @@ void ParallelMemcpy(ThreadManager *threadMan, void *dst, const void *src, size_t char *d = (char *)dst; const char *s = (const char *)src; - ParallelRangeLoop(threadMan, [&](int l, int h) { + ParallelRangeLoop(threadMan, [d, s](int l, int h) { memmove(d + l, s + l, h - l); }, 0, (int)bytes, 128 * 1024, priority); } @@ -145,7 +145,7 @@ void ParallelMemset(ThreadManager *threadMan, void *dst, uint8_t value, size_t b // unknown's testing showed that 128kB is an appropriate minimum size. char *d = (char *)dst; - ParallelRangeLoop(threadMan, [&](int l, int h) { + ParallelRangeLoop(threadMan, [d, value](int l, int h) { memset(d + l, value, h - l); }, 0, (int)bytes, 128 * 1024, priority); } diff --git a/Common/Thread/ThreadManager.cpp b/Common/Thread/ThreadManager.cpp index 98e0b43a57..efd35f3f26 100644 --- a/Common/Thread/ThreadManager.cpp +++ b/Common/Thread/ThreadManager.cpp @@ -68,7 +68,7 @@ void ThreadManager::Teardown() { // Purge any cancellable tasks while the threads shut down. if (global_->compute_queue_size > 0 || global_->io_queue_size > 0) { - auto drainQueue = [&](std::deque queue[TASK_PRIORITY_COUNT], std::atomic &size) { + auto drainQueue = [this](std::deque queue[TASK_PRIORITY_COUNT], std::atomic &size) { for (size_t i = 0; i < TASK_PRIORITY_COUNT; ++i) { for (auto it = queue[i].begin(); it != queue[i].end(); ++it) { if (TeardownTask(*it, false)) { diff --git a/Core/Dialog/SavedataParam.cpp b/Core/Dialog/SavedataParam.cpp index c565600b0d..a4e8baacfc 100644 --- a/Core/Dialog/SavedataParam.cpp +++ b/Core/Dialog/SavedataParam.cpp @@ -607,7 +607,9 @@ int SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &saveD if (param->icon1FileData.buf.IsValid()) { std::string icon1path = dirPath + "/" + ICON1_FILENAME; - WritePSPFile(icon1path, param->icon1FileData.buf, param->icon1FileData.size); + if (param->icon1FileData.size > 0) { + WritePSPFile(icon1path, param->icon1FileData.buf, param->icon1FileData.size); + } } // SAVE PIC1 if (param->pic1FileData.buf.IsValid()) @@ -619,7 +621,9 @@ int SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &saveD if (param->snd0FileData.buf.IsValid()) { std::string snd0path = dirPath + "/" + SND0_FILENAME; - WritePSPFile(snd0path, param->snd0FileData.buf, param->snd0FileData.size); + if (param->snd0FileData.size > 0) { + WritePSPFile(snd0path, param->snd0FileData.buf, param->snd0FileData.size); + } } return 0; } diff --git a/Core/HLE/sceKernelMemory.cpp b/Core/HLE/sceKernelMemory.cpp index fc8a6b9b3d..0a90988006 100644 --- a/Core/HLE/sceKernelMemory.cpp +++ b/Core/HLE/sceKernelMemory.cpp @@ -1387,7 +1387,10 @@ static bool __KernelAllocateVpl(SceUID uid, u32 size, u32 addrPtr, u32 &error, b VPL *vpl = kernelObjects.Get(uid, error); if (vpl) { if (size == 0 || size > (u32) vpl->nv.poolSize) { - WARN_LOG(Log::sceKernel, "%s(vpl=%i, size=%i, ptrout=%08x): invalid size", funcname, uid, size, addrPtr); + if (size != 0) { + // Some games do a lot of 0-sized allocations, ignore. + WARN_LOG(Log::sceKernel, "%s(vpl=%i, size=%i, ptrout=%08x): invalid size", funcname, uid, size, addrPtr); + } error = SCE_KERNEL_ERROR_ILLEGAL_MEMSIZE; return false; } diff --git a/SDL/CocoaBarItems.mm b/SDL/CocoaBarItems.mm index 47ed7306dc..472a3d3c9e 100644 --- a/SDL/CocoaBarItems.mm +++ b/SDL/CocoaBarItems.mm @@ -170,7 +170,7 @@ void OSXOpenURL(const char *url) { { GlobalUIState state = GetUIState(); item.enabled = state == UISTATE_INGAME ? YES : NO; - printf("Setting enabled state to %d\n", (int)item.enabled); + // printf("Setting enabled state to %d\n", (int)item.enabled); break; } default: diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index 1f014101ef..ec9620a9e3 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -630,8 +630,7 @@ public: } else if (File::Exists(screenshot_jpg)) { ReadLocalFileToString(screenshot_jpg, &info_->icon.data, &info_->lock); } else { - // Read standard icon - ReadVFSToString("unknown.png", &info_->icon.data, &info_->lock); + // No icon. } } info_->icon.dataLoaded = true; @@ -688,9 +687,7 @@ handleELF: } else if (File::Exists(screenshot_jpg)) { ReadLocalFileToString(screenshot_jpg, &info_->icon.data, &info_->lock); } else { - // Read standard icon - VERBOSE_LOG(Log::Loader, "Loading unknown.png because there was an ELF"); - ReadVFSToString("unknown.png", &info_->icon.data, &info_->lock); + // No icon } info_->icon.dataLoaded = true; } @@ -854,13 +851,13 @@ handleELF: Path screenshot_jpg = GetSysDirectory(DIRECTORY_SCREENSHOT) / (info_->id + "_00000.jpg"); Path screenshot_png = GetSysDirectory(DIRECTORY_SCREENSHOT) / (info_->id + "_00000.png"); // Try using png/jpg screenshots first - if (File::Exists(screenshot_png)) + if (File::Exists(screenshot_png)) { info_->icon.dataLoaded = ReadLocalFileToString(screenshot_png, &info_->icon.data, &info_->lock); - else if (File::Exists(screenshot_jpg)) + } else if (File::Exists(screenshot_jpg)) { info_->icon.dataLoaded = ReadLocalFileToString(screenshot_jpg, &info_->icon.data, &info_->lock); - else { - DEBUG_LOG(Log::Loader, "Loading unknown.png because no icon was found"); - info_->icon.dataLoaded = ReadVFSToString("unknown.png", &info_->icon.data, &info_->lock); + } else { + // This should be very rare. + info_->icon.dataLoaded = true; } } } diff --git a/UI/GameScreen.cpp b/UI/GameScreen.cpp index 153a27baa0..004191fce2 100644 --- a/UI/GameScreen.cpp +++ b/UI/GameScreen.cpp @@ -187,14 +187,14 @@ void GameScreen::CreateContentViews(UI::ViewGroup *parent) { if (portrait) { mainGameInfo = new LinearLayout(ORIENT_VERTICAL); leftColumn->Add(new Spacer(8.0f)); - if (fileTypeHasIcon) { + if (fileTypeHasIcon && !(info_->icon.dataLoaded && info_->icon.data.empty())) { leftColumn->Add(new GameImageView(gamePath_, GameInfoFlags::ICON, 2.0f, new LinearLayoutParams(UI::Margins(0)))); } leftColumn->Add(mainGameInfo); } else { mainGameInfo = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)); ViewGroup *badgeHolder = new LinearLayout(ORIENT_HORIZONTAL); - if (fileTypeHasIcon) { + if (fileTypeHasIcon && !(info_->icon.dataLoaded && info_->icon.data.empty())) { badgeHolder->Add(new GameImageView(gamePath_, GameInfoFlags::ICON, 2.0f, new LinearLayoutParams(144 * 2, 80 * 2, UI::Margins(0)))); } badgeHolder->Add(mainGameInfo); diff --git a/UI/InstallZipScreen.cpp b/UI/InstallZipScreen.cpp index aa6a69a097..e8a7d80259 100644 --- a/UI/InstallZipScreen.cpp +++ b/UI/InstallZipScreen.cpp @@ -99,7 +99,14 @@ void InstallZipScreen::CreateSettingsViews(UI::ViewGroup *parent) { default: // Nothing to do! break; - } + } + + if (System_GetPropertyBool(SYSPROP_CAN_SHOW_FILE)) { + parent->Add(new Spacer(12.0f)); + parent->Add(new Choice(di->T("Show in folder")))->OnClick.Add([this](UI::EventParams &) { + System_ShowFileInFolder(zipPath_); + }); + } if (showDeleteCheckbox) { parent->Add(new Spacer(12.0f)); @@ -168,8 +175,6 @@ void InstallZipScreen::CreateContentViews(UI::ViewGroup *parent) { leftColumn->Add(new TextView(question)); leftColumn->Add(new TextView(shortFilename)); - doneView_ = leftColumn->Add(new TextView("")); - showDeleteCheckbox = true; break; } @@ -188,7 +193,6 @@ void InstallZipScreen::CreateContentViews(UI::ViewGroup *parent) { destFolders_.push_back(savestateDir); // TODO: Use the GameInfoCache to display data about the game if available. - doneView_ = leftColumn->Add(new TextView("")); showDeleteCheckbox = true; break; } @@ -230,7 +234,6 @@ void InstallZipScreen::CreateContentViews(UI::ViewGroup *parent) { } } - doneView_ = leftColumn->Add(new TextView("")); showDeleteCheckbox = true; break; } @@ -244,13 +247,17 @@ void InstallZipScreen::CreateContentViews(UI::ViewGroup *parent) { leftColumn->Add(new TextView(er->T("File format not supported"))); break; case ZipFileContents::UNKNOWN: + leftColumn->Add(new TextView(GetFriendlyPath(zipPath_))); leftColumn->Add(new TextView(iz->T("Zip file does not contain PSP software"), ALIGN_LEFT, false, new AnchorLayoutParams(10, 10, NONE, NONE))); break; default: + leftColumn->Add(new TextView(GetFriendlyPath(zipPath_))); leftColumn->Add(new TextView(er->T("The file is not a valid zip file"), ALIGN_LEFT, false, new AnchorLayoutParams(10, 10, NONE, NONE))); break; } + doneView_ = leftColumn->Add(new TextView("")); + if (destFolders_.size() > 1) { leftColumn->Add(new TextView(iz->T("Install into folder"))); for (int i = 0; i < (int)destFolders_.size(); i++) { @@ -260,7 +267,6 @@ void InstallZipScreen::CreateContentViews(UI::ViewGroup *parent) { leftColumn->Add(new TextView(iz->T("Install into folder"))); leftColumn->Add(new TextView(GetFriendlyPath(destFolders_[0])))->SetAlign(FLAG_WRAP_TEXT); } - if (overwrite) { leftColumn->Add(new NoticeView(NoticeLevel::WARN, di->T("Confirm Overwrite"), "")); } diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 846fef9bf4..266b8fc20b 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -292,8 +292,10 @@ void GameButton::Draw(UIContext &dc) { // Some types we just draw a default icon for. ImageID imageIcon = ImageID::invalid(); + bool drawBackground = true; switch (ginfo->fileType) { - case IdentifiedFileType::UNKNOWN_ELF: imageIcon = ImageID("I_DEBUGGER"); break; + case IdentifiedFileType::PSP_ELF: imageIcon = ImageID("I_DEBUGGER"); drawBackground = false; break; + case IdentifiedFileType::UNKNOWN_ELF: imageIcon = ImageID("I_CROSS"); drawBackground = false; break; case IdentifiedFileType::PPSSPP_GE_DUMP: imageIcon = ImageID("I_DISPLAY"); break; case IdentifiedFileType::PSX_ISO: case IdentifiedFileType::PSP_PS1_PBP: imageIcon = ImageID("I_PSX_ISO"); break; @@ -323,8 +325,13 @@ void GameButton::Draw(UIContext &dc) { } } - if (ginfo->Ready(GameInfoFlags::ICON) && ginfo->icon.texture) { - texture = ginfo->icon.texture; + if (ginfo->Ready(GameInfoFlags::ICON)) { + if (ginfo->icon.texture && drawBackground) { + texture = ginfo->icon.texture; + } else if (drawBackground) { + // No icon, but drawBackground is set. Let's show a plain icon. + imageIcon = ImageID("I_APP"); + } } int x = bounds_.x; diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index c17e8748c9..29ab95cfaa 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -670,10 +670,10 @@ void GamePauseScreen::CreateViews() { if (middleColumn) { middleColumn->SetSpacing(portrait ? 8.0f : 0.0f); - playButton_ = middleColumn->Add(new Choice(g_Config.bRunBehindPauseMenu ? ImageID("I_PAUSE") : ImageID("I_PLAY"), new LinearLayoutParams(64, 64))); + playButton_ = middleColumn->Add(new Choice(g_Config.bRunBehindPauseMenu ? ImageID("I_PAUSE_LINE") : ImageID("I_PLAY_LINE"), new LinearLayoutParams(64, 64))); playButton_->OnClick.Add([this](UI::EventParams &e) { g_Config.bRunBehindPauseMenu = !g_Config.bRunBehindPauseMenu; - playButton_->SetIconLeft(g_Config.bRunBehindPauseMenu ? ImageID("I_PAUSE") : ImageID("I_PLAY")); + playButton_->SetIconLeft(g_Config.bRunBehindPauseMenu ? ImageID("I_PAUSE_LINE") : ImageID("I_PLAY_LINE")); }); bool mustRunBehind = MustRunBehind(); diff --git a/UI/UIAtlas.cpp b/UI/UIAtlas.cpp index 2bbee969a6..fd71c28fba 100644 --- a/UI/UIAtlas.cpp +++ b/UI/UIAtlas.cpp @@ -121,8 +121,10 @@ static const ImageMeta imageIDs[] = { {"I_ACHIEVEMENT", false}, {"I_CHECKMARK", false}, {"I_PLAY", false}, - {"I_STOP", false}, {"I_PAUSE", false}, + {"I_STOP", false}, + {"I_PLAY_LINE", false}, + {"I_PAUSE_LINE", false}, {"I_FAST_FORWARD", false}, {"I_FAST_FORWARD_LINE", false}, {"I_RECORD", false}, @@ -177,6 +179,7 @@ static const ImageMeta imageIDs[] = { {"I_PS3_ISO", false}, {"I_UNKNOWN_ISO", false}, {"I_UMD_VIDEO_ISO", false}, + {"I_APP", false}, }; static std::string PNGNameFromID(std::string_view id) { diff --git a/android/buildassets.sh b/android/buildassets.sh index bd7384ad16..6b61ce8f75 100644 --- a/android/buildassets.sh +++ b/android/buildassets.sh @@ -1,7 +1,6 @@ mkdir -p assets cp ../assets/7z.png assets/ cp ../assets/rargray.png assets/ -cp ../assets/unknown.png assets/ cp ../assets/zip.png assets/ cp ../assets/*.zim assets/ cp ../assets/*.meta assets/ diff --git a/assets/ui_images/images.svg b/assets/ui_images/images.svg index 1ae85cadf1..49e10b7e6f 100644 --- a/assets/ui_images/images.svg +++ b/assets/ui_images/images.svg @@ -24,9 +24,9 @@ inkscape:pagecheckerboard="true" inkscape:deskcolor="#d1d1d1" inkscape:document-units="px" - inkscape:zoom="5.656855" - inkscape:cx="359.29859" - inkscape:cy="610.32146" + inkscape:zoom="2.8284275" + inkscape:cx="173.06436" + inkscape:cy="581.41847" inkscape:window-width="3840" inkscape:window-height="2071" inkscape:window-x="-9" @@ -2839,14 +2839,14 @@ inkscape:groupmode="layer" id="layer1">