From b3d08977d573d8f3c005fb0d14efef8a9069ab45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 8 Dec 2024 11:25:00 +0100 Subject: [PATCH] Delete unused code --- Core/HLE/sceKernelModule.cpp | 6 +----- Core/PSPLoaders.cpp | 2 +- Core/System.cpp | 25 +------------------------ Core/System.h | 3 --- GPU/GLES/ShaderManagerGLES.cpp | 2 -- GPU/Vulkan/GPU_Vulkan.cpp | 1 - UI/EmuScreen.cpp | 14 +------------- UI/EmuScreen.h | 1 - 8 files changed, 4 insertions(+), 50 deletions(-) diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index 28f7ae87d3..598b10d42b 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -1895,8 +1895,6 @@ void __KernelLoadReset() { bool __KernelLoadExec(const char *filename, u32 paramPtr, std::string *error_string) { SceKernelLoadExecParam param{}; - PSP_SetLoading("Loading exec..."); - auto paramData = PSPPointer::Create(paramPtr); if (paramData.IsValid()) { param = *paramData; @@ -1929,7 +1927,6 @@ bool __KernelLoadExec(const char *filename, u32 paramPtr, std::string *error_str return false; } - PSP_SetLoading("Loading modules..."); size_t size = fileData.size(); PSPModule *module = __KernelLoadModule(fileData.data(), size, 0, error_string); @@ -1969,7 +1966,7 @@ bool __KernelLoadExec(const char *filename, u32 paramPtr, std::string *error_str if (module->nm.module_start_thread_stacksize != 0) option.stacksize = module->nm.module_start_thread_stacksize; - PSP_SetLoading("Starting modules..."); + INFO_LOG(Log::System, "Starting modules..."); if (paramPtr) __KernelStartModule(module, param.args, (const char*)param_argp, &option); else @@ -1986,7 +1983,6 @@ bool __KernelLoadExec(const char *filename, u32 paramPtr, std::string *error_str bool __KernelLoadGEDump(const std::string &base_filename, std::string *error_string) { __KernelLoadReset(); - PSP_SetLoading("Generating code..."); mipsr4k.pc = PSP_GetUserMemoryBase(); diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index f4097e6c2e..6a4aaa44c2 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -321,7 +321,7 @@ bool Load_PSP_ISO(FileLoader *fileLoader, std::string *error_string) { AndroidJNIThreadContext jniContext; - PSP_SetLoading("Loading executable..."); + INFO_LOG(Log::System, "Loading executable..."); // TODO: We can't use the initial error_string pointer. bool success = __KernelLoadExec(bootpath.c_str(), 0, &PSP_CoreParameter().errorString); if (success && coreState == CORE_POWERUP) { diff --git a/Core/System.cpp b/Core/System.cpp index 29189f5551..243ba6b36a 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -79,14 +79,7 @@ enum CPUThreadState { CPU_THREAD_NOT_RUNNING, - CPU_THREAD_PENDING, - CPU_THREAD_STARTING, CPU_THREAD_RUNNING, - CPU_THREAD_SHUTDOWN, - CPU_THREAD_QUIT, - - CPU_THREAD_EXECUTE, - CPU_THREAD_RESUME, }; MetaFileSystem pspFileSystem; @@ -96,11 +89,6 @@ CoreParameter g_CoreParameter; static FileLoader *g_loadedFile; // For background loading thread. static std::mutex loadingLock; -// For loadingReason updates. -static std::mutex loadingReasonLock; -static std::string loadingReason; - -bool audioInitialized; bool coreCollectDebugStats = false; static int coreCollectDebugStatsCounter = 0; @@ -441,7 +429,6 @@ bool PSP_InitStart(const CoreParameter &coreParam, std::string *error_string) { } g_CoreParameter.errorString.clear(); pspIsIniting = true; - PSP_SetLoading("Loading game..."); Path filename = g_CoreParameter.fileToStart; FileLoader *loadedFile = ResolveFileLoaderTarget(ConstructFileLoader(filename)); @@ -500,7 +487,7 @@ bool PSP_InitUpdate(std::string *error_string) { } if (success && gpu == nullptr) { - PSP_SetLoading("Starting graphics..."); + INFO_LOG(Log::System, "Starting graphics..."); Draw::DrawContext *draw = g_CoreParameter.graphicsContext ? g_CoreParameter.graphicsContext->GetDrawContext() : nullptr; success = GPU_Init(g_CoreParameter.graphicsContext, draw); if (!success) { @@ -671,16 +658,6 @@ void PSP_RunLoopFor(int cycles) { PSP_RunLoopUntil(CoreTiming::GetTicks() + cycles); } -void PSP_SetLoading(const std::string &reason) { - std::lock_guard guard(loadingReasonLock); - loadingReason = reason; -} - -std::string PSP_GetLoading() { - std::lock_guard guard(loadingReasonLock); - return loadingReason; -} - Path GetSysDirectory(PSPDirectories directoryType) { const Path &memStickDirectory = g_Config.memStickDirectory; Path pspDirectory; diff --git a/Core/System.h b/Core/System.h index a3b6c2e685..a46c265e4d 100644 --- a/Core/System.h +++ b/Core/System.h @@ -86,9 +86,6 @@ void PSP_RunLoopWhileState(); void PSP_RunLoopUntil(u64 globalticks); void PSP_RunLoopFor(int cycles); -void PSP_SetLoading(const std::string &reason); -std::string PSP_GetLoading(); - // Used to wait for background loading thread. struct PSP_LoadingLock { PSP_LoadingLock(); diff --git a/GPU/GLES/ShaderManagerGLES.cpp b/GPU/GLES/ShaderManagerGLES.cpp index 8ca73b00fb..c3e0316b02 100644 --- a/GPU/GLES/ShaderManagerGLES.cpp +++ b/GPU/GLES/ShaderManagerGLES.cpp @@ -1088,8 +1088,6 @@ bool ShaderManagerGLES::LoadCache(File::IOFile &f) { return true; } - PSP_SetLoading("Compiling shaders..."); - double start = time_now_d(); for (size_t &i = pending.vertPos; i < pending.vert.size(); i++) { diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index 8ae8862735..73acc0fe58 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -103,7 +103,6 @@ void GPU_Vulkan::LoadCache(const Path &filename) { return; } - PSP_SetLoading("Loading shader cache..."); // Actually precompiled by IsReady() since we're single-threaded. FILE *f = File::OpenCFile(filename, "rb"); if (!f) diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index bc581fa1f5..7c2469829a 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1159,8 +1159,6 @@ void EmuScreen::CreateViews() { root_->Add(saveStatePreview_); GameInfoBGView *loadingBG = root_->Add(new GameInfoBGView(gamePath_, new AnchorLayoutParams(FILL_PARENT, FILL_PARENT))); - TextView *loadingTextView = root_->Add(new TextView(sc->T(PSP_GetLoading()), new AnchorLayoutParams(bounds.centerX(), NONE, NONE, 40, true))); - loadingTextView_ = loadingTextView; static const ImageID symbols[4] = { ImageID("I_CROSS"), @@ -1173,17 +1171,11 @@ void EmuScreen::CreateViews() { loadingSpinner_ = loadingSpinner; loadingBG->SetTag("LoadingBG"); - loadingTextView->SetTag("LoadingText"); loadingSpinner->SetTag("LoadingSpinner"); - // Don't really need this, and it creates a lot of strings to translate... - loadingTextView->SetVisibility(V_GONE); - loadingTextView->SetShadow(true); - loadingViewColor_ = loadingSpinner->AddTween(new CallbackColorTween(0x00FFFFFF, 0x00FFFFFF, 0.2f, &bezierEaseInOut)); - loadingViewColor_->SetCallback([loadingBG, loadingTextView, loadingSpinner](View *v, uint32_t c) { + loadingViewColor_->SetCallback([loadingBG, loadingSpinner](View *v, uint32_t c) { loadingBG->SetColor(c & 0xFFC0C0C0); - loadingTextView->SetTextColor(c); loadingSpinner->SetColor(alphaMul(c, 0.7f)); }); loadingViewColor_->Persist(); @@ -1504,10 +1496,6 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) { } if (invalid_) { - // Loading, or after shutdown? - if (loadingTextView_ && loadingTextView_->GetVisibility() == UI::V_VISIBLE) - loadingTextView_->SetText(PSP_GetLoading()); - // It's possible this might be set outside PSP_RunLoopFor(). // In this case, we need to double check it here. if (mode & ScreenRenderMode::TOP) { diff --git a/UI/EmuScreen.h b/UI/EmuScreen.h index 691ce17cda..0101778b7e 100644 --- a/UI/EmuScreen.h +++ b/UI/EmuScreen.h @@ -117,7 +117,6 @@ private: UI::CallbackColorTween *loadingViewColor_ = nullptr; UI::VisibilityTween *loadingViewVisible_ = nullptr; UI::Spinner *loadingSpinner_ = nullptr; - UI::TextView *loadingTextView_ = nullptr; UI::Button *resumeButton_ = nullptr; UI::Button *resetButton_ = nullptr; UI::Button *backButton_ = nullptr;