From 1c7850de1701a973e01241f7355dfad0e5fa6b70 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Mon, 10 Jun 2024 23:04:52 +0200 Subject: [PATCH] rsx: fix warnings and add missing default cases --- rpcs3/Emu/RSX/Program/CgBinaryVertexProgram.cpp | 3 +++ rpcs3/Emu/RSX/Program/VertexProgramDecompiler.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/rpcs3/Emu/RSX/Program/CgBinaryVertexProgram.cpp b/rpcs3/Emu/RSX/Program/CgBinaryVertexProgram.cpp index 38cc1fe9a0..f93f44485f 100644 --- a/rpcs3/Emu/RSX/Program/CgBinaryVertexProgram.cpp +++ b/rpcs3/Emu/RSX/Program/CgBinaryVertexProgram.cpp @@ -109,6 +109,8 @@ std::string CgBinaryDisasm::GetDSTDisasm(bool is_sca) std::string CgBinaryDisasm::GetSRCDisasm(const u32 n) { + ensure(n < 3); + std::string ret; static constexpr std::array reg_table = @@ -171,6 +173,7 @@ std::string CgBinaryDisasm::GetSRCDisasm(const u32 n) switch (n) { + default: case 0: abs = d0.src0_abs; break; case 1: abs = d0.src1_abs; break; case 2: abs = d0.src2_abs; break; diff --git a/rpcs3/Emu/RSX/Program/VertexProgramDecompiler.cpp b/rpcs3/Emu/RSX/Program/VertexProgramDecompiler.cpp index 6d16a931d1..7cb7d578a4 100644 --- a/rpcs3/Emu/RSX/Program/VertexProgramDecompiler.cpp +++ b/rpcs3/Emu/RSX/Program/VertexProgramDecompiler.cpp @@ -96,6 +96,8 @@ std::string VertexProgramDecompiler::GetDST(bool is_sca) std::string VertexProgramDecompiler::GetSRC(const u32 n) { + ensure(n < 3); + static const std::string reg_table[] = { "in_pos", "in_weight", "in_normal", @@ -152,6 +154,7 @@ std::string VertexProgramDecompiler::GetSRC(const u32 n) switch (n) { + default: case 0: abs = d0.src0_abs; break; case 1: abs = d0.src1_abs; break; case 2: abs = d0.src2_abs; break;