diff --git a/src/common/audio_stream.cpp b/src/common/audio_stream.cpp index 903a095a0..996d2fd5f 100644 --- a/src/common/audio_stream.cpp +++ b/src/common/audio_stream.cpp @@ -1,7 +1,5 @@ #include "audio_stream.h" #include "YBaseLib/Assert.h" -#include "YBaseLib/Log.h" -Log_SetChannel(Audio); AudioStream::AudioStream() = default; diff --git a/src/common/gl/texture.cpp b/src/common/gl/texture.cpp index f40c845a8..e0b3fd596 100644 --- a/src/common/gl/texture.cpp +++ b/src/common/gl/texture.cpp @@ -33,8 +33,10 @@ bool Texture::Create(u32 width, u32 height, GLenum format, GLenum type, const vo glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, linear_filter ? GL_LINEAR : GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1); - if (glGetError() != GL_NO_ERROR) + GLenum error = glGetError(); + if (error != GL_NO_ERROR) { + Log_ErrorPrintf("Failed to create texture: 0x%X", error); glDeleteTextures(1, &id); return false; } diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index 091de19c7..5b827f708 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -1419,6 +1419,11 @@ static void ResampleXAADPCM(const s16* samples_in, u32 num_samples_in, SPU* spu, const s16 left = *(samples_in++); const s16 right = STEREO ? *(samples_in++) : left; + if constexpr (!STEREO) + { + UNREFERENCED_PARAMETER(right); + } + for (u32 sample_dup = 0; sample_dup < (SAMPLE_RATE ? 2 : 1); sample_dup++) { left_ringbuf[p] = left; diff --git a/src/core/cpu_recompiler_code_generator.cpp b/src/core/cpu_recompiler_code_generator.cpp index 3377471b0..3be30309e 100644 --- a/src/core/cpu_recompiler_code_generator.cpp +++ b/src/core/cpu_recompiler_code_generator.cpp @@ -932,7 +932,7 @@ void CodeGenerator::AddPendingCycles(bool commit) return; EmitAddCPUStructField(offsetof(Core, m_pending_ticks), Value::FromConstantU32(m_delayed_cycles_add)); - + if (commit) m_delayed_cycles_add = 0; } @@ -981,7 +981,6 @@ bool CodeGenerator::Compile_Bitwise(const CodeBlockInstruction& cbi) InstructionPrologue(cbi, 1); const InstructionOp op = cbi.instruction.op; - const InstructionFunct funct = cbi.instruction.r.funct; Value lhs; Value rhs; Reg dest; diff --git a/src/core/cpu_recompiler_code_generator_x64.cpp b/src/core/cpu_recompiler_code_generator_x64.cpp index 244327fe6..401e4ff19 100644 --- a/src/core/cpu_recompiler_code_generator_x64.cpp +++ b/src/core/cpu_recompiler_code_generator_x64.cpp @@ -1,8 +1,6 @@ -#include "YBaseLib/Log.h" +#include "cpu_core.h" #include "cpu_recompiler_code_generator.h" #include "cpu_recompiler_thunks.h" -#include "cpu_core.h" -Log_SetChannel(CPU::Recompiler); namespace CPU::Recompiler { diff --git a/src/core/digital_controller.cpp b/src/core/digital_controller.cpp index fb1bb86ff..a794cd9bb 100644 --- a/src/core/digital_controller.cpp +++ b/src/core/digital_controller.cpp @@ -1,6 +1,5 @@ #include "digital_controller.h" -#include "YBaseLib/Log.h" -Log_SetChannel(DigitalController); +#include "YBaseLib/Assert.h" DigitalController::DigitalController() = default; diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index a553f88df..2a8aa826a 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -445,7 +445,7 @@ void GPU::Execute(TickCount ticks) else { m_GPUSTAT.drawing_even_line = - ConvertToBoolUnchecked(m_crtc_state.regs.Y + m_crtc_state.current_scanline & u32(1)); + ConvertToBoolUnchecked((m_crtc_state.regs.Y + m_crtc_state.current_scanline) & u32(1)); } } @@ -754,7 +754,7 @@ void GPU::SetDrawMode(u16 value) // Bits 0..10 are returned in the GPU status register. m_GPUSTAT.bits = - m_GPUSTAT.bits & ~(DrawMode::Reg::GPUSTAT_MASK) | (ZeroExtend32(new_mode_reg.bits) & DrawMode::Reg::GPUSTAT_MASK); + (m_GPUSTAT.bits & ~(DrawMode::Reg::GPUSTAT_MASK)) | (ZeroExtend32(new_mode_reg.bits) & DrawMode::Reg::GPUSTAT_MASK); m_GPUSTAT.texture_disable = m_draw_mode.mode_reg.texture_disable; } diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index f59a205e7..912871bb9 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -110,8 +110,11 @@ void GPU_HW::LoadVertices(RenderCommand rc, u32 num_vertices, const u32* command } // Cull polygons which are too large. - if ((max_x - min_x) > MAX_PRIMITIVE_WIDTH || (max_y - min_y) > MAX_PRIMITIVE_HEIGHT) + if (static_cast(max_x - min_x) > MAX_PRIMITIVE_WIDTH || + static_cast(max_y - min_y) > MAX_PRIMITIVE_HEIGHT) + { m_batch_current_vertex_ptr = old_vertex_ptr; + } } break; @@ -199,8 +202,11 @@ void GPU_HW::LoadVertices(RenderCommand rc, u32 num_vertices, const u32* command (m_batch_current_vertex_ptr++)->Set(x, y, color, 0, 0); } - if ((max_x - min_x) > MAX_PRIMITIVE_WIDTH || (max_y - min_y) > MAX_PRIMITIVE_HEIGHT) + if (static_cast(max_x - min_x) > MAX_PRIMITIVE_WIDTH || + static_cast(max_y - min_y) > MAX_PRIMITIVE_HEIGHT) + { m_batch_current_vertex_ptr = old_vertex_ptr; + } } break; diff --git a/src/core/gpu_sw.cpp b/src/core/gpu_sw.cpp index 5517ab3e5..0b072bc8d 100644 --- a/src/core/gpu_sw.cpp +++ b/src/core/gpu_sw.cpp @@ -1,11 +1,8 @@ #include "gpu_sw.h" -#include "YBaseLib/Log.h" -#include "YBaseLib/Timer.h" -#include "common/gl/texture.h" +#include "YBaseLib/Assert.h" #include "host_display.h" #include "system.h" #include -Log_SetChannel(GPU_SW); GPU_SW::GPU_SW() { @@ -350,7 +347,7 @@ void GPU_SW::DrawTriangle(const SWVertex* v0, const SWVertex* v1, const SWVertex s32 max_y = std::max(py0, std::max(py1, py2)); // reject triangles which cover the whole vram area - if ((max_x - min_x) > MAX_PRIMITIVE_WIDTH || (max_y - min_y) > MAX_PRIMITIVE_HEIGHT) + if (static_cast(max_x - min_x) > MAX_PRIMITIVE_WIDTH || static_cast(max_y - min_y) > MAX_PRIMITIVE_HEIGHT) return; // clip to drawing area @@ -594,6 +591,10 @@ void GPU_SW::ShadePixel(u32 x, u32 y, u8 color_r, u8 color_g, u8 color_b, u8 tex #undef BLEND_AVERAGE } } + else + { + UNREFERENCED_PARAMETER(transparent); + } const u16 mask_and = m_GPUSTAT.GetMaskAND(); if ((color.bits & mask_and) != mask_and) diff --git a/src/core/gte.cpp b/src/core/gte.cpp index 7f0800f2c..2513d1b10 100644 --- a/src/core/gte.cpp +++ b/src/core/gte.cpp @@ -1,8 +1,6 @@ #include "gte.h" -#include "YBaseLib/Log.h" #include #include -Log_SetChannel(GTE); // TODO: Optimize, intrinsics? static inline constexpr u32 CountLeadingZeros(u16 value) diff --git a/src/core/pad.cpp b/src/core/pad.cpp index 5655d0d84..80308813b 100644 --- a/src/core/pad.cpp +++ b/src/core/pad.cpp @@ -179,7 +179,6 @@ void Pad::WriteRegister(u32 offset, u32 value) case 0x0A: // JOY_CTRL { Log_DebugPrintf("JOY_CTRL <- 0x%04X", value); - const bool old_select = m_JOY_CTRL.SELECT; m_JOY_CTRL.bits = Truncate16(value); if (m_JOY_CTRL.RESET) diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 1a4465491..88d6d788d 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -1,8 +1,6 @@ #include "settings.h" -#include "YBaseLib/Log.h" #include #include -Log_SetChannel(Settings); #ifdef _MSC_VER #define strcasecmp stricmp diff --git a/src/duckstation-qt/gamelistwidget.cpp b/src/duckstation-qt/gamelistwidget.cpp index 9dfed3bb5..4ce274c15 100644 --- a/src/duckstation-qt/gamelistwidget.cpp +++ b/src/duckstation-qt/gamelistwidget.cpp @@ -91,7 +91,7 @@ public: return static_cast(ge.region); case Column_Size: - return ge.total_size; + return static_cast(ge.total_size); default: return {}; diff --git a/src/duckstation/sdl_host_interface.cpp b/src/duckstation/sdl_host_interface.cpp index c9ea6499a..7168727de 100644 --- a/src/duckstation/sdl_host_interface.cpp +++ b/src/duckstation/sdl_host_interface.cpp @@ -1563,7 +1563,7 @@ void SDLHostInterface::DoToggleSoftwareRendering() m_settings.gpu_renderer = m_display->GetRenderAPI() == HostDisplay::RenderAPI::D3D11 ? GPURenderer::HardwareD3D11 : GPURenderer::HardwareOpenGL; #else - m_settings.gpu_renderer = GPURenderer::HardwareD3D11; + m_settings.gpu_renderer = GPURenderer::HardwareOpenGL; #endif AddOSDMessage("Switched to hardware GPU renderer.");