From f32f89dd902eed360999cf64f50ee30ef073ec56 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 15 Feb 2021 09:28:07 -0800 Subject: [PATCH] Global: Remove some unused variables. --- Common/Arm64Emitter.cpp | 2 -- Common/CPUDetect.cpp | 2 ++ Common/ConsoleListener.cpp | 2 -- Common/GPU/D3D11/thin3d_d3d11.cpp | 2 -- Common/GPU/D3D9/thin3d_d3d9.cpp | 10 ++------- Common/GPU/Vulkan/VulkanContext.cpp | 2 -- Common/GPU/Vulkan/VulkanDebug.cpp | 1 - Common/GPU/Vulkan/VulkanLoader.cpp | 2 ++ Common/GPU/Vulkan/VulkanMemory.cpp | 1 - Core/Debugger/DisassemblyManager.cpp | 2 -- Core/Debugger/SymbolMap.cpp | 2 -- Core/FileSystems/DirectoryFileSystem.cpp | 2 +- Core/HLE/sceDisplay.cpp | 2 -- Core/HLE/sceFont.cpp | 1 - Core/HLE/sceKernelMsgPipe.cpp | 1 - Core/HLE/sceKernelThread.cpp | 2 -- Core/HLE/scePsmf.cpp | 1 - Core/MIPS/ARM/ArmRegCacheFPU.cpp | 3 --- Core/MIPS/IR/IRCompVFPU.cpp | 3 +-- Core/MIPS/IR/IRJit.cpp | 2 +- Core/MIPS/IR/IRPassSimplify.cpp | 1 - Core/MIPS/MIPSInt.cpp | 1 - Core/MIPS/MIPSIntVFPU.cpp | 6 ++---- Core/MIPS/MIPSTables.cpp | 24 ---------------------- Core/MIPS/MIPSVFPUUtils.cpp | 1 - Core/MIPS/x86/Asm.cpp | 2 +- Core/MIPS/x86/CompLoadStore.cpp | 4 +--- Core/MIPS/x86/CompVFPU.cpp | 7 +------ Core/Reporting.cpp | 1 - Core/Util/DisArm64.cpp | 1 - Core/WaveFile.h | 1 - GPU/Common/DrawEngineCommon.cpp | 1 - GPU/Common/PresentationCommon.cpp | 1 - GPU/Common/ShaderUniforms.cpp | 1 - GPU/Common/TextureCacheCommon.cpp | 3 --- GPU/Common/VertexDecoderArm.cpp | 1 - GPU/Common/VertexDecoderArm64.cpp | 1 - GPU/Common/VertexDecoderX86.cpp | 1 - GPU/D3D11/DrawEngineD3D11.cpp | 6 ------ GPU/D3D11/FramebufferManagerD3D11.cpp | 2 -- GPU/Directx9/DrawEngineDX9.cpp | 3 --- GPU/Directx9/FramebufferManagerDX9.cpp | 3 --- GPU/Directx9/TextureCacheDX9.cpp | 2 -- GPU/Directx9/TextureCacheDX9.h | 1 - GPU/GLES/DrawEngineGLES.cpp | 6 +----- GPU/GLES/FramebufferManagerGLES.cpp | 2 -- GPU/GLES/TextureCacheGLES.cpp | 1 - GPU/GPUCommon.cpp | 1 - GPU/Software/Clipper.cpp | 1 - GPU/Software/Rasterizer.cpp | 1 - GPU/Vulkan/DebugVisVulkan.cpp | 1 - GPU/Vulkan/DrawEngineVulkan.cpp | 4 ---- GPU/Vulkan/PipelineManagerVulkan.cpp | 5 +++-- GPU/Vulkan/TextureCacheVulkan.cpp | 1 - GPU/Vulkan/VulkanUtil.cpp | 1 - UI/ControlMappingScreen.cpp | 3 --- UI/CwCheatScreen.cpp | 2 +- UI/EmuScreen.cpp | 2 -- UI/GameInfoCache.cpp | 1 - UI/GameSettingsScreen.cpp | 2 +- UI/GamepadEmu.cpp | 3 --- UI/MiscScreens.cpp | 7 ++----- UI/NativeApp.cpp | 1 - UI/ProfilerDraw.cpp | 2 ++ UI/TouchControlLayoutScreen.cpp | 1 - Windows/DSoundStream.cpp | 3 --- Windows/Debugger/CtrlDisAsmView.cpp | 3 --- Windows/Debugger/CtrlRegisterList.cpp | 1 - Windows/Debugger/CtrlRegisterList.h | 3 --- Windows/Debugger/Debugger_Disasm.cpp | 3 +-- Windows/GEDebugger/CtrlDisplayListView.cpp | 2 -- Windows/MainWindowMenu.cpp | 10 --------- Windows/W32Util/TabControl.cpp | 2 +- Windows/main.cpp | 3 ++- 74 files changed, 28 insertions(+), 170 deletions(-) diff --git a/Common/Arm64Emitter.cpp b/Common/Arm64Emitter.cpp index 5201126584..ec6e0ef61c 100644 --- a/Common/Arm64Emitter.cpp +++ b/Common/Arm64Emitter.cpp @@ -3833,8 +3833,6 @@ bool ARM64XEmitter::TryEORI2R(ARM64Reg Rd, ARM64Reg Rn, u64 imm) { } float FPImm8ToFloat(uint8_t bits) { - int E = 8; - int F = 32 - 8 - 1; int sign = bits >> 7; uint32_t f = 0; f |= (sign << 31); diff --git a/Common/CPUDetect.cpp b/Common/CPUDetect.cpp index 04780f5f7f..9a1daacbed 100644 --- a/Common/CPUDetect.cpp +++ b/Common/CPUDetect.cpp @@ -114,6 +114,7 @@ CPUInfo::CPUInfo() { Detect(); } +#if PPSSPP_PLATFORM(LINUX) static std::vector ParseCPUList(const std::string &filename) { std::string data; std::vector results; @@ -135,6 +136,7 @@ static std::vector ParseCPUList(const std::string &filename) { return results; } +#endif // Detects the various cpu features void CPUInfo::Detect() { diff --git a/Common/ConsoleListener.cpp b/Common/ConsoleListener.cpp index e5625c4f0f..141d92e26d 100644 --- a/Common/ConsoleListener.cpp +++ b/Common/ConsoleListener.cpp @@ -517,8 +517,6 @@ void ConsoleListener::PixelSpace(int Left, int Top, int Width, int Height, bool // Check size if (Width < 8 || Height < 12) return; - bool DBef = true; - bool DAft = true; std::string SLog = ""; // Get console info diff --git a/Common/GPU/D3D11/thin3d_d3d11.cpp b/Common/GPU/D3D11/thin3d_d3d11.cpp index 5c2fcd34cb..795faa51ce 100644 --- a/Common/GPU/D3D11/thin3d_d3d11.cpp +++ b/Common/GPU/D3D11/thin3d_d3d11.cpp @@ -1023,7 +1023,6 @@ Pipeline *D3D11DrawContext::CreateGraphicsPipeline(const PipelineDesc &desc) { // Can finally create the input layout if (dPipeline->input) { - auto &inputDesc = dPipeline->input->desc; const std::vector &elements = dPipeline->input->elements; HRESULT hr = device_->CreateInputLayout(elements.data(), (UINT)elements.size(), vshader->byteCode_.data(), vshader->byteCode_.size(), &dPipeline->il); if (!SUCCEEDED(hr)) { @@ -1488,7 +1487,6 @@ bool D3D11DrawContext::CopyFramebufferToMemorySync(Framebuffer *src, int channel packDesc.MipLevels = 1; packDesc.Usage = D3D11_USAGE_STAGING; packDesc.SampleDesc.Count = 1; - D3D11_BOX srcBox{ (UINT)bx, (UINT)by, 0, (UINT)(bx + bw), (UINT)(by + bh), 1 }; switch (channelBits) { case FB_COLOR_BIT: packDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; // TODO: fb->colorFormat; diff --git a/Common/GPU/D3D9/thin3d_d3d9.cpp b/Common/GPU/D3D9/thin3d_d3d9.cpp index afd920535d..d317bee809 100644 --- a/Common/GPU/D3D9/thin3d_d3d9.cpp +++ b/Common/GPU/D3D9/thin3d_d3d9.cpp @@ -271,7 +271,7 @@ private: class D3D9Pipeline : public Pipeline { public: - D3D9Pipeline(LPDIRECT3DDEVICE9 device) : device_(device) {} + D3D9Pipeline() {} ~D3D9Pipeline() { if (depthStencil) depthStencil->Release(); if (blend) blend->Release(); @@ -294,8 +294,6 @@ public: UniformBufferDesc dynamicUniforms; void Apply(LPDIRECT3DDEVICE9 device); -private: - LPDIRECT3DDEVICE9 device_; }; class D3D9Texture : public Texture { @@ -695,7 +693,7 @@ Pipeline *D3D9Context::CreateGraphicsPipeline(const PipelineDesc &desc) { ERROR_LOG(G3D, "Pipeline requires at least one shader"); return NULL; } - D3D9Pipeline *pipeline = new D3D9Pipeline(device_); + D3D9Pipeline *pipeline = new D3D9Pipeline(); for (auto iter : desc.shaders) { if (!iter) { ERROR_LOG(G3D, "NULL shader passed to CreateGraphicsPipeline"); @@ -971,9 +969,6 @@ void D3D9Context::Draw(int vertexCount, int offset) { } void D3D9Context::DrawIndexed(int vertexCount, int offset) { - D3D9Buffer *vbuf = static_cast(curVBuffers_[0]); - D3D9Buffer *ibuf = static_cast(curIBuffer_); - curPipeline_->Apply(device_); curPipeline_->inputLayout->Apply(device_); device_->SetStreamSource(0, curVBuffers_[0]->vbuffer_, curVBufferOffsets_[0], curPipeline_->inputLayout->GetStride(0)); @@ -1032,7 +1027,6 @@ void D3D9Context::SetStencilRef(uint8_t ref) { bool D3D9ShaderModule::Compile(LPDIRECT3DDEVICE9 device, const uint8_t *data, size_t size) { LPD3D_SHADER_MACRO defines = nullptr; LPD3DINCLUDE includes = nullptr; - DWORD flags = 0; LPD3DBLOB codeBuffer = nullptr; LPD3DBLOB errorBuffer = nullptr; const char *source = (const char *)data; diff --git a/Common/GPU/Vulkan/VulkanContext.cpp b/Common/GPU/Vulkan/VulkanContext.cpp index bf77c2720f..f3ca9b8ece 100644 --- a/Common/GPU/Vulkan/VulkanContext.cpp +++ b/Common/GPU/Vulkan/VulkanContext.cpp @@ -1001,7 +1001,6 @@ bool VulkanContext::InitSwapchain() { std::string currentTransform = surface_transforms_to_string(surfCapabilities_.currentTransform); g_display_rotation = DisplayRotation::ROTATE_0; g_display_rot_matrix.setIdentity(); - bool swapChainExtentSwap = false; if (surfCapabilities_.currentTransform & (VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR | VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR)) { preTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; } else if (surfCapabilities_.currentTransform & (VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR | VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR | VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR)) { @@ -1429,7 +1428,6 @@ bool IsHashMaliDriverVersion(const VkPhysicalDeviceProperties &props) { // ARM used to put a hash in place of the driver version. // Now they only use major versions. We'll just make a bad heuristic. uint32_t major = VK_VERSION_MAJOR(props.driverVersion); - uint32_t minor = VK_VERSION_MINOR(props.driverVersion); uint32_t branch = VK_VERSION_PATCH(props.driverVersion); if (branch > 0) return true; diff --git a/Common/GPU/Vulkan/VulkanDebug.cpp b/Common/GPU/Vulkan/VulkanDebug.cpp index acfd81b1d5..d4052e970a 100644 --- a/Common/GPU/Vulkan/VulkanDebug.cpp +++ b/Common/GPU/Vulkan/VulkanDebug.cpp @@ -43,7 +43,6 @@ VKAPI_ATTR VkBool32 VKAPI_CALL VulkanDebugUtilsCallback( return false; } - const char *pLayerPrefix = ""; if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) { message << "ERROR("; } else if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) { diff --git a/Common/GPU/Vulkan/VulkanLoader.cpp b/Common/GPU/Vulkan/VulkanLoader.cpp index ad44606272..76d94545bb 100644 --- a/Common/GPU/Vulkan/VulkanLoader.cpp +++ b/Common/GPU/Vulkan/VulkanLoader.cpp @@ -235,6 +235,7 @@ static const char *device_name_blacklist[] = { "SDL:Horizon", }; +#ifndef _WIN32 static const char *so_names[] = { #ifdef IOS "@executable_path/Frameworks/libMoltenVK.dylib", @@ -247,6 +248,7 @@ static const char *so_names[] = { #endif #endif }; +#endif void VulkanSetAvailable(bool available) { g_vulkanAvailabilityChecked = true; diff --git a/Common/GPU/Vulkan/VulkanMemory.cpp b/Common/GPU/Vulkan/VulkanMemory.cpp index ce002733b7..77f41732cc 100644 --- a/Common/GPU/Vulkan/VulkanMemory.cpp +++ b/Common/GPU/Vulkan/VulkanMemory.cpp @@ -246,7 +246,6 @@ size_t VulkanDeviceAllocator::Allocate(const VkMemoryRequirements &reqs, VkDevic bool VulkanDeviceAllocator::AllocateFromSlab(Slab &slab, size_t &start, size_t blocks, const char *tag) { _assert_(!destroyed_); - bool matched = true; if (start + blocks > slab.usage.size()) { start = slab.usage.size(); diff --git a/Core/Debugger/DisassemblyManager.cpp b/Core/Debugger/DisassemblyManager.cpp index d05a0984b6..d263d78897 100644 --- a/Core/Debugger/DisassemblyManager.cpp +++ b/Core/Debugger/DisassemblyManager.cpp @@ -302,7 +302,6 @@ u32 DisassemblyManager::getNthPreviousAddress(u32 address, int n) { DisassemblyEntry* entry = it->second; int oldLineNum = entry->getLineNum(address,true); - int oldNumLines = entry->getNumLines(); if (n <= oldLineNum) { return entry->getLineAddress(oldLineNum-n); @@ -420,7 +419,6 @@ int DisassemblyFunction::getLineNum(u32 address, bool findStart) int last = (int)lineAddresses.size() - 1; for (int i = 0; i < last; i++) { - u32 next = lineAddresses[i + 1]; if (lineAddresses[i] == address) return i; } diff --git a/Core/Debugger/SymbolMap.cpp b/Core/Debugger/SymbolMap.cpp index 0efd301b0e..d5949d6a62 100644 --- a/Core/Debugger/SymbolMap.cpp +++ b/Core/Debugger/SymbolMap.cpp @@ -1045,7 +1045,6 @@ void SymbolMap::FillSymbolListBox(HWND listbox,SymbolType symType) { SendMessage(listbox, LB_INITSTORAGE, (WPARAM)activeFunctions.size(), (LPARAM)activeFunctions.size() * 30); for (auto it = activeFunctions.begin(), end = activeFunctions.end(); it != end; ++it) { - const FunctionEntry& entry = it->second; const char* name = GetLabelName(it->first); if (name != NULL) wsprintf(temp, L"%S", name); @@ -1069,7 +1068,6 @@ void SymbolMap::FillSymbolListBox(HWND listbox,SymbolType symType) { } for (auto it = activeData.begin(), end = activeData.end(); it != end; ++it) { - const DataEntry& entry = it->second; const char* name = GetLabelName(it->first); if (name != NULL) diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp index a2ca786dfa..2fe206c977 100644 --- a/Core/FileSystems/DirectoryFileSystem.cpp +++ b/Core/FileSystems/DirectoryFileSystem.cpp @@ -431,7 +431,7 @@ size_t DirectoryFileHandle::Seek(s32 position, FileMove type) LARGE_INTEGER distance; distance.QuadPart = position; LARGE_INTEGER cursor; - DWORD newPos = SetFilePointerEx(hFile, distance, &cursor, moveMethod); + SetFilePointerEx(hFile, distance, &cursor, moveMethod); result = (size_t)cursor.QuadPart; #else int moveMethod = 0; diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index efc2e3c9cc..04333a1e34 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -157,7 +157,6 @@ static const int frameTimeHistorySize = (int)ARRAY_SIZE(frameTimeHistory); static int frameTimeHistoryPos = 0; static int frameTimeHistoryValid = 0; static double lastFrameTimeHistory = 0.0; -static double monitorFpsUntil = 0.0; static int lastNumFlips = 0; static float flips = 0.0f; static int actualFlips = 0; // taking frameskip into account @@ -599,7 +598,6 @@ static void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) { } // Auto-frameskip automatically if speed limit is set differently than the default. - bool useAutoFrameskip = g_Config.bAutoFrameSkip && g_Config.iRenderingMode != FB_NON_BUFFERED_MODE; bool forceFrameskip = fpsLimit > 60 && unthrottleNeedsSkip; int frameSkipNum = CalculateFrameSkip(); if (g_Config.bAutoFrameSkip || forceFrameskip) { diff --git a/Core/HLE/sceFont.cpp b/Core/HLE/sceFont.cpp index dbf0bebf34..6eb01a8647 100644 --- a/Core/HLE/sceFont.cpp +++ b/Core/HLE/sceFont.cpp @@ -1207,7 +1207,6 @@ static int sceFontFindFont(u32 libHandle, u32 fontStylePtr, u32 errorCodePtr) { // Find the closest exact match for the fields specified. float hRes = requestedStyle->fontHRes > 0.0f ? requestedStyle->fontHRes : fontLib->FontHRes(); - float vRes = requestedStyle->fontVRes > 0.0f ? requestedStyle->fontVRes : fontLib->FontVRes(); for (size_t i = 0; i < internalFonts.size(); i++) { if (internalFonts[i]->MatchesStyle(*requestedStyle) != MATCH_NONE) { auto matchStyle = internalFonts[i]->GetFontStyle(); diff --git a/Core/HLE/sceKernelMsgPipe.cpp b/Core/HLE/sceKernelMsgPipe.cpp index 2df1f2d105..7ff5e423d5 100644 --- a/Core/HLE/sceKernelMsgPipe.cpp +++ b/Core/HLE/sceKernelMsgPipe.cpp @@ -610,7 +610,6 @@ static bool __KernelCheckResumeMsgPipeReceive(MsgPipe *m, MsgPipeWaitingThread & static void __KernelMsgPipeEndCallback(SceUID threadID, SceUID prevCallbackId) { u32 error; u32 waitValue = __KernelGetWaitValue(threadID, error); - u32 timeoutPtr = __KernelGetWaitTimeoutPtr(threadID, error); SceUID uid = __KernelGetWaitID(threadID, WAITTYPE_MSGPIPE, error); MsgPipe *ko = uid == 0 ? NULL : kernelObjects.Get(uid, error); diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index 92c5fee535..47b4bb8b68 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -757,8 +757,6 @@ u32 __KernelInterruptReturnAddress() { } static void __KernelDelayBeginCallback(SceUID threadID, SceUID prevCallbackId) { - SceUID pauseKey = prevCallbackId == 0 ? threadID : prevCallbackId; - u32 error; SceUID waitID = __KernelGetWaitID(threadID, WAITTYPE_DELAY, error); if (waitID == threadID) { diff --git a/Core/HLE/scePsmf.cpp b/Core/HLE/scePsmf.cpp index 847d8b0035..69570c0742 100644 --- a/Core/HLE/scePsmf.cpp +++ b/Core/HLE/scePsmf.cpp @@ -795,7 +795,6 @@ static u32 scePsmfGetNumberOfSpecificStreams(u32 psmfStruct, int streamType) { int streamNum = 0; for (auto it : psmf->streamMap) { - bool match = false; if (it.second->matchesType(streamType)) { streamNum++; } diff --git a/Core/MIPS/ARM/ArmRegCacheFPU.cpp b/Core/MIPS/ARM/ArmRegCacheFPU.cpp index 21001b2b58..b5e53d4f96 100644 --- a/Core/MIPS/ARM/ArmRegCacheFPU.cpp +++ b/Core/MIPS/ARM/ArmRegCacheFPU.cpp @@ -324,7 +324,6 @@ void ArmRegCacheFPU::FlushArmReg(ARMReg r) { } else if (r >= D0 && r <= D31) { // TODO: Convert to S regs and flush them individually. } else if (r >= Q0 && r <= Q15) { - int quad = r - Q0; QFlush(r); } } @@ -732,8 +731,6 @@ void ArmRegCacheFPU::QFlush(int quad) { int ArmRegCacheFPU::QGetFreeQuad(int start, int count, const char *reason) { // Search for a free quad. A quad is free if the first register in it is free. - int quad = -1; - for (int i = 0; i < count; i++) { int q = (i + start) & 15; diff --git a/Core/MIPS/IR/IRCompVFPU.cpp b/Core/MIPS/IR/IRCompVFPU.cpp index b201048c9a..2a5e00a861 100644 --- a/Core/MIPS/IR/IRCompVFPU.cpp +++ b/Core/MIPS/IR/IRCompVFPU.cpp @@ -1502,7 +1502,6 @@ namespace MIPSComp { memcpy(srcregs, sregs, sizeof(sregs)); memcpy(tempregs, dregs, sizeof(dregs)); - int n = GetNumVectorElements(sz); int nOut = GetNumVectorElements(outsize); // If src registers aren't contiguous, make them. @@ -1818,7 +1817,7 @@ namespace MIPSComp { int n = GetNumVectorElements(sz); u8 dregs[4]; - GetVectorRegsPrefixD(dregs, sz, _VD); + GetVectorRegsPrefixD(dregs, sz, vd); for (int i = 0; i < n; i++) { ir.Write(IROp::SetConstF, dregs[i], ir.AddConstantFloat(cst_constants[conNum])); } diff --git a/Core/MIPS/IR/IRJit.cpp b/Core/MIPS/IR/IRJit.cpp index 77d988d139..b2780dad00 100644 --- a/Core/MIPS/IR/IRJit.cpp +++ b/Core/MIPS/IR/IRJit.cpp @@ -42,7 +42,7 @@ namespace MIPSComp { IRJit::IRJit(MIPSState *mips) : frontend_(mips->HasDefaultPrefix()), mips_(mips) { - u32 size = 128 * 1024; + // u32 size = 128 * 1024; // blTrampolines_ = kernelMemory.Alloc(size, true, "trampoline"); InitIR(); diff --git a/Core/MIPS/IR/IRPassSimplify.cpp b/Core/MIPS/IR/IRPassSimplify.cpp index d96ad364f2..baf43491b6 100644 --- a/Core/MIPS/IR/IRPassSimplify.cpp +++ b/Core/MIPS/IR/IRPassSimplify.cpp @@ -164,7 +164,6 @@ bool ThreeOpToTwoOp(const IRWriter &in, IRWriter &out, const IROptions &opts) { bool logBlocks = false; for (int i = 0; i < (int)in.GetInstructions().size(); i++) { IRInst inst = in.GetInstructions()[i]; - const IRMeta *meta = GetIRMeta(inst.op); switch (inst.op) { case IROp::Sub: case IROp::Slt: diff --git a/Core/MIPS/MIPSInt.cpp b/Core/MIPS/MIPSInt.cpp index fa6f9d19bd..4864c63336 100644 --- a/Core/MIPS/MIPSInt.cpp +++ b/Core/MIPS/MIPSInt.cpp @@ -364,7 +364,6 @@ namespace MIPSInt int rt = _RT; int rs = _RS; int rd = _RD; - static bool has_warned = false; // Don't change $zr. if (rd == 0) diff --git a/Core/MIPS/MIPSIntVFPU.cpp b/Core/MIPS/MIPSIntVFPU.cpp index a9c3b66832..0281b6bb42 100644 --- a/Core/MIPS/MIPSIntVFPU.cpp +++ b/Core/MIPS/MIPSIntVFPU.cpp @@ -720,7 +720,6 @@ namespace MIPSInt u32 tprefixAdd = VFPU_MAKE_CONSTANTS(VFPUConst::ONE, VFPUConst::ZERO, VFPUConst::ONE, VFPUConst::ZERO); ApplyPrefixST(t, VFPURewritePrefix(VFPU_CTRL_TPREFIX, tprefixRemove, tprefixAdd), outSize); - int n = GetNumVectorElements(sz); // Essentially D prefix saturation is forced. d[0] = nanclamp(t[0] + s[0], 0.0f, 1.0f); d[1] = nanclamp(t[1] + s[1], 0.0f, 1.0f); @@ -1226,7 +1225,6 @@ namespace MIPSInt ReadVector(s, sz, vs); ReadVector(t, sz, vs); - int n = GetNumVectorElements(sz); if (op & 0x10000) { // vbfy2 // S prefix forces the negate flags (so z and w are negative.) @@ -1973,7 +1971,7 @@ namespace MIPSInt ApplySwizzleS(s, sz); ReadVector(t, sz, vt); ApplySwizzleT(t, sz); - for (int i = 0; i < GetNumVectorElements(sz); i++) { + for (int i = 0; i < numElements; i++) { if ( my_isnan(s[i]) || my_isnan(t[i]) ) d[i] = 0.0f; else @@ -1998,7 +1996,7 @@ namespace MIPSInt ApplySwizzleS(s, sz); ReadVector(t, sz, vt); ApplySwizzleT(t, sz); - for (int i = 0; i < GetNumVectorElements(sz); i++) { + for (int i = 0; i < numElements; i++) { if ( my_isnan(s[i]) || my_isnan(t[i]) ) d[i] = 0.0f; else diff --git a/Core/MIPS/MIPSTables.cpp b/Core/MIPS/MIPSTables.cpp index 2270fc3630..ca8487e423 100644 --- a/Core/MIPS/MIPSTables.cpp +++ b/Core/MIPS/MIPSTables.cpp @@ -964,7 +964,6 @@ int MIPSInterpret_RunUntil(u64 globalTicks) while (coreState == CORE_RUNNING) { CoreTiming::Advance(); - u32 lastPC = 0; // NEVER stop in a delay slot! while (curMips->downcount >= 0 && coreState == CORE_RUNNING) @@ -974,17 +973,6 @@ int MIPSInterpret_RunUntil(u64 globalTicks) again: MIPSOpcode op = MIPSOpcode(Memory::Read_U32(curMips->pc)); //MIPSOpcode op = Memory::Read_Opcode_JIT(mipsr4k.pc); - /* - // Choke on VFPU - MIPSInfo info = MIPSGetInfo(op); - if (info & IS_VFPU) - { - if (!Core_IsStepping() && !GetAsyncKeyState(VK_LSHIFT)) - { - Core_EnableStepping(true); - return; - } - }*/ //2: check for breakpoint (VERY SLOW) #if defined(_DEBUG) @@ -1002,18 +990,6 @@ int MIPSInterpret_RunUntil(u64 globalTicks) #endif bool wasInDelaySlot = curMips->inDelaySlot; - - /* - if (curMips->pc != lastPC + 4) { - if (blockCount > 0) { - MIPSState *mips_ = curMips; - fprintf(f, "BLOCK : %08x v0: %08x v1: %08x a0: %08x s0: %08x s4: %08x\n", mips_->pc, mips_->r[MIPS_REG_V0], mips_->r[MIPS_REG_V1], mips_->r[MIPS_REG_A0], mips_->r[MIPS_REG_S0], mips_->r[MIPS_REG_S4]); - fflush(f); - blockCount--; - } - } - lastPC = curMips->pc; - */ MIPSInterpret(op); if (curMips->inDelaySlot) diff --git a/Core/MIPS/MIPSVFPUUtils.cpp b/Core/MIPS/MIPSVFPUUtils.cpp index 917fa16a04..e3d0e5ce14 100644 --- a/Core/MIPS/MIPSVFPUUtils.cpp +++ b/Core/MIPS/MIPSVFPUUtils.cpp @@ -873,7 +873,6 @@ float vfpu_rsqrt(float a) { uint32_t z = 0x00800000 >> less_bits; uint32_t halfsp = sp >> (1 + less_bits); for (int i = 0; i < 6; ++i) { - uint32_t oldz = z; uint32_t zsq = mant_mul(z, z); uint32_t correction = 0x00C00000 - mant_mul(halfsp, zsq); z = mant_mul(z, correction); diff --git a/Core/MIPS/x86/Asm.cpp b/Core/MIPS/x86/Asm.cpp index 84fa1e9ccc..6282cd132f 100644 --- a/Core/MIPS/x86/Asm.cpp +++ b/Core/MIPS/x86/Asm.cpp @@ -66,7 +66,7 @@ void ImHere() { } void Jit::GenerateFixedCode(JitOptions &jo) { - const u8 *start = AlignCodePage(); + AlignCodePage(); BeginWrite(); restoreRoundingMode = AlignCode16(); { diff --git a/Core/MIPS/x86/CompLoadStore.cpp b/Core/MIPS/x86/CompLoadStore.cpp index dcb18be225..d90cecb5f7 100644 --- a/Core/MIPS/x86/CompLoadStore.cpp +++ b/Core/MIPS/x86/CompLoadStore.cpp @@ -138,7 +138,6 @@ namespace MIPSComp { void Jit::CompITypeMemUnpairedLR(MIPSOpcode op, bool isStore) { CONDITIONAL_DISABLE(LSU); - int o = op>>26; int offset = _IMM16; MIPSGPReg rt = _RT; MIPSGPReg rs = _RS; @@ -288,7 +287,6 @@ namespace MIPSComp { CONDITIONAL_DISABLE(LSU); int offset = _IMM16; MIPSGPReg rt = _RT; - MIPSGPReg rs = _RS; int o = op>>26; if (((op >> 29) & 1) == 0 && rt == MIPS_REG_ZERO) { // Don't load anything into $zr @@ -395,7 +393,7 @@ namespace MIPSComp { default: Comp_Generic(op); - return ; + return; } } diff --git a/Core/MIPS/x86/CompVFPU.cpp b/Core/MIPS/x86/CompVFPU.cpp index b661cbf5d1..bad6dde632 100644 --- a/Core/MIPS/x86/CompVFPU.cpp +++ b/Core/MIPS/x86/CompVFPU.cpp @@ -238,8 +238,6 @@ bool IsOverlapSafe(int dreg, int di, int sn, u8 sregs[], int tn = 0, u8 tregs[] return IsOverlapSafeAllowS(dreg, di, sn, sregs, tn, tregs) && sregs[di] != dreg; } -alignas(16) static u32 ssLoadStoreTemp; - void Jit::Comp_SV(MIPSOpcode op) { CONDITIONAL_DISABLE(LSU_VFPU); @@ -796,7 +794,6 @@ void Jit::Comp_VCrossQuat(MIPSOpcode op) { DISABLE; VectorSize sz = GetVecSize(op); - int n = GetNumVectorElements(sz); u8 sregs[4], tregs[4], dregs[4]; GetVectorRegs(sregs, sz, _VS); @@ -1808,8 +1805,6 @@ extern const double mulTableVf2i[32] = { (1ULL<<28),(1ULL<<29),(1ULL<<30),(1ULL<<31), }; -static const float half = 0.5f; - static const double maxMinIntAsDouble[2] = { (double)0x7fffffff, (double)(int)0x80000000 }; // that's not equal to 0x80000000 void Jit::Comp_Vf2i(MIPSOpcode op) { @@ -1934,7 +1929,7 @@ void Jit::Comp_Vcst(MIPSOpcode op) { int n = GetNumVectorElements(sz); u8 dregs[4]; - GetVectorRegsPrefixD(dregs, sz, _VD); + GetVectorRegsPrefixD(dregs, sz, vd); if (RipAccessible(cst_constants)) { MOVSS(XMM0, M(&cst_constants[conNum])); // rip accessible diff --git a/Core/Reporting.cpp b/Core/Reporting.cpp index 5e22b7aeb6..df0e50e043 100644 --- a/Core/Reporting.cpp +++ b/Core/Reporting.cpp @@ -236,7 +236,6 @@ namespace Reporting bool SendReportRequest(const char *uri, const std::string &data, const std::string &mimeType, Buffer *output = NULL) { - bool result = false; http::Client http; Buffer theVoid; diff --git a/Core/Util/DisArm64.cpp b/Core/Util/DisArm64.cpp index 651ffe35c9..5d1afbe786 100644 --- a/Core/Util/DisArm64.cpp +++ b/Core/Util/DisArm64.cpp @@ -85,7 +85,6 @@ int HighestSetBit(int value) { } int LowestSetBit(int value, int maximum = 32) { - int lowest = 0; for (int i = 0; i < maximum; i++) { if (value & (1 << i)) return i; diff --git a/Core/WaveFile.h b/Core/WaveFile.h index 3ef3f09b4c..8198cecf50 100644 --- a/Core/WaveFile.h +++ b/Core/WaveFile.h @@ -36,7 +36,6 @@ private: File::IOFile file; bool skip_silence = false; uint32_t audio_size = 0; - std::array conv_buffer{}; void Write(uint32_t value); void Write4(const char* ptr); }; diff --git a/GPU/Common/DrawEngineCommon.cpp b/GPU/Common/DrawEngineCommon.cpp index 807d2c322f..290a30e2ce 100644 --- a/GPU/Common/DrawEngineCommon.cpp +++ b/GPU/Common/DrawEngineCommon.cpp @@ -518,7 +518,6 @@ void DrawEngineCommon::DecodeVertsStep(u8 *dest, int &i, int &decodedVerts) { int indexLowerBound = dc.indexLowerBound; int indexUpperBound = dc.indexUpperBound; - void *inds = dc.inds; if (dc.indexType == GE_VTYPE_IDX_NONE >> GE_VTYPE_IDX_SHIFT) { // Decode the verts and apply morphing. Simple. dec_->DecodeVerts(dest + decodedVerts * (int)dec_->GetDecVtxFmt().stride, diff --git a/GPU/Common/PresentationCommon.cpp b/GPU/Common/PresentationCommon.cpp index eb1e8d8cd9..2122980b66 100644 --- a/GPU/Common/PresentationCommon.cpp +++ b/GPU/Common/PresentationCommon.cpp @@ -471,7 +471,6 @@ void PresentationCommon::DestroyPostShader() { Draw::ShaderModule *PresentationCommon::CompileShaderModule(ShaderStage stage, ShaderLanguage lang, const std::string &src, std::string *errorString) { std::string translated = src; - bool translationFailed = false; if (lang != lang_) { // Gonna have to upconvert the shader. if (!TranslateShader(&translated, lang_, draw_->GetShaderLanguageDesc(), nullptr, src, lang, stage, errorString)) { diff --git a/GPU/Common/ShaderUniforms.cpp b/GPU/Common/ShaderUniforms.cpp index 7860ed9ca8..8ca4bacff6 100644 --- a/GPU/Common/ShaderUniforms.cpp +++ b/GPU/Common/ShaderUniforms.cpp @@ -251,7 +251,6 @@ void BaseUpdateUniforms(UB_VS_FS_Base *ub, uint64_t dirtyUniforms, bool flipView viewZInvScale = 0.0; } - float data[4] = { viewZScale, viewZCenter, viewZCenter, viewZInvScale }; ub->depthRange[0] = viewZScale; ub->depthRange[1] = viewZCenter; ub->depthRange[2] = viewZCenter; diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index f0a9ede13b..203e8eb5de 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -564,7 +564,6 @@ TexCacheEntry *TextureCacheCommon::SetTexture() { std::vector TextureCacheCommon::GetFramebufferCandidates(const TextureDefinition &entry, u32 texAddrOffset) { gpuStats.numFramebufferEvaluations++; - bool success = false; std::vector candidates; @@ -884,8 +883,6 @@ FramebufferMatchInfo TextureCacheCommon::MatchFramebuffer( (channel == NOTIFY_FB_COLOR && framebuffer->format == GE_FORMAT_8888 && entry.format == GE_TFMT_CLUT32) || (channel == NOTIFY_FB_COLOR && framebuffer->format != GE_FORMAT_8888 && entry.format == GE_TFMT_CLUT16); - const bool clutFormat = IsClutFormat((GETextureFormat)(entry.format)); - // To avoid ruining git blame, kept the same name as the old struct. FramebufferMatchInfo fbInfo{ FramebufferMatch::VALID }; diff --git a/GPU/Common/VertexDecoderArm.cpp b/GPU/Common/VertexDecoderArm.cpp index 0feb2df100..434c691364 100644 --- a/GPU/Common/VertexDecoderArm.cpp +++ b/GPU/Common/VertexDecoderArm.cpp @@ -231,7 +231,6 @@ JittedVertexDecoder VertexDecoderJitCache::Compile(const VertexDecoder &dec, int // Add code to convert matrices to 4x4. // Later we might want to do this when the matrices are loaded instead. - int boneCount = 0; if (NEONSkinning && dec.weighttype && g_Config.bSoftwareSkinning) { // Copying from R3 to R4 MOVP2R(R3, gstate.boneMatrix); diff --git a/GPU/Common/VertexDecoderArm64.cpp b/GPU/Common/VertexDecoderArm64.cpp index c1ec8770bc..305ba3ed90 100644 --- a/GPU/Common/VertexDecoderArm64.cpp +++ b/GPU/Common/VertexDecoderArm64.cpp @@ -190,7 +190,6 @@ JittedVertexDecoder VertexDecoderJitCache::Compile(const VertexDecoder &dec, int // Add code to convert matrices to 4x4. // Later we might want to do this when the matrices are loaded instead. - int boneCount = 0; if (dec.weighttype && g_Config.bSoftwareSkinning) { // Copying from R3 to R4 MOVP2R(X3, gstate.boneMatrix); diff --git a/GPU/Common/VertexDecoderX86.cpp b/GPU/Common/VertexDecoderX86.cpp index a3c6f15e41..ac4fcd175d 100644 --- a/GPU/Common/VertexDecoderX86.cpp +++ b/GPU/Common/VertexDecoderX86.cpp @@ -219,7 +219,6 @@ JittedVertexDecoder VertexDecoderJitCache::Compile(const VertexDecoder &dec, int // Add code to convert matrices to 4x4. // Later we might want to do this when the matrices are loaded instead. - int boneCount = 0; if (dec.weighttype && g_Config.bSoftwareSkinning) { MOV(PTRBITS, R(tempReg1), ImmPtr(&threeMasks)); MOVAPS(XMM4, MatR(tempReg1)); diff --git a/GPU/D3D11/DrawEngineD3D11.cpp b/GPU/D3D11/DrawEngineD3D11.cpp index 05537d2eea..6dc47766fb 100644 --- a/GPU/D3D11/DrawEngineD3D11.cpp +++ b/GPU/D3D11/DrawEngineD3D11.cpp @@ -317,10 +317,6 @@ VertexArrayInfoD3D11::~VertexArrayInfoD3D11() { ebo->Release(); } -static uint32_t SwapRB(uint32_t c) { - return (c & 0xFF00FF00) | ((c >> 16) & 0xFF) | ((c << 16) & 0xFF0000); -} - // The inline wrapper in the header checks for numDrawCalls == 0 void DrawEngineD3D11::DoFlush() { gpuStats.numFlushes++; @@ -603,8 +599,6 @@ rotateVBO: framebufferManager_->SetSafeSize(result.safeWidth, result.safeHeight); if (result.action == SW_DRAW_PRIMITIVES) { - const int vertexSize = sizeof(transformed[0]); - ApplyDrawStateLate(result.setStencil, result.stencilValue); D3D11VertexShader *vshader; diff --git a/GPU/D3D11/FramebufferManagerD3D11.cpp b/GPU/D3D11/FramebufferManagerD3D11.cpp index fbafe04285..0828b68a1d 100644 --- a/GPU/D3D11/FramebufferManagerD3D11.cpp +++ b/GPU/D3D11/FramebufferManagerD3D11.cpp @@ -184,8 +184,6 @@ void FramebufferManagerD3D11::DrawActiveTexture(float x, float y, float w, float {{x, y + h, 0}, u0, v1}, }; - static const short indices[4] = { 0, 1, 3, 2 }; - if (uvRotation != ROTATION_LOCKED_HORIZONTAL) { float temp[8]; int rotation = 0; diff --git a/GPU/Directx9/DrawEngineDX9.cpp b/GPU/Directx9/DrawEngineDX9.cpp index 338701689a..377d2164f4 100644 --- a/GPU/Directx9/DrawEngineDX9.cpp +++ b/GPU/Directx9/DrawEngineDX9.cpp @@ -578,9 +578,6 @@ rotateVBO: // TODO: Add a post-transform cache here for multi-RECTANGLES only. // Might help for text drawing. - // these spam the gDebugger log. - const int vertexSize = sizeof(transformed[0]); - device_->SetVertexDeclaration(transformedVertexDecl_); if (result.drawIndexed) { device_->DrawIndexedPrimitiveUP(d3d_prim[prim], 0, maxIndex, D3DPrimCount(d3d_prim[prim], result.drawNumTrans), inds, D3DFMT_INDEX16, result.drawBuffer, sizeof(TransformedVertex)); diff --git a/GPU/Directx9/FramebufferManagerDX9.cpp b/GPU/Directx9/FramebufferManagerDX9.cpp index dce162f49d..263ef44b63 100644 --- a/GPU/Directx9/FramebufferManagerDX9.cpp +++ b/GPU/Directx9/FramebufferManagerDX9.cpp @@ -164,8 +164,6 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = { x,y+h,0, u0,v1, }; - static const short indices[4] = { 0, 1, 3, 2 }; - if (uvRotation != ROTATION_LOCKED_HORIZONTAL) { float temp[8]; int rotation = 0; @@ -405,7 +403,6 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = { HRESULT hr = tex->LockRect(0, &locked, &rect, D3DLOCK_READONLY); if (SUCCEEDED(hr)) { - const int dstByteOffset = y * vfb->fb_stride * sizeof(s16); const u32 *packed = (const u32 *)locked.pBits; u16 *depth = (u16 *)Memory::GetPointer(z_address); diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index 3f19241382..77188c196b 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -685,8 +685,6 @@ void TextureCacheDX9::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &re bool TextureCacheDX9::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level) { SetTexture(); ApplyTexture(); - int w = gstate.getTextureWidth(level); - int h = gstate.getTextureHeight(level); LPDIRECT3DBASETEXTURE9 baseTex; LPDIRECT3DTEXTURE9 tex; diff --git a/GPU/Directx9/TextureCacheDX9.h b/GPU/Directx9/TextureCacheDX9.h index 7f27019bfa..4963e3337a 100644 --- a/GPU/Directx9/TextureCacheDX9.h +++ b/GPU/Directx9/TextureCacheDX9.h @@ -86,7 +86,6 @@ private: LPDIRECT3DTEXTURE9 lastBoundTexture; float maxAnisotropyLevel; - int decimationCounter_; int texelsScaledThisFrame_; int timesInvalidatedAllThisFrame_; diff --git a/GPU/GLES/DrawEngineGLES.cpp b/GPU/GLES/DrawEngineGLES.cpp index a15a179244..d11df134ab 100644 --- a/GPU/GLES/DrawEngineGLES.cpp +++ b/GPU/GLES/DrawEngineGLES.cpp @@ -594,13 +594,9 @@ void DrawEngineGLES::DoFlush() { ApplyDrawStateLate(result.setStencil, result.stencilValue); - LinkedShader *program = shaderManager_->ApplyFragmentShader(vsid, vshader, lastVType_, framebufferManager_->UseBufferedRendering()); + shaderManager_->ApplyFragmentShader(vsid, vshader, lastVType_, framebufferManager_->UseBufferedRendering()); if (result.action == SW_DRAW_PRIMITIVES) { - const int vertexSize = sizeof(transformed[0]); - - bool doTextureProjection = gstate.getUVGenMode() == GE_TEXMAP_TEXTURE_MATRIX; - if (result.drawIndexed) { vertexBufferOffset = (uint32_t)frameData.pushVertex->Push(result.drawBuffer, maxIndex * sizeof(TransformedVertex), &vertexBuffer); indexBufferOffset = (uint32_t)frameData.pushIndex->Push(inds, sizeof(uint16_t) * result.drawNumTrans, &indexBuffer); diff --git a/GPU/GLES/FramebufferManagerGLES.cpp b/GPU/GLES/FramebufferManagerGLES.cpp index 8f9b79cf7e..be01c06702 100644 --- a/GPU/GLES/FramebufferManagerGLES.cpp +++ b/GPU/GLES/FramebufferManagerGLES.cpp @@ -172,8 +172,6 @@ void FramebufferManagerGLES::DrawActiveTexture(float x, float y, float w, float u0,v1, }; - static const GLushort indices[4] = { 0,1,3,2 }; - if (uvRotation != ROTATION_LOCKED_HORIZONTAL) { float temp[8]; int rotation = 0; diff --git a/GPU/GLES/TextureCacheGLES.cpp b/GPU/GLES/TextureCacheGLES.cpp index 895bd27efd..3a33806944 100644 --- a/GPU/GLES/TextureCacheGLES.cpp +++ b/GPU/GLES/TextureCacheGLES.cpp @@ -327,7 +327,6 @@ public: } void Shade(GLRenderManager *render) { - static const GLubyte indices[4] = { 0, 1, 3, 2 }; render->SetViewport(GLRViewport{ 0, 0, (float)renderW_, (float)renderH_, 0.0f, 1.0f }); render->Draw(GL_TRIANGLE_STRIP, 0, 4); } diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index c722d0a081..aa4efa92ea 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -2248,7 +2248,6 @@ void GPUCommon::Execute_ImmVertexAlphaPrim(u32 op, u32 diff) { return; } - uint32_t data = op & 0xFFFFFF; TransformedVertex &v = immBuffer_[immCount_++]; // Formula deduced from ThrillVille's clear. diff --git a/GPU/Software/Clipper.cpp b/GPU/Software/Clipper.cpp index 66db9a08e4..ee6f7ff3b9 100644 --- a/GPU/Software/Clipper.cpp +++ b/GPU/Software/Clipper.cpp @@ -105,7 +105,6 @@ inline float clip_dotprod(const VertexData &vert, float A, float B, float C, flo if (mask & PLANE_BIT) { \ float dp0 = clip_dotprod(*Vertices[0], A, B, C, D ); \ float dp1 = clip_dotprod(*Vertices[1], A, B, C, D ); \ - int numVertices = 0; \ \ if (mask0 & PLANE_BIT) { \ if (dp0 < 0) { \ diff --git a/GPU/Software/Rasterizer.cpp b/GPU/Software/Rasterizer.cpp index feaeca1e89..1f3996398c 100644 --- a/GPU/Software/Rasterizer.cpp +++ b/GPU/Software/Rasterizer.cpp @@ -1661,7 +1661,6 @@ void DrawLine(const VertexData &v0, const VertexData &v1) if (gstate.isAntiAliasEnabled()) { // TODO: This is a niave and wrong implementation. DrawingCoords p0 = TransformUnit::ScreenToDrawing(ScreenCoords((int)x, (int)y, (int)z)); - DrawingCoords p1 = TransformUnit::ScreenToDrawing(ScreenCoords((int)(x + xinc), (int)(y + yinc), (int)(z + zinc))); s = ((float)p0.x + xinc / 32.0f) / 512.0f; t = ((float)p0.y + yinc / 32.0f) / 512.0f; diff --git a/GPU/Vulkan/DebugVisVulkan.cpp b/GPU/Vulkan/DebugVisVulkan.cpp index 9d1365bb5f..83433ecbdf 100644 --- a/GPU/Vulkan/DebugVisVulkan.cpp +++ b/GPU/Vulkan/DebugVisVulkan.cpp @@ -116,7 +116,6 @@ void DrawGPUProfilerVis(UIContext *ui, GPUInterface *gpu) { std::string text = gpuVulkan->GetGpuProfileString(); - Draw::DrawContext *draw = ui->GetDrawContext(); ui->SetFontScale(0.4f, 0.4f); ui->DrawTextShadow(text.c_str(), x, y, 0xFFFFFFFF, FLAG_DYNAMIC_ASCII); ui->SetFontScale(1.0f, 1.0f); diff --git a/GPU/Vulkan/DrawEngineVulkan.cpp b/GPU/Vulkan/DrawEngineVulkan.cpp index 12897153a9..8222635603 100644 --- a/GPU/Vulkan/DrawEngineVulkan.cpp +++ b/GPU/Vulkan/DrawEngineVulkan.cpp @@ -866,8 +866,6 @@ void DrawEngineVulkan::DoFlush() { baseUBOOffset, lightUBOOffset, boneUBOOffset, }; - int stride = dec_->GetDecVtxFmt().stride; - if (useElements) { if (!ibuf) { ibOffset = (uint32_t)frame->pushIndex->Push(decIndex, sizeof(uint16_t) * indexGen.VertexCount(), &ibuf); @@ -996,12 +994,10 @@ void DrawEngineVulkan::DoFlush() { VkBuffer vbuf, ibuf; vbOffset = (uint32_t)frame->pushVertex->Push(result.drawBuffer, maxIndex * sizeof(TransformedVertex), &vbuf); ibOffset = (uint32_t)frame->pushIndex->Push(inds, sizeof(short) * result.drawNumTrans, &ibuf); - VkDeviceSize offsets[1] = { vbOffset }; renderManager->DrawIndexed(pipelineLayout_, ds, ARRAY_SIZE(dynamicUBOOffsets), dynamicUBOOffsets, vbuf, vbOffset, ibuf, ibOffset, result.drawNumTrans, 1, VK_INDEX_TYPE_UINT16); } else { VkBuffer vbuf; vbOffset = (uint32_t)frame->pushVertex->Push(result.drawBuffer, result.drawNumTrans * sizeof(TransformedVertex), &vbuf); - VkDeviceSize offsets[1] = { vbOffset }; renderManager->Draw(pipelineLayout_, ds, ARRAY_SIZE(dynamicUBOOffsets), dynamicUBOOffsets, vbuf, vbOffset, result.drawNumTrans); } } else if (result.action == SW_CLEAR) { diff --git a/GPU/Vulkan/PipelineManagerVulkan.cpp b/GPU/Vulkan/PipelineManagerVulkan.cpp index 8533e10b7d..6a55289c04 100644 --- a/GPU/Vulkan/PipelineManagerVulkan.cpp +++ b/GPU/Vulkan/PipelineManagerVulkan.cpp @@ -246,7 +246,6 @@ static VulkanPipeline *CreateVulkanPipeline(VkDevice device, VkPipelineCache pip inputAssembly.primitiveRestartEnable = false; int vertexStride = 0; - int offset = 0; VkVertexInputAttributeDescription attrs[8]; int attributeCount; if (useHwTransform) { @@ -616,7 +615,6 @@ void PipelineManagerVulkan::SaveCache(FILE *file, bool saveRawPipelineCache, Sha bool failed = false; bool writeFailed = false; - int count = 0; // Since we don't include the full pipeline key, there can be duplicates, // caused by things like switching from buffered to non-buffered rendering. // Make sure the set of pipelines we write is "unique". @@ -724,6 +722,9 @@ bool PipelineManagerVulkan::LoadCache(FILE *file, bool loadRawPipelineCache, Sha if (!pipelineCache_) { VkPipelineCacheCreateInfo pc{ VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO }; VkResult res = vkCreatePipelineCache(vulkan_->GetDevice(), &pc, nullptr, &pipelineCache_); + if (res != VK_SUCCESS) { + return false; + } } } diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index e0977a4512..e7592f9560 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -1073,7 +1073,6 @@ TexCacheEntry::TexStatus TextureCacheVulkan::CheckAlpha(const u32 *pixelData, Vk } void TextureCacheVulkan::LoadTextureLevel(TexCacheEntry &entry, uint8_t *writePtr, int rowPitch, int level, int scaleFactor, VkFormat dstFmt) { - VulkanTexture *tex = entry.vkTex; int w = gstate.getTextureWidth(level); int h = gstate.getTextureHeight(level); diff --git a/GPU/Vulkan/VulkanUtil.cpp b/GPU/Vulkan/VulkanUtil.cpp index fa2deab322..3f4e889e9b 100644 --- a/GPU/Vulkan/VulkanUtil.cpp +++ b/GPU/Vulkan/VulkanUtil.cpp @@ -47,7 +47,6 @@ void Vulkan2D::DestroyDeviceObjects() { } keptPipelines_.clear(); - VkDevice device = vulkan_->GetDevice(); if (descriptorSetLayout_ != VK_NULL_HANDLE) { vulkan_->Delete().QueueDeleteDescriptorSetLayout(descriptorSetLayout_); } diff --git a/UI/ControlMappingScreen.cpp b/UI/ControlMappingScreen.cpp index 43a406adb4..9226a1831f 100644 --- a/UI/ControlMappingScreen.cpp +++ b/UI/ControlMappingScreen.cpp @@ -109,8 +109,6 @@ void ControlMapper::Refresh() { LinearLayout *root = Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(550, WRAP_CONTENT))); root->SetSpacing(3.0f); - const int padding = 4; - auto iter = keyImages.find(keyName_); // First, look among images. if (iter != keyImages.end()) { @@ -138,7 +136,6 @@ void ControlMapper::Refresh() { for (size_t i = 0; i < mappings.size(); i++) { std::string deviceName = GetDeviceName(mappings[i].deviceId); std::string keyName = KeyMap::GetKeyOrAxisName(mappings[i].keyCode); - int image = -1; LinearLayout *row = rightColumn->Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT))); row->SetSpacing(1.0f); diff --git a/UI/CwCheatScreen.cpp b/UI/CwCheatScreen.cpp index 2e1d706b48..57f0a2ad61 100644 --- a/UI/CwCheatScreen.cpp +++ b/UI/CwCheatScreen.cpp @@ -188,7 +188,7 @@ UI::EventReturn CwCheatScreen::OnImportCheat(UI::EventParams ¶ms) { } std::string line; std::vector title; - bool finished = false, skip = false; + bool finished = false; std::vector newList; std::string cheatFile = GetSysDirectory(DIRECTORY_CHEATS) + "cheat.db"; diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index bb5a62492e..309f59fa2d 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -252,8 +252,6 @@ void EmuScreen::bootGame(const std::string &filename) { coreParam.printfEmuLog = false; coreParam.headLess = false; - const Bounds &bounds = screenManager()->getUIContext()->GetBounds(); - if (g_Config.iInternalResolution == 0) { coreParam.renderWidth = pixel_xres; coreParam.renderHeight = pixel_yres; diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index c0cf42d56f..3cea4ebcdd 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -233,7 +233,6 @@ bool GameInfo::DeleteAllSaveData() { std::vector fileInfo; getFilesInDir(saveDataDir[j].c_str(), &fileInfo); - u64 totalSize = 0; for (size_t i = 0; i < fileInfo.size(); i++) { File::Delete(fileInfo[i].fullName.c_str()); } diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 2f1e157eee..d5eed1fed3 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -899,7 +899,7 @@ void GameSettingsScreen::CreateViews() { rewindFreq->SetZeroLabel(sy->T("Off")); systemSettings->Add(new CheckBox(&g_Config.bMemStickInserted, sy->T("Memory Stick inserted"))); - PopupSliderChoice *memStickSize = systemSettings->Add(new PopupSliderChoice(&g_Config.iMemStickSizeGB, 1, 32, sy->T("Change Memory Stick Size", "Change Memory Stick Size(GB)"), screenManager(), "GB")); + systemSettings->Add(new PopupSliderChoice(&g_Config.iMemStickSizeGB, 1, 32, sy->T("Change Memory Stick Size", "Change Memory Stick Size(GB)"), screenManager(), "GB")); systemSettings->Add(new ItemHeader(sy->T("General"))); diff --git a/UI/GamepadEmu.cpp b/UI/GamepadEmu.cpp index 68922d9b7a..6daf7bcb3c 100644 --- a/UI/GamepadEmu.cpp +++ b/UI/GamepadEmu.cpp @@ -273,7 +273,6 @@ void PSPDpad::GetContentDimensions(const UIContext &dc, float &w, float &h) cons } void PSPDpad::Touch(const TouchInput &input) { - int lastDown = down_; GamepadView::Touch(input); if (input.flags & TOUCH_DOWN) { @@ -412,7 +411,6 @@ void PSPStick::Draw(UIContext &dc) { uint32_t colorBg = colorAlpha(GetButtonColor(), opacity); uint32_t downBg = colorAlpha(0x00FFFFFF, opacity * 0.5f); - uint32_t color = colorAlpha(0x808080, opacity); if (centerX_ < 0.0f) { centerX_ = bounds_.centerX(); @@ -511,7 +509,6 @@ void PSPCustomStick::Draw(UIContext &dc) { uint32_t colorBg = colorAlpha(GetButtonColor(), opacity); uint32_t downBg = colorAlpha(0x00FFFFFF, opacity * 0.5f); - uint32_t color = colorAlpha(0x808080, opacity); if (centerX_ < 0.0f) { centerX_ = bounds_.centerX(); diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index a7284654be..d1937e290d 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -517,9 +517,6 @@ void LogoScreen::render() { const Bounds &bounds = dc.GetBounds(); - float xres = bounds.w; - float yres = bounds.h; - dc.Begin(); float t = (float)sinceStart_ / (logoScreenSeconds / 3.0f); @@ -545,13 +542,13 @@ void LogoScreen::render() { dc.Draw()->DrawImage(ImageID("I_ICON"), bounds.centerX() - 120, bounds.centerY() - 30, 1.2f, textColor, ALIGN_CENTER); } dc.Draw()->DrawImage(ImageID("I_LOGO"), bounds.centerX() + 40, bounds.centerY() - 30, 1.5f, textColor, ALIGN_CENTER); - //dc.Draw()->DrawTextShadow(UBUNTU48, "PPSSPP", xres / 2, yres / 2 - 30, textColor, ALIGN_CENTER); + //dc.Draw()->DrawTextShadow(UBUNTU48, "PPSSPP", bounds.w / 2, bounds.h / 2 - 30, textColor, ALIGN_CENTER); dc.SetFontScale(1.0f, 1.0f); dc.SetFontStyle(dc.theme->uiFont); dc.DrawText(temp, bounds.centerX(), bounds.centerY() + 40, textColor, ALIGN_CENTER); dc.DrawText(cr->T("license", "Free Software under GPL 2.0+"), bounds.centerX(), bounds.centerY() + 70, textColor, ALIGN_CENTER); - int ppsspp_org_y = yres / 2 + 130; + int ppsspp_org_y = bounds.h / 2 + 130; dc.DrawText("www.ppsspp.org", bounds.centerX(), ppsspp_org_y, textColor, ALIGN_CENTER); #if (defined(_WIN32) && !PPSSPP_PLATFORM(UWP)) || PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(LINUX) diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index f7b7b13f06..bdde5cdcbf 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -149,7 +149,6 @@ static bool isOuya; static bool resized = false; static bool restarting = false; -static bool askedForStoragePermission = false; static int renderCounter = 0; struct PendingMessage { diff --git a/UI/ProfilerDraw.cpp b/UI/ProfilerDraw.cpp index da5dba4ba7..aa5727fefe 100644 --- a/UI/ProfilerDraw.cpp +++ b/UI/ProfilerDraw.cpp @@ -23,6 +23,7 @@ #include "Common/UI/View.h" #include "Common/Profiler/Profiler.h" +#ifdef USE_PROFILER static const uint32_t nice_colors[] = { 0xFF8040, 0x80FF40, @@ -44,6 +45,7 @@ static const uint32_t nice_colors[] = { 0xF8F8F8, 0x33FFFF, }; +#endif enum ProfileCatStatus { PROFILE_CAT_VISIBLE = 0, diff --git a/UI/TouchControlLayoutScreen.cpp b/UI/TouchControlLayoutScreen.cpp index c180541833..1c50073232 100644 --- a/UI/TouchControlLayoutScreen.cpp +++ b/UI/TouchControlLayoutScreen.cpp @@ -348,7 +348,6 @@ void ControlLayoutView::CreateViews() { ImageID rectImage = g_Config.iTouchButtonStyle ? ImageID("I_RECT_LINE") : ImageID("I_RECT"); ImageID shoulderImage = g_Config.iTouchButtonStyle ? ImageID("I_SHOULDER_LINE") : ImageID("I_SHOULDER"); - ImageID dirImage = g_Config.iTouchButtonStyle ? ImageID("I_DIR_LINE") : ImageID("I_DIR"); ImageID stickImage = g_Config.iTouchButtonStyle ? ImageID("I_STICK_LINE") : ImageID("I_STICK"); ImageID stickBg = g_Config.iTouchButtonStyle ? ImageID("I_STICK_BG_LINE") : ImageID("I_STICK_BG"); ImageID roundImage = g_Config.iTouchButtonStyle ? ImageID("I_ROUND_LINE") : ImageID("I_ROUND"); diff --git a/Windows/DSoundStream.cpp b/Windows/DSoundStream.cpp index bd375d025e..33605d0bbb 100644 --- a/Windows/DSoundStream.cpp +++ b/Windows/DSoundStream.cpp @@ -20,9 +20,6 @@ #include "DSoundStream.h" -// TODO: Get rid of this -static DSoundAudioBackend *g_dsound; - inline int RoundDown128(int x) { return x & (~127); } diff --git a/Windows/Debugger/CtrlDisAsmView.cpp b/Windows/Debugger/CtrlDisAsmView.cpp index e26f9644d8..ebbbf85354 100644 --- a/Windows/Debugger/CtrlDisAsmView.cpp +++ b/Windows/Debugger/CtrlDisAsmView.cpp @@ -866,7 +866,6 @@ void CtrlDisAsmView::toggleBreakpoint(bool toggleEnabled) void CtrlDisAsmView::onMouseDown(WPARAM wParam, LPARAM lParam, int button) { dontRedraw = false; - int x = LOWORD(lParam); int y = HIWORD(lParam); u32 newAddress = yToAddress(y); @@ -921,7 +920,6 @@ void CtrlDisAsmView::onMouseUp(WPARAM wParam, LPARAM lParam, int button) { if (button == 1) { - int x = LOWORD(lParam); int y = HIWORD(lParam); setCurAddress(yToAddress(y), KeyDownAsync(VK_SHIFT)); redraw(); @@ -1076,7 +1074,6 @@ void CtrlDisAsmView::onMouseMove(WPARAM wParam, LPARAM lParam, int button) { if ((button & 1) != 0) { - int x = LOWORD(lParam); int y = HIWORD(lParam); setCurAddress(yToAddress(y), KeyDownAsync(VK_SHIFT)); // TODO: Perhaps don't do this every time, but on a timer? diff --git a/Windows/Debugger/CtrlRegisterList.cpp b/Windows/Debugger/CtrlRegisterList.cpp index 02992e5f28..be57cfdba7 100644 --- a/Windows/Debugger/CtrlRegisterList.cpp +++ b/Windows/Debugger/CtrlRegisterList.cpp @@ -312,7 +312,6 @@ void CtrlRegisterList::onKeyDown(WPARAM wParam, LPARAM lParam) { RECT rect; GetClientRect(this->wnd, &rect); - int page=(rect.bottom/rowHeight)/2-1; if (ctrlDown && tolower(wParam) == 'c') { diff --git a/Windows/Debugger/CtrlRegisterList.h b/Windows/Debugger/CtrlRegisterList.h index 123e8e0713..398e6803d0 100644 --- a/Windows/Debugger/CtrlRegisterList.h +++ b/Windows/Debugger/CtrlRegisterList.h @@ -28,15 +28,12 @@ class CtrlRegisterList int rowHeight; int selection = 0; - int marker = 0; int category = 0; int oldSelection = 0; - bool selectionChanged = false; bool selecting = false; bool hasFocus = false; - bool showHex = false; DebugInterface *cpu = nullptr; static TCHAR szClassName[]; diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index 1a311b3936..3f0bf77907 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -384,7 +384,6 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) case WM_COMMAND: { CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW)); - CtrlRegisterList *reglist = CtrlRegisterList::getFrom(GetDlgItem(m_hDlg,IDC_REGLIST)); switch (LOWORD(wParam)) { case ID_TOGGLE_BREAK: SendMessage(MainWindow::GetHWND(), WM_COMMAND, ID_TOGGLE_BREAK, 0); @@ -880,8 +879,8 @@ void CDisasm::Goto(u32 addr) void CDisasm::UpdateDialog(bool _bComplete) { - HWND gotoInt = GetDlgItem(m_hDlg, IDC_GOTOINT); /* + HWND gotoInt = GetDlgItem(m_hDlg, IDC_GOTOINT); ComboBox_ResetContent(gotoInt); for (int i=0; i GetWideCmdLine() { wchar_t **wargv; @@ -656,7 +658,6 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin MainWindow::Show(_hInstance); HWND hwndMain = MainWindow::GetHWND(); - HWND hwndDisplay = MainWindow::GetDisplayHWND(); //initialize custom controls CtrlDisAsmView::init();