diff --git a/src/common/decoder.cpp b/src/common/decoder.cpp index aeaba3ca6..011e1951f 100644 --- a/src/common/decoder.cpp +++ b/src/common/decoder.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -22,24 +22,6 @@ std::string DecoderImpl::disassembleInst(ZydisDecodedInstruction& inst, return szBuffer; } -void DecoderImpl::printInstruction(void* code, u64 address) { - ZydisDecodedInstruction instruction; - ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT_VISIBLE]; - ZyanStatus status = - ZydisDecoderDecodeFull(&m_decoder, code, sizeof(code), &instruction, operands); - if (!ZYAN_SUCCESS(status)) { - fmt::print("decode instruction failed at {}\n", fmt::ptr(code)); - } else { - printInst(instruction, operands, address); - } -} - -void DecoderImpl::printInst(ZydisDecodedInstruction& inst, ZydisDecodedOperand* operands, - u64 address) { - std::string s = disassembleInst(inst, operands, address); - fmt::print("instruction: {}\n", s); -} - ZyanStatus DecoderImpl::decodeInstruction(ZydisDecodedInstruction& inst, ZydisDecodedOperand* operands, void* data, u64 size) { return ZydisDecoderDecodeFull(&m_decoder, data, size, &inst, operands); diff --git a/src/common/decoder.h b/src/common/decoder.h index a5dadbf19..c8085a728 100644 --- a/src/common/decoder.h +++ b/src/common/decoder.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once @@ -16,8 +16,6 @@ public: std::string disassembleInst(ZydisDecodedInstruction& inst, ZydisDecodedOperand* operands, u64 address); - void printInst(ZydisDecodedInstruction& inst, ZydisDecodedOperand* operands, u64 address); - void printInstruction(void* code, u64 address); ZyanStatus decodeInstruction(ZydisDecodedInstruction& inst, ZydisDecodedOperand* operands, void* data, u64 size = 15); diff --git a/src/core/devtools/widget/text_editor.cpp b/src/core/devtools/widget/text_editor.cpp index 96256c61e..44bee5182 100644 --- a/src/core/devtools/widget/text_editor.cpp +++ b/src/core/devtools/widget/text_editor.cpp @@ -2113,7 +2113,7 @@ void TextEditor::ColorizeInternal() { commentStartIndex = currentIndex; } - inComment = inComment = + inComment = (commentStartLine < currentLine || (commentStartLine == currentLine && commentStartIndex <= currentIndex)); diff --git a/src/core/libraries/avplayer/avplayer_source.cpp b/src/core/libraries/avplayer/avplayer_source.cpp index 51c4ad175..4ee11f92e 100644 --- a/src/core/libraries/avplayer/avplayer_source.cpp +++ b/src/core/libraries/avplayer/avplayer_source.cpp @@ -129,7 +129,7 @@ bool AvPlayerSource::FindStreams() { } } m_duration = DurationMillis(); - return m_streams.size() >= 0; + return m_streams.size() > 0; } s32 AvPlayerSource::GetStreamCount() { diff --git a/src/core/libraries/kernel/aio.cpp b/src/core/libraries/kernel/aio.cpp index ee518030e..40232c9fa 100644 --- a/src/core/libraries/kernel/aio.cpp +++ b/src/core/libraries/kernel/aio.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -14,13 +14,12 @@ namespace Libraries::Kernel { -#define MAX_QUEUE 512 +static constexpr s32 ORBIS_KERNEL_AIO_MAX_QUEUES = 512; static s32* id_state; static s32 id_index; s32 PS4_SYSV_ABI sceKernelAioInitializeImpl(void* p, s32 size) { - return 0; } @@ -185,7 +184,7 @@ s32 PS4_SYSV_ABI sceKernelAioSubmitReadCommands(OrbisKernelAioRWRequest req[], s *id = id_index; - id_index = (id_index + 1) % MAX_QUEUE; + id_index = (id_index + 1) % ORBIS_KERNEL_AIO_MAX_QUEUES; if (!id_index) id_index++; @@ -221,7 +220,7 @@ s32 PS4_SYSV_ABI sceKernelAioSubmitReadCommandsMultiple(OrbisKernelAioRWRequest id[i] = id_index; - id_index = (id_index + 1) % MAX_QUEUE; + id_index = (id_index + 1) % ORBIS_KERNEL_AIO_MAX_QUEUES; if (!id_index) id_index++; @@ -259,7 +258,7 @@ s32 PS4_SYSV_ABI sceKernelAioSubmitWriteCommands(OrbisKernelAioRWRequest req[], *id = id_index; - id_index = (id_index + 1) % MAX_QUEUE; + id_index = (id_index + 1) % ORBIS_KERNEL_AIO_MAX_QUEUES; // skip id_index equals 0 , because sceKernelAioCancelRequest will submit id // equal to 0 @@ -294,7 +293,7 @@ s32 PS4_SYSV_ABI sceKernelAioSubmitWriteCommandsMultiple(OrbisKernelAioRWRequest } id[i] = id_index; - id_index = (id_index + 1) % MAX_QUEUE; + id_index = (id_index + 1) % ORBIS_KERNEL_AIO_MAX_QUEUES; if (!id_index) id_index++; @@ -314,8 +313,8 @@ s32 PS4_SYSV_ABI sceKernelAioInitializeParam() { void RegisterAio(Core::Loader::SymbolsResolver* sym) { id_index = 1; - id_state = (int*)malloc(sizeof(int) * MAX_QUEUE); - memset(id_state, 0, sizeof(sizeof(int) * MAX_QUEUE)); + id_state = reinterpret_cast(malloc(sizeof(s32) * ORBIS_KERNEL_AIO_MAX_QUEUES)); + memset(id_state, 0, sizeof(s32) * ORBIS_KERNEL_AIO_MAX_QUEUES); LIB_FUNCTION("fR521KIGgb8", "libkernel", 1, "libkernel", sceKernelAioCancelRequest); LIB_FUNCTION("3Lca1XBrQdY", "libkernel", 1, "libkernel", sceKernelAioCancelRequests); diff --git a/src/core/libraries/np/np_common.cpp b/src/core/libraries/np/np_common.cpp index 59a258edd..3b3114c2f 100644 --- a/src/core/libraries/np/np_common.cpp +++ b/src/core/libraries/np/np_common.cpp @@ -120,7 +120,7 @@ s32 PS4_SYSV_ABI sceNpCmpNpIdInOrder(OrbisNpId* np_id1, OrbisNpId* np_id2, u32* return ORBIS_NP_ERROR_INVALID_ARGUMENT; } - u32 compare = + s32 compare = std::strncmp(np_id1->handle.data, np_id2->handle.data, ORBIS_NP_ONLINEID_MAX_LENGTH); if (compare < 0) { *out_result = -1; diff --git a/src/core/libraries/np/np_manager.cpp b/src/core/libraries/np/np_manager.cpp index 38bff09b3..16802fb1a 100644 --- a/src/core/libraries/np/np_manager.cpp +++ b/src/core/libraries/np/np_manager.cpp @@ -256,7 +256,7 @@ s32 PS4_SYSV_ABI sceNpCheckPlus(s32 req_id, const OrbisNpCheckPlusParameter* par } if (param->features < 1 || param->features > 3) { // TODO: If compiled SDK version is greater or equal to fw 3.50, - // // error if param->features != 1 instead. + // error if param->features != 1 instead. return ORBIS_NP_ERROR_INVALID_ARGUMENT; } // The reserved field must be zero-initialized by the caller. diff --git a/src/core/libraries/np/np_manager.h b/src/core/libraries/np/np_manager.h index 1cfe86972..45b55f2a4 100644 --- a/src/core/libraries/np/np_manager.h +++ b/src/core/libraries/np/np_manager.h @@ -20,7 +20,7 @@ constexpr s32 ORBIS_NP_MANAGER_REQUEST_LIMIT = 0x20; constexpr s32 ORBIS_NP_MANAGER_REQUEST_ID_OFFSET = 0x20000000; enum class OrbisNpState : u32 { - Unknown = 0, + NotSignedUp = 0, SignedOut = 1, SignedIn = 2, }; diff --git a/src/core/libraries/playgo/playgo.cpp b/src/core/libraries/playgo/playgo.cpp index a643a72eb..88f7eb700 100644 --- a/src/core/libraries/playgo/playgo.cpp +++ b/src/core/libraries/playgo/playgo.cpp @@ -170,8 +170,7 @@ s32 PS4_SYSV_ABI scePlayGoGetLocus(OrbisPlayGoHandle handle, const OrbisPlayGoCh s32 PS4_SYSV_ABI scePlayGoGetProgress(OrbisPlayGoHandle handle, const OrbisPlayGoChunkId* chunkIds, uint32_t numberOfEntries, OrbisPlayGoProgress* outProgress) { - LOG_DEBUG(Lib_PlayGo, "called handle = {}, chunkIds = {}, numberOfEntries = {}", handle, - *chunkIds, numberOfEntries); + LOG_DEBUG(Lib_PlayGo, "called handle = {}, numberOfEntries = {}", handle, numberOfEntries); if (handle != PlaygoHandle) { return ORBIS_PLAYGO_ERROR_BAD_HANDLE; @@ -228,7 +227,7 @@ s32 PS4_SYSV_ABI scePlayGoGetToDoList(OrbisPlayGoHandle handle, OrbisPlayGoToDo* return ORBIS_OK; } -int scePlayGoConvertLanguage(int systemLang) { +u64 scePlayGoConvertLanguage(u64 systemLang) { if (systemLang >= 0 && systemLang < 48) { return (1 << (64 - systemLang - 1)); } else { diff --git a/src/shader_recompiler/ir/passes/hull_shader_transform.cpp b/src/shader_recompiler/ir/passes/hull_shader_transform.cpp index d801564e1..e2701d813 100644 --- a/src/shader_recompiler/ir/passes/hull_shader_transform.cpp +++ b/src/shader_recompiler/ir/passes/hull_shader_transform.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -244,6 +244,7 @@ private: // Stop here return; } + break; } case IR::Opcode::Phi: { auto it = phi_infos.find(use.user); diff --git a/src/video_core/renderer_vulkan/liverpool_to_vk.cpp b/src/video_core/renderer_vulkan/liverpool_to_vk.cpp index 31b404205..90b88c4e7 100644 --- a/src/video_core/renderer_vulkan/liverpool_to_vk.cpp +++ b/src/video_core/renderer_vulkan/liverpool_to_vk.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" @@ -762,7 +762,8 @@ static size_t GetSurfaceFormatTableIndex(AmdGpu::DataFormat data_format, } static auto surface_format_table = []() constexpr { - std::array + std::array result; for (auto& entry : result) { entry = vk::Format::eUndefined;