From 612d1f8d81133180663b6405c4aec83023c17892 Mon Sep 17 00:00:00 2001 From: scribam Date: Mon, 2 Sep 2024 13:03:58 +0200 Subject: [PATCH] vita3k: cleanup (#3357) * module: add missing pragma once * cmake/vita3k: delete unused files * vita3k: delete useless semi-colons * vita3k: cleanup headers * audio: add missing override to destructors * vita3k: fix typos * external: disable unused curl targets --- cmake/GetStandard.cmake | 64 ------------------- external/CMakeLists.txt | 6 ++ lang/system/en-gb.xml | 4 +- lang/system/en.xml | 4 +- vita3k/audio/include/audio/impl/cubeb_audio.h | 2 +- vita3k/audio/include/audio/impl/sdl_audio.h | 2 +- vita3k/audio/src/impl/cubeb_audio.cpp | 2 +- vita3k/codec/src/decoder.cpp | 2 +- vita3k/codec/src/pcm.cpp | 2 +- vita3k/config/include/config/config.h | 8 +-- vita3k/cpu/include/cpu/common.h | 4 +- vita3k/cpu/include/cpu/impl/dynarmic_cpu.h | 1 - vita3k/cpu/include/cpu/state.h | 1 + vita3k/cpu/src/cpu.cpp | 2 +- vita3k/cpu/src/dynarmic_cpu.cpp | 1 + vita3k/cpu/src/read_arg.cpp | 25 -------- vita3k/cpu/src/unicorn_cpu.cpp | 2 + vita3k/gui/src/common_dialog.cpp | 10 +-- vita3k/gui/src/ime.cpp | 2 +- vita3k/gui/src/information_bar.cpp | 2 +- vita3k/gui/src/manual.cpp | 8 +-- vita3k/gui/src/perf_overlay.cpp | 6 +- vita3k/gui/src/settings_dialog.cpp | 4 +- vita3k/gxm/include/gxm/types.h | 8 +-- vita3k/gxm/src/textures.cpp | 10 +-- .../dialog/include/host/dialog/filesystem.hpp | 2 +- vita3k/host/dialog/src/filesystem.cpp | 10 +-- vita3k/http/include/http/state.h | 4 +- vita3k/interface.cpp | 1 - vita3k/kernel/include/kernel/cpu_protocol.h | 2 +- vita3k/kernel/include/kernel/debugger.h | 2 +- vita3k/kernel/include/kernel/relocation.h | 2 +- vita3k/kernel/src/cpu_protocol.cpp | 2 +- vita3k/kernel/src/debugger.cpp | 2 +- vita3k/kernel/src/kernel.cpp | 1 - vita3k/kernel/src/relocation.cpp | 1 + vita3k/lang/include/lang/state.h | 4 +- vita3k/lang/src/lang.cpp | 2 +- vita3k/main.cpp | 2 +- vita3k/mem/include/mem/state.h | 2 +- vita3k/module/include/module/bridge.h | 2 - vita3k/module/include/module/lay_out_args.h | 4 +- vita3k/module/include/module/load_module.h | 3 + vita3k/module/include/module/vargs.h | 2 - vita3k/motion/include/motion/motion_input.h | 2 +- vita3k/net/src/net.cpp | 1 - vita3k/ngs/include/ngs/scheduler.h | 3 - vita3k/ngs/include/ngs/state.h | 4 -- vita3k/ngs/src/modules/atrac9.cpp | 8 +-- vita3k/packages/src/pup.cpp | 2 +- vita3k/regmgr/include/regmgr/functions.h | 2 +- vita3k/regmgr/src/regmgr.cpp | 1 + .../renderer/include/renderer/gl/functions.h | 2 - .../include/renderer/gl/surface_cache.h | 1 + vita3k/renderer/include/renderer/gl/types.h | 4 +- vita3k/renderer/include/renderer/gxm_types.h | 1 + .../renderer/include/renderer/texture_cache.h | 2 +- vita3k/renderer/include/renderer/types.h | 2 +- .../include/renderer/vulkan/gxm_to_vulkan.h | 2 - .../renderer/include/renderer/vulkan/types.h | 3 +- vita3k/renderer/src/gl/renderer.cpp | 2 +- vita3k/renderer/src/gl/surface_cache.cpp | 4 +- vita3k/renderer/src/gl/texture.cpp | 1 - vita3k/renderer/src/scene.cpp | 6 +- vita3k/renderer/src/texture/replacement.cpp | 2 +- vita3k/renderer/src/transfer.cpp | 1 - vita3k/renderer/src/vulkan/creation.cpp | 3 +- vita3k/renderer/src/vulkan/gxm_to_vulkan.cpp | 1 + vita3k/renderer/src/vulkan/surface_cache.cpp | 8 +-- vita3k/shader/CMakeLists.txt | 8 --- .../shader/include/shader/spirv_recompiler.h | 1 - .../include/shader/usse_constant_table.h | 2 +- .../include/shader/usse_program_analyzer.h | 2 - .../shader/include/shader/usse_translator.h | 1 - .../include/shader/usse_translator_types.h | 3 +- vita3k/shader/include/shader/usse_utilities.h | 2 +- vita3k/shader/src/spirv_recompiler.cpp | 3 +- vita3k/shader/src/translator/alu.cpp | 6 +- vita3k/shader/src/translator/branch_cond.cpp | 2 +- vita3k/shader/src/translator/ialu.cpp | 2 +- vita3k/shader/src/translator/illegal.cpp | 2 - vita3k/shader/src/translator/texture.cpp | 2 +- vita3k/shader/src/usse_decode_helpers.cpp | 2 +- vita3k/shader/src/usse_program_analyzer.cpp | 6 +- vita3k/shader/src/usse_utilities.cpp | 2 +- .../tests/usse_program_analyzer_test.cpp | 26 -------- vita3k/util/include/util/arm.h | 4 +- vita3k/util/include/util/byte_ring_buffer.h | 4 +- vita3k/util/include/util/bytes.h | 1 - vita3k/util/include/util/instrset_detect.h | 2 +- vita3k/util/include/util/net_utils.h | 6 +- vita3k/util/include/util/pool.h | 2 +- vita3k/util/include/util/string_utils.h | 4 -- vita3k/util/src/net_utils.cpp | 4 +- vita3k/util/src/string_utils.cpp | 5 ++ vita3k/util/src/tracy.cpp | 2 +- vita3k/vkutil/include/vkutil/objects.h | 2 +- 97 files changed, 134 insertions(+), 274 deletions(-) delete mode 100644 cmake/GetStandard.cmake delete mode 100644 vita3k/cpu/src/read_arg.cpp delete mode 100644 vita3k/shader/tests/usse_program_analyzer_test.cpp diff --git a/cmake/GetStandard.cmake b/cmake/GetStandard.cmake deleted file mode 100644 index c308385f8d..0000000000 --- a/cmake/GetStandard.cmake +++ /dev/null @@ -1,64 +0,0 @@ -option(COMPILE_MODERN_CPP "Compile ${PROJECT_NAME} as a C++17 or C++14 program" ON) -option(COMPILE_CPP17 "Force compilation of ${PROJECT_NAME} as C++17" OFF) -option(COMPILE_CPP14 "Force compilation of ${PROJECT_NAME} as C++14" OFF) -mark_as_advanced(FORCE COMPILE_CPP17) -mark_as_advanced(FORCE COMPILE_CPP14) - -# Assign the proper standard and compilation to the project based on the flags available. -# This tests for C++17 and C++14 compatibility, while applying C++11 as a fallback. -# Based on https://stackoverflow.com/a/44964919 -function(get_standard_for_build) - unset(STANDARD_FLAG PARENT_SCOPE) - - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(COMPILER_TEST "-std=c++1z;-std=c++1y;-std=c++0x") - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - # VS 2015.3+ does not have a C++11 option - set(COMPILER_TEST "/std:c++17;/std:c++14;INVALID") - elseif(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$") - if(MSVC) ##for msvc-clang - set(COMPILER_TEST "/std:c++17;/std:c++14;/std:c++11") - else() - set(COMPILER_TEST "-std=c++17;-std=c++14;-std=c++11") - endif() - else() - set(COMPILER_TEST "-std:c++17;-std:c++14;-std:c++11") - endif() - - if(COMPILE_MODERN_CPP) - if(NOT COMPILE_CPP17 AND NOT COMPILE_CPP14) - include(CheckCXXCompilerFlag) - list(GET COMPILER_TEST 0 STANDARD_FLAG) - check_cxx_compiler_flag(${STANDARD_FLAG} HAS_CPP17_FLAG) - - include(CheckIncludeFileCXX) - check_include_file_cxx("filesystem" HAS_CPP17_INCLUDE) - if(HAS_CPP17_FLAG AND HAS_CPP17_INCLUDE) - set(COMPILE_CPP17 ON) - else() - list(GET COMPILER_TEST 1 STANDARD_FLAG) - check_cxx_compiler_flag(${STANDARD_FLAG} HAS_CPP14_FLAG) - check_include_file_cxx("experimental/filesystem" HAS_EXPERIMENTAL) - if(HAS_CPP14_FLAG AND HAS_EXPERIMENTAL) - set(COMPILE_CPP14 ON) - else() - message(FATAL_ERROR "Your compiler does not support C++14 or C++17. " - "Call\ncmake -DCOMPILE_MODERN_CPP=OFF ..\n" - "to build ${PROJECT_NAME}.") - endif() - endif() - endif() - - if(COMPILE_CPP17) - set(CPP17_SUPPORTED ON PARENT_SCOPE) - list(GET COMPILER_TEST 0 STANDARD_FLAG) - elseif(COMPILE_CPP14) - set(CPP14_SUPPORTED ON PARENT_SCOPE) - list(GET COMPILER_TEST 1 STANDARD_FLAG) - endif() - else() - list(GET COMPILER_TEST 2 STANDARD_FLAG) - endif() - - set(STANDARD_FLAG ${STANDARD_FLAG} PARENT_SCOPE) -endfunction() diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index a6c579bd7b..8491abb780 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -304,11 +304,17 @@ find_package(CURL QUIET) if(NOT CURL_FOUND) message("System curl not found, compiling curl from source") include(FetchContent) + option(BUILD_CURL_EXE "Set to ON to build curl executable." OFF) + option(CURL_DISABLE_INSTALL "Set to ON to disable installation targets" ON) option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" ON) + option(BUILD_LIBCURL_DOCS "to build libcurl man pages" OFF) + option(BUILD_MISC_DOCS "to build misc man pages (e.g. curl-config and mk-ca-bundle)" OFF) + option(ENABLE_CURL_MANUAL "to build the man page for curl and enable its -M/--manual option" OFF) if(WIN32) option(CURL_USE_SCHANNEL "Enable Windows native SSL/TLS" ON) endif() option(CURL_CA_FALLBACK "Set ON to use built-in CA store of TLS backend. Defaults to OFF" ON) + set(CURL_DISABLE_TESTS ON) FetchContent_Declare(curl GIT_REPOSITORY https://github.com/curl/curl.git GIT_TAG fd567d4f06857f4fc8e2f64ea727b1318f76ad33 # release 8.8.0 diff --git a/lang/system/en-gb.xml b/lang/system/en-gb.xml index bca70f483b..33e4bb1645 100644 --- a/lang/system/en-gb.xml +++ b/lang/system/en-gb.xml @@ -713,7 +713,7 @@ Some applications don't use this and get default confirmation button.Medium Maximum Detail - Select your preferred perfomance overlay detail. + Select your preferred performance overlay detail. Top Left Top Center Top Right @@ -721,7 +721,7 @@ Some applications don't use this and get default confirmation button.Bottom Center Bottom Right Position - Select your preferred perfomance overlay position. + Select your preferred performance overlay position. Check to enable case-insensitive path finding on case sensitive filesystems. RESETS ON RESTART Allows emulator to attempt searching for files regardless of case diff --git a/lang/system/en.xml b/lang/system/en.xml index bca70f483b..33e4bb1645 100644 --- a/lang/system/en.xml +++ b/lang/system/en.xml @@ -713,7 +713,7 @@ Some applications don't use this and get default confirmation button.Medium Maximum Detail - Select your preferred perfomance overlay detail. + Select your preferred performance overlay detail. Top Left Top Center Top Right @@ -721,7 +721,7 @@ Some applications don't use this and get default confirmation button.Bottom Center Bottom Right Position - Select your preferred perfomance overlay position. + Select your preferred performance overlay position. Check to enable case-insensitive path finding on case sensitive filesystems. RESETS ON RESTART Allows emulator to attempt searching for files regardless of case diff --git a/vita3k/audio/include/audio/impl/cubeb_audio.h b/vita3k/audio/include/audio/impl/cubeb_audio.h index 0e9dc39e18..14ce5f16dc 100644 --- a/vita3k/audio/include/audio/impl/cubeb_audio.h +++ b/vita3k/audio/include/audio/impl/cubeb_audio.h @@ -49,7 +49,7 @@ class CubebAudioAdapter : public AudioAdapter { public: CubebAudioAdapter(AudioState &audio_state); - ~CubebAudioAdapter(); + ~CubebAudioAdapter() override; bool init() override; AudioOutPortPtr open_port(int nb_channels, int freq, int nb_sample) override; diff --git a/vita3k/audio/include/audio/impl/sdl_audio.h b/vita3k/audio/include/audio/impl/sdl_audio.h index df32a896a7..9e80baa606 100644 --- a/vita3k/audio/include/audio/impl/sdl_audio.h +++ b/vita3k/audio/include/audio/impl/sdl_audio.h @@ -25,7 +25,7 @@ class SDLAudioAdapter : public AudioAdapter { public: SDLAudioAdapter(AudioState &audio_state); - ~SDLAudioAdapter(); + ~SDLAudioAdapter() override; bool init() override; void switch_state(const bool pause) override; diff --git a/vita3k/audio/src/impl/cubeb_audio.cpp b/vita3k/audio/src/impl/cubeb_audio.cpp index 1c89819893..a4ff5b3db7 100644 --- a/vita3k/audio/src/impl/cubeb_audio.cpp +++ b/vita3k/audio/src/impl/cubeb_audio.cpp @@ -117,7 +117,7 @@ AudioOutPortPtr CubebAudioAdapter::open_port(int nb_channels, int freq, int nb_s const int nb_buffers = (latency + nb_sample - 1) / nb_sample + 1; port->audio_buffers.resize(nb_buffers); for (AudioBuffer &audio_buffer : port->audio_buffers) { - // initialize all of the buffers + // initialize all the buffers audio_buffer.buffer.resize(port->len_bytes); audio_buffer.buffer_position = 0; } diff --git a/vita3k/codec/src/decoder.cpp b/vita3k/codec/src/decoder.cpp index 3499bb1425..09a0e091b1 100644 --- a/vita3k/codec/src/decoder.cpp +++ b/vita3k/codec/src/decoder.cpp @@ -41,7 +41,7 @@ DecoderState::~DecoderState() { avcodec_free_context(&context); } -// Handy to have this in logs, some debuggers dont seem to be able to evaluate there error macros properly. +// Handy to have this in logs, some debuggers don't seem to be able to evaluate there error macros properly. std::string codec_error_name(int error) { switch (error) { case AVERROR(EAGAIN): diff --git a/vita3k/codec/src/pcm.cpp b/vita3k/codec/src/pcm.cpp index c060eb928b..ce0fd50740 100644 --- a/vita3k/codec/src/pcm.cpp +++ b/vita3k/codec/src/pcm.cpp @@ -261,7 +261,7 @@ bool PCMDecoderState::send(const uint8_t *data, uint32_t size) { produced_samples = size / sizeof(std::int16_t) / source_channels; } - // Try to resample if neccessary + // Try to resample if necessary SwrContext *swr = (source_channels == 2) ? swr_stereo : swr_mono_to_stereo; const int dest_count = swr_get_out_samples(swr, produced_samples); diff --git a/vita3k/config/include/config/config.h b/vita3k/config/include/config/config.h index 7825d64e8e..4b74d07c78 100644 --- a/vita3k/config/include/config/config.h +++ b/vita3k/config/include/config/config.h @@ -26,14 +26,14 @@ enum ModulesMode { MANUAL }; -enum PerfomanceOverleyDetail { +enum PerformanceOverlayDetail { MINIMUM, LOW, MEDIUM, MAXIMUM, }; -enum PerfomanceOverleyPosition { +enum PerformanceOverlayPosition { TOP_LEFT, TOP_CENTER, TOP_RIGHT, @@ -107,8 +107,8 @@ enum ScreenshotFormat { code(bool, "color-surface-debug", false, color_surface_debug) \ code(bool, "show-touchpad-cursor", true, show_touchpad_cursor) \ code(bool, "performance-overlay", false, performance_overlay) \ - code(int, "perfomance-overlay-detail", static_cast(MINIMUM), performance_overlay_detail) \ - code(int, "perfomance-overlay-position", static_cast(TOP_LEFT), performance_overlay_position) \ + code(int, "performance-overlay-detail", static_cast(MINIMUM), performance_overlay_detail) \ + code(int, "performance-overlay-position", static_cast(TOP_LEFT), performance_overlay_position) \ code(int, "screenshot-format", static_cast(JPEG), screenshot_format) \ code(bool, "disable-motion", false, disable_motion) \ code(int, "keyboard-button-select", 229, keyboard_button_select) \ diff --git a/vita3k/cpu/include/cpu/common.h b/vita3k/cpu/include/cpu/common.h index 7b9c1343d6..03fce4f267 100644 --- a/vita3k/cpu/include/cpu/common.h +++ b/vita3k/cpu/include/cpu/common.h @@ -18,7 +18,7 @@ #pragma once #include -#include // Address. +#include // Address. #include #include @@ -43,7 +43,7 @@ typedef void *ExclusiveMonitorPtr; struct CPUProtocolBase { virtual void call_svc(CPUState &cpu, uint32_t svc, Address pc, ThreadState &thread) = 0; virtual Address get_watch_memory_addr(Address addr) = 0; - virtual ExclusiveMonitorPtr get_exlusive_monitor() = 0; + virtual ExclusiveMonitorPtr get_exclusive_monitor() = 0; virtual ~CPUProtocolBase() = default; }; diff --git a/vita3k/cpu/include/cpu/impl/dynarmic_cpu.h b/vita3k/cpu/include/cpu/impl/dynarmic_cpu.h index 5465fbdeeb..ff7356b9d2 100644 --- a/vita3k/cpu/include/cpu/impl/dynarmic_cpu.h +++ b/vita3k/cpu/include/cpu/impl/dynarmic_cpu.h @@ -18,7 +18,6 @@ #pragma once #include -#include #include #include diff --git a/vita3k/cpu/include/cpu/state.h b/vita3k/cpu/include/cpu/state.h index a6b76dd19c..ac8cd1c11d 100644 --- a/vita3k/cpu/include/cpu/state.h +++ b/vita3k/cpu/include/cpu/state.h @@ -20,6 +20,7 @@ #include #include #include +#include struct CPUState { CPUState() = default; diff --git a/vita3k/cpu/src/cpu.cpp b/vita3k/cpu/src/cpu.cpp index 59d50e80ae..c0bd5b421f 100644 --- a/vita3k/cpu/src/cpu.cpp +++ b/vita3k/cpu/src/cpu.cpp @@ -65,7 +65,7 @@ CPUStatePtr init_cpu(CPUBackend backend, bool cpu_opt, SceUID thread_id, std::si switch (backend) { case CPUBackend::Dynarmic: { - Dynarmic::ExclusiveMonitor *monitor = static_cast(protocol->get_exlusive_monitor()); + Dynarmic::ExclusiveMonitor *monitor = static_cast(protocol->get_exclusive_monitor()); state->cpu = std::make_unique(state.get(), processor_id, monitor, cpu_opt); break; } diff --git a/vita3k/cpu/src/dynarmic_cpu.cpp b/vita3k/cpu/src/dynarmic_cpu.cpp index de2a3178d4..97a926ee5c 100644 --- a/vita3k/cpu/src/dynarmic_cpu.cpp +++ b/vita3k/cpu/src/dynarmic_cpu.cpp @@ -25,6 +25,7 @@ #include #include +#include class ArmDynarmicCP15 : public Dynarmic::A32::Coprocessor { uint32_t tpidruro; diff --git a/vita3k/cpu/src/read_arg.cpp b/vita3k/cpu/src/read_arg.cpp deleted file mode 100644 index 9da36da18f..0000000000 --- a/vita3k/cpu/src/read_arg.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// Vita3K emulator project -// Copyright (C) 2024 Vita3K team -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this program; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -#include -#include - -// Workaround for old Clang and GCC -template <> -module::vargs make_vargs(const LayoutArgsState &state) { - return module::vargs{ state }; -} diff --git a/vita3k/cpu/src/unicorn_cpu.cpp b/vita3k/cpu/src/unicorn_cpu.cpp index 5f0166e250..a80b3996e6 100644 --- a/vita3k/cpu/src/unicorn_cpu.cpp +++ b/vita3k/cpu/src/unicorn_cpu.cpp @@ -17,7 +17,9 @@ #include #include +#include #include +#include #include #include diff --git a/vita3k/gui/src/common_dialog.cpp b/vita3k/gui/src/common_dialog.cpp index 1facfe2474..019c25e8c9 100644 --- a/vita3k/gui/src/common_dialog.cpp +++ b/vita3k/gui/src/common_dialog.cpp @@ -146,9 +146,9 @@ static void draw_trophy_setup_dialog(DialogState &common_dialog, float FONT_SCAL } } -static std::string get_save_date_time(SceSystemParamDateFormat date_fromat, const SceDateTime &date_time) { +static std::string get_save_date_time(SceSystemParamDateFormat date_format, const SceDateTime &date_time) { std::string date_str; - switch (date_fromat) { + switch (date_format) { case SCE_SYSTEM_PARAM_DATE_FORMAT_YYYYMMDD: date_str = fmt::format("{}/{}/{}", date_time.year, date_time.month, date_time.day); break; @@ -615,12 +615,12 @@ static void draw_savedata_dialog(GuiState &gui, EmuEnvState &emuenv, float FONT_ ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 12.f * SCALE.x); const auto BUTTON_SIZE_HEIGHT = 46.f * SCALE.y; const ImVec2 buttons_size(320.f * SCALE.x, BUTTON_SIZE_HEIGHT); - const auto boutton_height_pos = WINDOW_SIZE.y - BUTTON_SIZE_HEIGHT - (22 * SCALE.y); - const auto boutton_width_pos = HALF_WINDOW_SIZE.x - (emuenv.common_dialog.savedata.btn_num == 2 ? (buttons_size.x + (20.f * SCALE.x)) : (buttons_size.x / 2.f)); + const auto button_height_pos = WINDOW_SIZE.y - BUTTON_SIZE_HEIGHT - (22 * SCALE.y); + const auto button_width_pos = HALF_WINDOW_SIZE.x - (emuenv.common_dialog.savedata.btn_num == 2 ? (buttons_size.x + (20.f * SCALE.x)) : (buttons_size.x / 2.f)); ImGui::BeginGroup(); for (int i = 0; i < emuenv.common_dialog.savedata.btn_num; i++) { ImGui::PushID(i); - const ImVec2 button_id_pos(boutton_width_pos + (i * (buttons_size.x + (40.f * SCALE.x))), boutton_height_pos); + const ImVec2 button_id_pos(button_width_pos + (i * (buttons_size.x + (40.f * SCALE.x))), button_height_pos); ImGui::SetCursorPos(button_id_pos); if (ImGui::Button(emuenv.common_dialog.savedata.btn[i].c_str(), buttons_size)) { emuenv.common_dialog.savedata.button_id = emuenv.common_dialog.savedata.btn_val[i]; diff --git a/vita3k/gui/src/ime.cpp b/vita3k/gui/src/ime.cpp index f5b7885a72..e62fb1d2f2 100644 --- a/vita3k/gui/src/ime.cpp +++ b/vita3k/gui/src/ime.cpp @@ -252,7 +252,7 @@ void init_ime_lang(Ime &ime, const SceImeLanguage &lang) { size_button = 135.f; size_key = 88.f; break; - }; + } } static std::map key_row_pos = { { FIRST, 11.f }, { SECOND, 69.f }, { THIRD, 127.f } }; diff --git a/vita3k/gui/src/information_bar.cpp b/vita3k/gui/src/information_bar.cpp index 5c6e2eb72a..7477c1cfc8 100644 --- a/vita3k/gui/src/information_bar.cpp +++ b/vita3k/gui/src/information_bar.cpp @@ -645,7 +645,7 @@ void draw_information_bar(GuiState &gui, EmuEnvState &emuenv) { battery_size /= 100.f; } - // Set battery color depending on battery level: red for levels below or egale 25% and green for levels above this threshold. + // Set battery color depending on battery level: red for levels less than or equal to 25% and green for levels above this threshold. const ImU32 BATTERY_COLOR = (res >= 0) && (res <= 25) ? IM_COL32(225.f, 50.f, 50.f, 255.f) : IM_COL32(90.f, 200.f, 30.f, 255.f); // Draw battery level diff --git a/vita3k/gui/src/manual.cpp b/vita3k/gui/src/manual.cpp index 8b2eb8343e..b5ab08f27a 100644 --- a/vita3k/gui/src/manual.cpp +++ b/vita3k/gui/src/manual.cpp @@ -203,16 +203,16 @@ void draw_manual(GuiState &gui, EmuEnvState &emuenv) { const std::string slider = fmt::format("{:0>2d}/{:0>2d}", current_page + 1, (int32_t)gui.manuals.size()); if (ImGui::Button(slider.c_str(), BUTTON_SIZE)) ImGui::OpenPopup("Manual Slider"); - const auto POPUP_HEIGTH = 64.f * SCALE.y; - ImGui::SetNextWindowPos(ImVec2(0.f, display_size.y - POPUP_HEIGTH), ImGuiCond_Always); - ImGui::SetNextWindowSize(ImVec2(display_size.x, POPUP_HEIGTH), ImGuiCond_Always); + const auto POPUP_HEIGHT = 64.f * SCALE.y; + ImGui::SetNextWindowPos(ImVec2(0.f, display_size.y - POPUP_HEIGHT), ImGuiCond_Always); + ImGui::SetNextWindowSize(ImVec2(display_size.x, POPUP_HEIGHT), ImGuiCond_Always); ImGui::SetNextWindowBgAlpha(0.7f); if (ImGui::BeginPopupModal("Manual Slider", nullptr, ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings)) { const auto SLIDER_WIDTH = 800.f * SCALE.x; ImGui::PushItemWidth(SLIDER_WIDTH); ImGui::PushStyleVar(ImGuiStyleVar_GrabMinSize, 26.f * SCALE.y); ImGui::PushStyleVar(ImGuiStyleVar_GrabRounding, 50.f * SCALE.y); - ImGui::SetCursorPos(ImVec2((display_size.x / 2) - (SLIDER_WIDTH / 2.f), (POPUP_HEIGTH / 2) - (15.f * SCALE.x))); + ImGui::SetCursorPos(ImVec2((display_size.x / 2) - (SLIDER_WIDTH / 2.f), (POPUP_HEIGHT / 2) - (15.f * SCALE.x))); ImGui::SliderInt("##slider_current_manual", ¤t_page, 0, (int32_t)gui.manuals.size() - 1, slider.c_str()); ImGui::PopStyleVar(2); ImGui::PopItemWidth(); diff --git a/vita3k/gui/src/perf_overlay.cpp b/vita3k/gui/src/perf_overlay.cpp index b0f6384648..c51c16fd8e 100644 --- a/vita3k/gui/src/perf_overlay.cpp +++ b/vita3k/gui/src/perf_overlay.cpp @@ -76,11 +76,11 @@ void draw_perf_overlay(GuiState &gui, EmuEnvState &emuenv) { ImGui::BeginChild("#perf_stats", WINDOW_SIZE, true, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings); ImGui::PushFont(gui.vita_font); ImGui::SetWindowFontScale(0.7f * RES_SCALE.x); - if (emuenv.cfg.performance_overlay_detail == PerfomanceOverleyDetail::MINIMUM) + if (emuenv.cfg.performance_overlay_detail == PerformanceOverlayDetail::MINIMUM) ImGui::Text("FPS: %d", emuenv.fps); else ImGui::Text("FPS: %d %s: %d", emuenv.fps, lang["avg"].c_str(), emuenv.avg_fps); - if (emuenv.cfg.performance_overlay_detail >= PerfomanceOverleyDetail::MEDIUM) { + if (emuenv.cfg.performance_overlay_detail >= PerformanceOverlayDetail::MEDIUM) { ImGui::Separator(); ImGui::Text("%s: %d %s: %d", lang["min"].c_str(), emuenv.min_fps, lang["max"].c_str(), emuenv.max_fps); } @@ -88,7 +88,7 @@ void draw_perf_overlay(GuiState &gui, EmuEnvState &emuenv) { ImGui::EndChild(); ImGui::PopStyleVar(); ImGui::PopStyleColor(); - if (emuenv.cfg.performance_overlay_detail == PerfomanceOverleyDetail::MAXIMUM) { + if (emuenv.cfg.performance_overlay_detail == PerformanceOverlayDetail::MAXIMUM) { ImGui::SetCursorPosY(ImGui::GetCursorPosY() - (3.f * SCALE.y)); ImGui::PlotLines("##fps_graphic", emuenv.fps_values, IM_ARRAYSIZE(emuenv.fps_values), emuenv.current_fps_offset, nullptr, 0.f, float(emuenv.max_fps), WINDOW_SIZE); } diff --git a/vita3k/gui/src/settings_dialog.cpp b/vita3k/gui/src/settings_dialog.cpp index e7bc516ea8..99f99c729e 100644 --- a/vita3k/gui/src/settings_dialog.cpp +++ b/vita3k/gui/src/settings_dialog.cpp @@ -875,8 +875,8 @@ void draw_settings_dialog(GuiState &gui, EmuEnvState &emuenv) { ImGui::Checkbox(lang.emulator["check_for_updates"].c_str(), &emuenv.cfg.check_for_updates); SetTooltipEx(lang.emulator["check_for_updates_description"].c_str()); ImGui::Separator(); - const auto perfomance_overley_size = ImGui::CalcTextSize(lang.emulator["performance_overlay"].c_str()).x; - ImGui::SetCursorPosX((ImGui::GetWindowWidth() / 2.f) - (perfomance_overley_size / 2.f)); + const auto performance_overlay_size = ImGui::CalcTextSize(lang.emulator["performance_overlay"].c_str()).x; + ImGui::SetCursorPosX((ImGui::GetWindowWidth() / 2.f) - (performance_overlay_size / 2.f)); ImGui::TextColored(GUI_COLOR_TEXT_TITLE, "%s", lang.emulator["performance_overlay"].c_str()); ImGui::Spacing(); ImGui::Checkbox(lang.emulator["performance_overlay"].c_str(), &emuenv.cfg.performance_overlay); diff --git a/vita3k/gxm/include/gxm/types.h b/vita3k/gxm/include/gxm/types.h index 2ce52b5e36..a1ffbaf56a 100644 --- a/vita3k/gxm/include/gxm/types.h +++ b/vita3k/gxm/include/gxm/types.h @@ -415,7 +415,7 @@ enum SceGxmTextureBaseFormat : uint32_t { template constexpr static inline uint32_t operator|(const SceGxmTextureBaseFormat a, const T b) { return static_cast(a) | static_cast(b); -}; +} enum SceGxmTextureFormat : uint32_t { // Supported formats @@ -842,7 +842,7 @@ enum SceGxmColorBaseFormat : uint32_t { template constexpr static inline uint32_t operator|(const SceGxmColorBaseFormat a, const T b) { return static_cast(a) | static_cast(b); -}; +} enum SceGxmColorFormat : uint32_t { @@ -1057,7 +1057,7 @@ enum SceGxmDepthStencilForceLoadMode : uint32_t { template constexpr static inline uint32_t operator|(const SceGxmDepthStencilForceLoadMode a, const T b) { return static_cast(a) | static_cast(b); -}; +} enum SceGxmDepthStencilForceStoreMode : uint32_t { SCE_GXM_DEPTH_STENCIL_FORCE_STORE_DISABLED = 0x00000000u, @@ -1067,7 +1067,7 @@ enum SceGxmDepthStencilForceStoreMode : uint32_t { template constexpr static inline uint32_t operator|(const SceGxmDepthStencilForceStoreMode a, const T b) { return static_cast(a) | static_cast(b); -}; +} enum SceGxmColorSurfaceDitherMode : uint32_t { SCE_GXM_COLOR_SURFACE_DITHER_DISABLED = 0x00000000u, diff --git a/vita3k/gxm/src/textures.cpp b/vita3k/gxm/src/textures.cpp index 5b06b8b6e9..b9bba94624 100644 --- a/vita3k/gxm/src/textures.cpp +++ b/vita3k/gxm/src/textures.cpp @@ -296,7 +296,7 @@ uint32_t texture_size_full(const SceGxmTexture &texture) { break; default: break; - }; + } uint32_t max_possible_mip = std::bit_width(std::min(width, height)); if (type == SCE_GXM_TEXTURE_TILED) { @@ -358,9 +358,9 @@ uint32_t texture_size_full(const SceGxmTexture &texture) { const bool twok_align_cond2 = width >= 16 && height >= 16 && (bpp == 16 || bpp == 32); const bool twok_align_cond3 = width >= 8 && height >= 8 && bpp == 64; - // if one of these conditions is true, alignement between faces is 2K - const uint32_t face_alignement = (twok_align_cond1 || twok_align_cond2 || twok_align_cond3) ? 2048 : 4; - const uint32_t face_full_size = align(texture_size, face_alignement); + // if one of these conditions is true, alignment between faces is 2K + const uint32_t face_alignment = (twok_align_cond1 || twok_align_cond2 || twok_align_cond3) ? 2048 : 4; + const uint32_t face_full_size = align(texture_size, face_alignment); // don't take into account what is after the end of the last texture texture_size = 5 * face_full_size + texture_size; @@ -414,7 +414,7 @@ uint32_t texture_size_first_mip(const SceGxmTexture &texture) { break; default: break; - }; + } auto [block_width, block_height] = get_block_size(format); width = align(width, block_width); diff --git a/vita3k/host/dialog/include/host/dialog/filesystem.hpp b/vita3k/host/dialog/include/host/dialog/filesystem.hpp index 6342fbff35..8bd6fe8f54 100644 --- a/vita3k/host/dialog/include/host/dialog/filesystem.hpp +++ b/vita3k/host/dialog/include/host/dialog/filesystem.hpp @@ -39,7 +39,7 @@ namespace filesystem { */ enum Result { /** - * @brief An error has ocurred + * @brief An error has occurred */ ERROR, diff --git a/vita3k/host/dialog/src/filesystem.cpp b/vita3k/host/dialog/src/filesystem.cpp index fd5cb2c904..95d030303d 100644 --- a/vita3k/host/dialog/src/filesystem.cpp +++ b/vita3k/host/dialog/src/filesystem.cpp @@ -62,7 +62,7 @@ std::string format_file_filter_extension_list(const std::vector &fi } return formatted_string; -}; +} namespace host { namespace dialog { @@ -116,7 +116,7 @@ Result open_file(std::filesystem::path &resulting_path, const std::vector #include #include -#include #include #include #include diff --git a/vita3k/kernel/include/kernel/cpu_protocol.h b/vita3k/kernel/include/kernel/cpu_protocol.h index a3ae734cab..ad6460dc95 100644 --- a/vita3k/kernel/include/kernel/cpu_protocol.h +++ b/vita3k/kernel/include/kernel/cpu_protocol.h @@ -28,7 +28,7 @@ struct CPUProtocol : public CPUProtocolBase { ~CPUProtocol() override = default; void call_svc(CPUState &cpu, uint32_t svc, Address pc, ThreadState &thread) override; Address get_watch_memory_addr(Address addr) override; - ExclusiveMonitorPtr get_exlusive_monitor() override; + ExclusiveMonitorPtr get_exclusive_monitor() override; private: CallImportFunc call_import; diff --git a/vita3k/kernel/include/kernel/debugger.h b/vita3k/kernel/include/kernel/debugger.h index 313065091d..fc02cfb716 100644 --- a/vita3k/kernel/include/kernel/debugger.h +++ b/vita3k/kernel/include/kernel/debugger.h @@ -69,7 +69,7 @@ struct Debugger { void remove_watch_memory_addr(KernelState &state, Address addr); void add_breakpoint(MemState &mem, uint32_t addr, bool thumb_mode); void remove_breakpoint(MemState &mem, uint32_t addr); - void add_trampoile(MemState &mem, uint32_t addr, bool thumb_mode, const TrampolineCallback &callback); + void add_trampoline(MemState &mem, uint32_t addr, bool thumb_mode, const TrampolineCallback &callback); Trampoline *get_trampoline(Address addr); void remove_trampoline(MemState &mem, uint32_t addr); Address get_watch_memory_addr(Address addr); diff --git a/vita3k/kernel/include/kernel/relocation.h b/vita3k/kernel/include/kernel/relocation.h index cc36513817..323ad8409d 100644 --- a/vita3k/kernel/include/kernel/relocation.h +++ b/vita3k/kernel/include/kernel/relocation.h @@ -17,7 +17,7 @@ #pragma once -#include +#include #include diff --git a/vita3k/kernel/src/cpu_protocol.cpp b/vita3k/kernel/src/cpu_protocol.cpp index 6380956ab1..8a9d5d5f51 100644 --- a/vita3k/kernel/src/cpu_protocol.cpp +++ b/vita3k/kernel/src/cpu_protocol.cpp @@ -61,6 +61,6 @@ Address CPUProtocol::get_watch_memory_addr(Address addr) { return kernel->debugger.get_watch_memory_addr(addr); } -ExclusiveMonitorPtr CPUProtocol::get_exlusive_monitor() { +ExclusiveMonitorPtr CPUProtocol::get_exclusive_monitor() { return kernel->exclusive_monitor; } diff --git a/vita3k/kernel/src/debugger.cpp b/vita3k/kernel/src/debugger.cpp index 1a7e6a41b6..43aec7d2cf 100644 --- a/vita3k/kernel/src/debugger.cpp +++ b/vita3k/kernel/src/debugger.cpp @@ -52,7 +52,7 @@ void Debugger::remove_breakpoint(MemState &mem, uint32_t addr) { } } -void Debugger::add_trampoile(MemState &mem, uint32_t addr, bool thumb_mode, const TrampolineCallback &callback) { +void Debugger::add_trampoline(MemState &mem, uint32_t addr, bool thumb_mode, const TrampolineCallback &callback) { const auto swap_inst = [](uint32_t inst) { return (inst << 16) | ((inst >> 16) & 0xFFFF); }; diff --git a/vita3k/kernel/src/kernel.cpp b/vita3k/kernel/src/kernel.cpp index 1491cf75d2..e1d3cdd395 100644 --- a/vita3k/kernel/src/kernel.cpp +++ b/vita3k/kernel/src/kernel.cpp @@ -30,7 +30,6 @@ #include #include -#include #include int CorenumAllocator::new_corenum() { diff --git a/vita3k/kernel/src/relocation.cpp b/vita3k/kernel/src/relocation.cpp index 3fcc6f8e2a..26544d1289 100644 --- a/vita3k/kernel/src/relocation.cpp +++ b/vita3k/kernel/src/relocation.cpp @@ -16,6 +16,7 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include +#include #include #include diff --git a/vita3k/lang/include/lang/state.h b/vita3k/lang/include/lang/state.h index ed0fb956d0..54b4399931 100644 --- a/vita3k/lang/include/lang/state.h +++ b/vita3k/lang/include/lang/state.h @@ -625,7 +625,7 @@ struct LangState { { "medium", "Medium" }, { "maximum", "Maximum" }, { "detail", "Detail" }, - { "select_detail", "Select your preferred perfomance overlay detail." }, + { "select_detail", "Select your preferred performance overlay detail." }, { "top_left", "Top Left" }, { "top_center", "Top Center" }, { "top_right", "Top Right" }, @@ -633,7 +633,7 @@ struct LangState { { "bottom_center", "Bottom Center" }, { "bottom_right", "Bottom Right" }, { "position", "Position" }, - { "select_position", "Select your preferred perfomance overlay position." }, + { "select_position", "Select your preferred performance overlay position." }, { "case_insensitive", "Check to enable case-insensitive path finding on case sensitive filesystems.\nRESETS ON RESTART" }, { "case_insensitive_description", "Allows emulator to attempt to search for files regardless of case\non non-Windows platforms." }, { "emu_storage_folder", "Emulated System Storage Folder" }, diff --git a/vita3k/lang/src/lang.cpp b/vita3k/lang/src/lang.cpp index 157ec812fa..ca7b82dadc 100644 --- a/vita3k/lang/src/lang.cpp +++ b/vita3k/lang/src/lang.cpp @@ -342,7 +342,7 @@ void init_lang(LangState &lang, EmuEnvState &emuenv) { auto &lang_settings = lang.settings.language; set_lang_string(lang.settings.language.main, language); - // Input Languague + // Input Language const auto input_language = language.child("input_language"); if (!input_language.empty()) { // Main diff --git a/vita3k/main.cpp b/vita3k/main.cpp index 86c0ffb755..8bb2745b90 100644 --- a/vita3k/main.cpp +++ b/vita3k/main.cpp @@ -83,7 +83,7 @@ static void run_execv(char *argv[], EmuEnvState &emuenv) { #elif defined(__unix__) || defined(__APPLE__) && defined(__MACH__) execv(argv[0], const_cast(args)); #endif -}; +} int main(int argc, char *argv[]) { ZoneScoped; // Tracy - Track main function scope diff --git a/vita3k/mem/include/mem/state.h b/vita3k/mem/include/mem/state.h index 257ce53b8c..8c5dd5c89d 100644 --- a/vita3k/mem/include/mem/state.h +++ b/vita3k/mem/include/mem/state.h @@ -18,9 +18,9 @@ #pragma once #include +#include #include -#include #include #include diff --git a/vita3k/module/include/module/bridge.h b/vita3k/module/include/module/bridge.h index c23faf7875..3e6fe4c515 100644 --- a/vita3k/module/include/module/bridge.h +++ b/vita3k/module/include/module/bridge.h @@ -23,10 +23,8 @@ #include "lay_out_args.h" #include "read_arg.h" -#include "vargs.h" #include "write_return_value.h" -#include #include #include diff --git a/vita3k/module/include/module/lay_out_args.h b/vita3k/module/include/module/lay_out_args.h index 53b22a4ca9..d0aaf6d9a5 100644 --- a/vita3k/module/include/module/lay_out_args.h +++ b/vita3k/module/include/module/lay_out_args.h @@ -89,7 +89,7 @@ constexpr std::enable_if_t add_args_to_layout(ArgLayout &h // One or more arguments to add. template constexpr void add_args_to_layout(ArgLayout &head, LayoutArgsState &state) { - // Returns immediately if the Head is an varargs + // Returns immediately if the Head is a varargs if constexpr (std::is_same_v) { return; } else { @@ -99,7 +99,7 @@ constexpr void add_args_to_layout(ArgLayout &head, LayoutArgsState &state) { state = std::get<1>(result); // Recursively add the remaining arguments. - // If the last argument is varargs, abadon adding + // If the last argument is varargs, abandon adding if (sizeof...(Tail) > 0) { add_args_to_layout(*(&head + 1), state); } diff --git a/vita3k/module/include/module/load_module.h b/vita3k/module/include/module/load_module.h index 204e732eb0..98c7562ca5 100644 --- a/vita3k/module/include/module/load_module.h +++ b/vita3k/module/include/module/load_module.h @@ -15,10 +15,13 @@ // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +#pragma once + #include #include #include +#include #include static constexpr auto SYSMODULE_COUNT = 0x56; diff --git a/vita3k/module/include/module/vargs.h b/vita3k/module/include/module/vargs.h index f377312fca..8759d672a2 100644 --- a/vita3k/module/include/module/vargs.h +++ b/vita3k/module/include/module/vargs.h @@ -17,8 +17,6 @@ #pragma once -#include - #include "args_layout.h" #include "lay_out_args.h" #include "read_arg.h" diff --git a/vita3k/motion/include/motion/motion_input.h b/vita3k/motion/include/motion/motion_input.h index 789a74f4c5..4b64d0bcea 100644 --- a/vita3k/motion/include/motion/motion_input.h +++ b/vita3k/motion/include/motion/motion_input.h @@ -67,7 +67,7 @@ class MotionInput { // Gyroscope vector measurement in radians/s. Util::Vec3f gyro; - // Vector to be substracted from gyro measurements + // Vector to be subtracted from gyro measurements Util::Vec3f gyro_bias; // Minimum gyro amplitude to detect if the device is moving diff --git a/vita3k/net/src/net.cpp b/vita3k/net/src/net.cpp index d78fd374b0..091200619e 100644 --- a/vita3k/net/src/net.cpp +++ b/vita3k/net/src/net.cpp @@ -15,7 +15,6 @@ // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -#include #include bool init(NetState &state) { diff --git a/vita3k/ngs/include/ngs/scheduler.h b/vita3k/ngs/include/ngs/scheduler.h index 42362ead40..b06d8e5962 100644 --- a/vita3k/ngs/include/ngs/scheduler.h +++ b/vita3k/ngs/include/ngs/scheduler.h @@ -21,10 +21,7 @@ #include -#include - #include -#include #include #include diff --git a/vita3k/ngs/include/ngs/state.h b/vita3k/ngs/include/ngs/state.h index 16ee863910..2d13a65bc0 100644 --- a/vita3k/ngs/include/ngs/state.h +++ b/vita3k/ngs/include/ngs/state.h @@ -17,13 +17,9 @@ #pragma once -#include -#include #include -#include #include -#include struct MemState; diff --git a/vita3k/ngs/src/modules/atrac9.cpp b/vita3k/ngs/src/modules/atrac9.cpp index 75029789be..1a862b899c 100644 --- a/vita3k/ngs/src/modules/atrac9.cpp +++ b/vita3k/ngs/src/modules/atrac9.cpp @@ -129,10 +129,10 @@ bool Atrac9Module::decode_more_data(KernelState &kern, const MemState &mem, cons uint32_t frame_bytes_gotten = bufparam.bytes_count - state->current_byte_position_in_buffer; if (frame_bytes_gotten < superframe_size || !temp_buffer.empty()) { // the superframe overlaps two buffers... - uint32_t bytes_transfered = std::min(frame_bytes_gotten, superframe_size - temp_buffer.size()); + uint32_t bytes_transferred = std::min(frame_bytes_gotten, superframe_size - temp_buffer.size()); uint32_t old_size = temp_buffer.size(); - temp_buffer.resize(old_size + bytes_transfered); - memcpy(temp_buffer.data() + old_size, input, bytes_transfered); + temp_buffer.resize(old_size + bytes_transferred); + memcpy(temp_buffer.data() + old_size, input, bytes_transferred); if (temp_buffer.size() < superframe_size) { // continue getting data @@ -173,7 +173,7 @@ bool Atrac9Module::decode_more_data(KernelState &kern, const MemState &mem, cons // if the superframe is across two buffers, I don't know how to interpret the skipped samples (which are in the middle of the frame)... if (temp_buffer.empty()) { - // remove skipped samples at the beginnning and the end of the buffer + // remove skipped samples at the beginning and the end of the buffer // in case you have more than a superframe of samples skipped (I don't know if this can happen) const uint32_t sample_index = (state->current_byte_position_in_buffer / superframe_size) * samples_per_superframe; if (bufparam.samples_discard_start_off > sample_index) { diff --git a/vita3k/packages/src/pup.cpp b/vita3k/packages/src/pup.cpp index 328e7b272f..b663a8deb3 100644 --- a/vita3k/packages/src/pup.cpp +++ b/vita3k/packages/src/pup.cpp @@ -202,7 +202,7 @@ static void decrypt_segments(std::ifstream &infile, const fs::path &outdir, cons EVP_CIPHER_CTX_free(cipher_ctx); EVP_CIPHER_free(cipher); -}; +} static void join_files(const fs::path &path, const std::string &filename, const fs::path &output) { std::vector files; diff --git a/vita3k/regmgr/include/regmgr/functions.h b/vita3k/regmgr/include/regmgr/functions.h index 3968a6bc2e..fa92773488 100644 --- a/vita3k/regmgr/include/regmgr/functions.h +++ b/vita3k/regmgr/include/regmgr/functions.h @@ -30,7 +30,7 @@ void init_regmgr(RegMgrState ®mgr, const fs::path &pref_path); void get_bin_value(RegMgrState ®mgr, const std::string &category, const std::string &name, void *buf, uint32_t bufSize); void set_bin_value(RegMgrState ®mgr, const std::string &category, const std::string &name, const void *buf, uint32_t bufSize); -// Geters and setters for int values +// Getters and setters for int values int32_t get_int_value(RegMgrState ®mgr, const std::string &category, const std::string &name); void set_int_value(RegMgrState ®mgr, const std::string &category, const std::string &name, const int32_t value); diff --git a/vita3k/regmgr/src/regmgr.cpp b/vita3k/regmgr/src/regmgr.cpp index 788868f0f3..ad97d40cd0 100644 --- a/vita3k/regmgr/src/regmgr.cpp +++ b/vita3k/regmgr/src/regmgr.cpp @@ -15,6 +15,7 @@ // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +#include #include #include diff --git a/vita3k/renderer/include/renderer/gl/functions.h b/vita3k/renderer/include/renderer/gl/functions.h index 86177e80e2..f7a2091fb3 100644 --- a/vita3k/renderer/include/renderer/gl/functions.h +++ b/vita3k/renderer/include/renderer/gl/functions.h @@ -25,10 +25,8 @@ #include #include -#include #include #include -#include struct MemState; struct FeatureState; diff --git a/vita3k/renderer/include/renderer/gl/surface_cache.h b/vita3k/renderer/include/renderer/gl/surface_cache.h index fa5c6d646e..fec92a6895 100644 --- a/vita3k/renderer/include/renderer/gl/surface_cache.h +++ b/vita3k/renderer/include/renderer/gl/surface_cache.h @@ -25,6 +25,7 @@ #include #include #include +#include #include diff --git a/vita3k/renderer/include/renderer/gl/types.h b/vita3k/renderer/include/renderer/gl/types.h index 32b825b1f4..2e1007db03 100644 --- a/vita3k/renderer/include/renderer/gl/types.h +++ b/vita3k/renderer/include/renderer/gl/types.h @@ -24,12 +24,10 @@ #include #include -#include +#include #include #include -#include -#include #include typedef void *SDL_GLContext; diff --git a/vita3k/renderer/include/renderer/gxm_types.h b/vita3k/renderer/include/renderer/gxm_types.h index ba4fd7bc75..8a989f33e5 100644 --- a/vita3k/renderer/include/renderer/gxm_types.h +++ b/vita3k/renderer/include/renderer/gxm_types.h @@ -25,6 +25,7 @@ #include +#include #include #include #include diff --git a/vita3k/renderer/include/renderer/texture_cache.h b/vita3k/renderer/include/renderer/texture_cache.h index 86c932d1d0..9eeac16052 100644 --- a/vita3k/renderer/include/renderer/texture_cache.h +++ b/vita3k/renderer/include/renderer/texture_cache.h @@ -100,7 +100,7 @@ class TextureCache { bool use_sampler_cache = false; int anisotropic_filtering = 1; - // used to quicky get the info from a hash of a gxm_texture + // used to quickly get the info from a hash of a gxm_texture unordered_map_fast texture_lookup; lru::Queue texture_queue; diff --git a/vita3k/renderer/include/renderer/types.h b/vita3k/renderer/include/renderer/types.h index 7da1e88885..4d855f7464 100644 --- a/vita3k/renderer/include/renderer/types.h +++ b/vita3k/renderer/include/renderer/types.h @@ -90,7 +90,7 @@ struct GXMStreamInfo { size_t size = 0; }; -// We seperate the following two parts of the stencil state because the first is part of the pipeline creation +// We separate the following two parts of the stencil state because the first is part of the pipeline creation // while the second is dynamic struct GxmStencilStateOp { SceGxmStencilFunc func = SCE_GXM_STENCIL_FUNC_ALWAYS; diff --git a/vita3k/renderer/include/renderer/vulkan/gxm_to_vulkan.h b/vita3k/renderer/include/renderer/vulkan/gxm_to_vulkan.h index 63d68de351..0a1a254741 100644 --- a/vita3k/renderer/include/renderer/vulkan/gxm_to_vulkan.h +++ b/vita3k/renderer/include/renderer/vulkan/gxm_to_vulkan.h @@ -25,8 +25,6 @@ #include -#include - namespace renderer::vulkan { vk::Format translate_attribute_format(SceGxmAttributeFormat format, unsigned int component_count, bool is_integer, bool is_signed); diff --git a/vita3k/renderer/include/renderer/vulkan/types.h b/vita3k/renderer/include/renderer/vulkan/types.h index 26a34c3159..c0b14c50a2 100644 --- a/vita3k/renderer/include/renderer/vulkan/types.h +++ b/vita3k/renderer/include/renderer/vulkan/types.h @@ -19,8 +19,7 @@ #include #include - -#include +#include #include struct MemState; diff --git a/vita3k/renderer/src/gl/renderer.cpp b/vita3k/renderer/src/gl/renderer.cpp index d25a701884..aba7889bdd 100644 --- a/vita3k/renderer/src/gl/renderer.cpp +++ b/vita3k/renderer/src/gl/renderer.cpp @@ -175,7 +175,7 @@ bool create(SDL_Window *window, std::unique_ptr &state, const Config &con auto &gl_state = dynamic_cast(*state); // Recursively create GL version until one accepts - // Major 4 is mandantory + // Major 4 is mandatory // We use glBufferStorage which needs OpenGL 4.4 constexpr std::array accept_gl_minor_versions = { 6, // OpenGL 4.6 diff --git a/vita3k/renderer/src/gl/surface_cache.cpp b/vita3k/renderer/src/gl/surface_cache.cpp index 99783163fd..6d83a3995d 100644 --- a/vita3k/renderer/src/gl/surface_cache.cpp +++ b/vita3k/renderer/src/gl/surface_cache.cpp @@ -112,7 +112,7 @@ GLuint GLSurfaceCache::retrieve_color_surface_texture_handle(const State &state, // There are four situations I think of: // 1. Different base address, lookup for write, in this case, if the cached surface range contains the given address, then // probably this cached surface has already been freed GPU-wise. So erase. - // 2. Same base address, but width and height change to be larger, or format change if write. Remake a new one for both read and write sitatation. + // 2. Same base address, but width and height change to be larger, or format change if write. Remake a new one for both read and write situation. // 3. Out of cache range. In write case, create a new one, in read case, lul // 4. Read situation with smaller width and height, probably need to extract the needed region out. const bool addr_in_range_of_cache = ((key + total_surface_size) <= (ite->first + info.total_bytes)); @@ -449,7 +449,7 @@ GLuint GLSurfaceCache::retrieve_color_surface_texture_handle(const State &state, } if (color_surface_textures.contains(key)) { - LOG_WARN_ONCE("Two different surfaces have the same base adress, this is not handled, an openGL error will happen."); + LOG_WARN_ONCE("Two different surfaces have the same base address, this is not handled, an openGL error will happen."); } color_surface_textures.emplace(key, std::move(info_added)); diff --git a/vita3k/renderer/src/gl/texture.cpp b/vita3k/renderer/src/gl/texture.cpp index de1a8125bd..06d55df321 100644 --- a/vita3k/renderer/src/gl/texture.cpp +++ b/vita3k/renderer/src/gl/texture.cpp @@ -23,7 +23,6 @@ #include #include -#include namespace renderer::gl { diff --git a/vita3k/renderer/src/scene.cpp b/vita3k/renderer/src/scene.cpp index f58ec0e9f8..e2bd3862a2 100644 --- a/vita3k/renderer/src/scene.cpp +++ b/vita3k/renderer/src/scene.cpp @@ -218,18 +218,18 @@ COMMAND(handle_draw) { TRACY_FUNC_COMMANDS(handle_draw); SceGxmPrimitiveType type = helper.pop(); SceGxmIndexFormat format = helper.pop(); - Ptr indicies = helper.pop>(); + Ptr indices = helper.pop>(); const std::uint32_t count = helper.pop(); const std::uint32_t instance_count = helper.pop(); switch (renderer.current_backend) { case Backend::OpenGL: gl::draw(dynamic_cast(renderer), *reinterpret_cast(render_context), - features, type, format, indicies.cast().get(mem), count, instance_count, mem, config); + features, type, format, indices.cast().get(mem), count, instance_count, mem, config); break; case Backend::Vulkan: - vulkan::draw(*reinterpret_cast(render_context), type, format, indicies.cast(), + vulkan::draw(*reinterpret_cast(render_context), type, format, indices.cast(), count, instance_count, mem, config); break; diff --git a/vita3k/renderer/src/texture/replacement.cpp b/vita3k/renderer/src/texture/replacement.cpp index 965f1fe4c2..d94a544629 100644 --- a/vita3k/renderer/src/texture/replacement.cpp +++ b/vita3k/renderer/src/texture/replacement.cpp @@ -19,6 +19,7 @@ #include "renderer/texture_cache.h" #include "gxm/functions.h" +#include "util/align.h" #include "util/float_to_half.h" #include "util/log.h" @@ -809,7 +810,6 @@ static ddspp::DXGIFormat gxm_to_dxgi(const SceGxmTextureBaseFormat format) { return R32G32_FLOAT; case SCE_GXM_TEXTURE_BASE_FORMAT_U32U32: return R32G32_UINT; - ; case SCE_GXM_TEXTURE_BASE_FORMAT_UBC1: return BC1_UNORM; case SCE_GXM_TEXTURE_BASE_FORMAT_UBC2: diff --git a/vita3k/renderer/src/transfer.cpp b/vita3k/renderer/src/transfer.cpp index e1d4b4d2bc..d8f370067f 100644 --- a/vita3k/renderer/src/transfer.cpp +++ b/vita3k/renderer/src/transfer.cpp @@ -25,7 +25,6 @@ #include #include -#include #include // keywords.h must be after tracy.h for msvc compiler diff --git a/vita3k/renderer/src/vulkan/creation.cpp b/vita3k/renderer/src/vulkan/creation.cpp index b3ae2ab575..37ebc2cc42 100644 --- a/vita3k/renderer/src/vulkan/creation.cpp +++ b/vita3k/renderer/src/vulkan/creation.cpp @@ -24,7 +24,6 @@ #include -#include #include namespace renderer::vulkan { @@ -41,7 +40,7 @@ VKContext::VKContext(VKState &state, MemState &mem) memset(&prev_vert_ublock, 0, sizeof(shader::RenderVertUniformBlock)); memset(&prev_frag_ublock, 0, sizeof(shader::RenderFragUniformBlock)); - // specify the alignement + // specify the alignment // for the index buffer, we only have 16 or 32bit types index_stream_ring_buffer.alignment = sizeof(uint32_t); // for the vertex buffer, nothing should need more alignment than a vec4 diff --git a/vita3k/renderer/src/vulkan/gxm_to_vulkan.cpp b/vita3k/renderer/src/vulkan/gxm_to_vulkan.cpp index c06368a07c..ac84c197c6 100644 --- a/vita3k/renderer/src/vulkan/gxm_to_vulkan.cpp +++ b/vita3k/renderer/src/vulkan/gxm_to_vulkan.cpp @@ -18,6 +18,7 @@ #include #include +#include namespace renderer::vulkan { diff --git a/vita3k/renderer/src/vulkan/surface_cache.cpp b/vita3k/renderer/src/vulkan/surface_cache.cpp index 20998a32f3..81c84f0c26 100644 --- a/vita3k/renderer/src/vulkan/surface_cache.cpp +++ b/vita3k/renderer/src/vulkan/surface_cache.cpp @@ -169,7 +169,7 @@ SurfaceRetrieveResult VKSurfaceCache::retrieve_color_surface_for_framebuffer(Mem // There are four situations I think of: // 1. Different base address, lookup for write, in this case, if the cached surface range contains the given address, then // probably this cached surface has already been freed GPU-wise. So erase. - // 2. Same base address, but width and height change to be larger, or format change if write. Remake a new one for both read and write sitatation. + // 2. Same base address, but width and height change to be larger, or format change if write. Remake a new one for both read and write situation. // 3. Out of cache range. In write case, create a new one, in read case, lul // 4. Read situation with smaller width and height, probably need to extract the needed region out. // 5. the surface is a gbuffer and we are currently trying to read the 2nd component, in this case key == ite->first + 4 @@ -280,7 +280,7 @@ SurfaceRetrieveResult VKSurfaceCache::retrieve_color_surface_for_framebuffer(Mem // we only support surface sync of linear surfaces for now if (!can_mprotect_mapped_memory) { - // peform surface sync on everything + // perform surface sync on everything // it is slow but well... we can't mprotect the buffer *info_added.need_surface_sync = color->surfaceType == SCE_GXM_COLOR_SURFACE_LINEAR; } else if (color->surfaceType == SCE_GXM_COLOR_SURFACE_LINEAR && format_support_surface_sync(base_format)) { @@ -1133,7 +1133,7 @@ ColorSurfaceCacheInfo *VKSurfaceCache::perform_surface_sync() { } if (state.res_multiplier != 1.0f) { - // scale bacl the image using a blit command first + // scale back the image using a blit command first if (!last_written_surface->blit_image) last_written_surface->blit_image = std::make_unique(); @@ -1406,4 +1406,4 @@ std::vector VKSurfaceCache::dump_frame(Ptr address, uint32 return frame; } -}; // namespace renderer::vulkan +} // namespace renderer::vulkan diff --git a/vita3k/shader/CMakeLists.txt b/vita3k/shader/CMakeLists.txt index 396cbe958d..d880c3664f 100644 --- a/vita3k/shader/CMakeLists.txt +++ b/vita3k/shader/CMakeLists.txt @@ -27,11 +27,3 @@ if(TRACY_ENABLE_ON_CORE_COMPONENTS) target_link_libraries(shader PRIVATE tracy) endif() -add_executable( - shader-tests - tests/usse_program_analyzer_test.cpp -) - -target_include_directories(shader-tests PRIVATE include) -target_link_libraries(shader-tests PRIVATE googletest shader util) -add_test(NAME shader COMMAND shader-tests) diff --git a/vita3k/shader/include/shader/spirv_recompiler.h b/vita3k/shader/include/shader/spirv_recompiler.h index 57dcad8523..436e17b874 100644 --- a/vita3k/shader/include/shader/spirv_recompiler.h +++ b/vita3k/shader/include/shader/spirv_recompiler.h @@ -18,7 +18,6 @@ #pragma once #include -#include #include #include diff --git a/vita3k/shader/include/shader/usse_constant_table.h b/vita3k/shader/include/shader/usse_constant_table.h index db376edc54..b74182a3f6 100644 --- a/vita3k/shader/include/shader/usse_constant_table.h +++ b/vita3k/shader/include/shader/usse_constant_table.h @@ -430,4 +430,4 @@ static const float f16_constant_table_bank3[] = { 0.0f, 0.0f }; -}; // namespace shader::usse +} // namespace shader::usse diff --git a/vita3k/shader/include/shader/usse_program_analyzer.h b/vita3k/shader/include/shader/usse_program_analyzer.h index c430e3af65..85a5e52d35 100644 --- a/vita3k/shader/include/shader/usse_program_analyzer.h +++ b/vita3k/shader/include/shader/usse_program_analyzer.h @@ -22,9 +22,7 @@ #include #include #include -#include #include -#include #include using UniformBufferSizes = std::array; diff --git a/vita3k/shader/include/shader/usse_translator.h b/vita3k/shader/include/shader/usse_translator.h index aa85a11b66..056dbd6982 100644 --- a/vita3k/shader/include/shader/usse_translator.h +++ b/vita3k/shader/include/shader/usse_translator.h @@ -26,7 +26,6 @@ #include #include -#include struct FeatureState; diff --git a/vita3k/shader/include/shader/usse_translator_types.h b/vita3k/shader/include/shader/usse_translator_types.h index e91a61de6c..f8e67caf20 100644 --- a/vita3k/shader/include/shader/usse_translator_types.h +++ b/vita3k/shader/include/shader/usse_translator_types.h @@ -20,7 +20,6 @@ #include #include -#include #include namespace spv { @@ -91,7 +90,7 @@ struct SpirvShaderParameters { int viewport_ratio_id; int viewport_offset_id; - // when using a thread, texture or litteral buffer, if not -1, this fields contain the sa register + // when using a thread, texture or literal buffer, if not -1, this fields contain the sa register // with the matching address, this assumes of course that this address is not copied somewhere // else and that this register is not overwritten // the base field is the offset to be applied when reading this buffer (almost always -4) diff --git a/vita3k/shader/include/shader/usse_utilities.h b/vita3k/shader/include/shader/usse_utilities.h index fa4384a08b..c04dd910b0 100644 --- a/vita3k/shader/include/shader/usse_utilities.h +++ b/vita3k/shader/include/shader/usse_utilities.h @@ -35,7 +35,7 @@ struct SpirvUtilFunctions { spv::Function *fetch_memory{ nullptr }; spv::Function *unpack_fx10{ nullptr }; - // buffer_addres_vec[i][1] contains the buffer pointer with an array of vec_i and stride 16 bytes + // buffer_address_vec[i][1] contains the buffer pointer with an array of vec_i and stride 16 bytes // 0 in the last index is for the read buffer, 1 is for the write buffer // this is technically not a function but is the best place to put it // buffer_address_vec[0] is for a packed float[] array diff --git a/vita3k/shader/src/spirv_recompiler.cpp b/vita3k/shader/src/spirv_recompiler.cpp index f63ae90d11..b120cb3351 100644 --- a/vita3k/shader/src/spirv_recompiler.cpp +++ b/vita3k/shader/src/spirv_recompiler.cpp @@ -17,6 +17,7 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include +#include #include #include #include @@ -437,7 +438,7 @@ static void create_fragment_inputs(spv::Builder &b, SpirvShaderParameters ¶m const auto num_comp = ((descriptor->attribute_info >> 22) & 3) + 1; // Force this to 4. TODO: Don't - // Reason is for compability between vertex and fragment. This is like an anti-crash when linking. + // Reason is for compatibility between vertex and fragment. This is like an anti-crash when linking. // Fragment will only copy what it needed. const auto pa_iter_type = b.makeVectorType(b.makeFloatType(32), 4); const auto pa_iter_size = num_comp; diff --git a/vita3k/shader/src/translator/alu.cpp b/vita3k/shader/src/translator/alu.cpp index 784f0d1233..5f24b1936d 100644 --- a/vita3k/shader/src/translator/alu.cpp +++ b/vita3k/shader/src/translator/alu.cpp @@ -131,7 +131,7 @@ bool USSETranslatorVisitor::vmad( set_repeat_multiplier(2, 2, 2, 4); - // Write mask is a 4-bit immidiate + // Write mask is a 4-bit immediate // If a bit is one, a swizzle is active BEGIN_REPEAT(repeat_count) GET_REPEAT(inst, repeat_mode); @@ -195,7 +195,7 @@ bool USSETranslatorVisitor::vmad2( const DataType inst_dt = (dat_fmt) ? DataType::F16 : DataType::F32; - // Decode mandantory info first + // Decode mandatory info first inst.opr.dest = decode_dest(inst.opr.dest, dest_n, dest_bank, false, true, 7, m_second_program); inst.opr.src0 = decode_src0(inst.opr.src0, src0_n, src0_bank, false, true, 7, m_second_program); inst.opr.src1 = decode_src12(inst.opr.src1, src1_n, src1_bank, src1_bank_ext, true, 7, m_second_program); @@ -1675,7 +1675,7 @@ bool USSETranslatorVisitor::vdual( }; // Each instruction might have a different source layout or write mask depending on how the instruction works. - // Let's store insturction information in a map so it's easy for each instruction to be loaded. + // Let's store instruction information in a map so it's easy for each instruction to be loaded. struct DualOpInfo { uint8_t src_count; bool vector_load; diff --git a/vita3k/shader/src/translator/branch_cond.cpp b/vita3k/shader/src/translator/branch_cond.cpp index 5670a3e29f..b1c8c64a8c 100644 --- a/vita3k/shader/src/translator/branch_cond.cpp +++ b/vita3k/shader/src/translator/branch_cond.cpp @@ -208,7 +208,7 @@ inline bool is_sub_opcode(Opcode test_op) { spv::Id USSETranslatorVisitor::vtst_impl(Instruction inst, ExtPredicate pred, int zero_test, int sign_test, Imm4 load_mask, bool mask) { // Usually we would expect this to have a compare behavior - // Comparision is done by subtracting the first src by the second src, and compare the result value. + // Comparison is done by subtracting the first src by the second src, and compare the result value. // We currently optimize for that case first const DataType load_data_type = inst.opr.src1.type; const DataType store_data_type = inst.opr.dest.type; diff --git a/vita3k/shader/src/translator/ialu.cpp b/vita3k/shader/src/translator/ialu.cpp index 38300dc692..e1596aa950 100644 --- a/vita3k/shader/src/translator/ialu.cpp +++ b/vita3k/shader/src/translator/ialu.cpp @@ -337,7 +337,7 @@ bool USSETranslatorVisitor::i8mad( } bool USSETranslatorVisitor::i8mad2() { - LOG_DISASM("Unimplmenet Opcode: i8mad2"); + LOG_DISASM("Unimplemented Opcode: i8mad2"); return true; } diff --git a/vita3k/shader/src/translator/illegal.cpp b/vita3k/shader/src/translator/illegal.cpp index b84fb4af4b..b50c56b549 100644 --- a/vita3k/shader/src/translator/illegal.cpp +++ b/vita3k/shader/src/translator/illegal.cpp @@ -16,8 +16,6 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include - -#include #include bool shader::usse::USSETranslatorVisitor::illegal22() { diff --git a/vita3k/shader/src/translator/texture.cpp b/vita3k/shader/src/translator/texture.cpp index 0c4f972988..e155457cd3 100644 --- a/vita3k/shader/src/translator/texture.cpp +++ b/vita3k/shader/src/translator/texture.cpp @@ -57,7 +57,7 @@ static spv::Id get_uv_coeffs(spv::Builder &b, const spv::Id std_builtins, spv::I // un-normalize the coordinates coords = b.createBinOp(spv::OpFMul, v2f32, coords, image_size); - // substract 0.5 to each coord + // subtract 0.5 to each coord const spv::Id half = b.makeFloatConstant(0.5f); const spv::Id v2half = b.makeCompositeConstant(v2f32, { half, half }); coords = b.createBinOp(spv::OpFSub, v2f32, coords, v2half); diff --git a/vita3k/shader/src/usse_decode_helpers.cpp b/vita3k/shader/src/usse_decode_helpers.cpp index b9a73972da..95ca9dc5bd 100644 --- a/vita3k/shader/src/usse_decode_helpers.cpp +++ b/vita3k/shader/src/usse_decode_helpers.cpp @@ -30,7 +30,7 @@ namespace shader::usse { * \brief Changes TEMP registers to FPINTERNAL if certain conditions are met */ static void check_reg_internal(Operand &inout_reg, bool is_double_regs, uint8_t reg_bits) { - // TODO: Check top bit if neccessary! Sometimes it may contains type info. + // TODO: Check top bit if necessary! Sometimes it may contains type info. const auto temps = is_double_regs ? 8 : 4; const auto max_reg_num = 1 << reg_bits; const auto temp_reg_limit = max_reg_num - temps; diff --git a/vita3k/shader/src/usse_program_analyzer.cpp b/vita3k/shader/src/usse_program_analyzer.cpp index 50919433ac..725a95dc76 100644 --- a/vita3k/shader/src/usse_program_analyzer.cpp +++ b/vita3k/shader/src/usse_program_analyzer.cpp @@ -19,10 +19,10 @@ #include #include #include +#include #include - -#include +#include namespace shader::usse { bool is_kill(const std::uint64_t inst) { @@ -537,7 +537,7 @@ void analyze(USSEBlockNode &root, USSEOffset end_offset, const AnalyzeReadFuncti // Either if the instruction has different predicate with the block, // or the predicate value is being invalidated (overwritten) - // which means continuing is obselete. Stop now + // which means continuing is obsolete. Stop now if (pred != current_code->condition) { current_code->size = baddr - current_code->offset; offset_end = baddr; diff --git a/vita3k/shader/src/usse_utilities.cpp b/vita3k/shader/src/usse_utilities.cpp index e437d9302d..fa26266ef9 100644 --- a/vita3k/shader/src/usse_utilities.cpp +++ b/vita3k/shader/src/usse_utilities.cpp @@ -1073,7 +1073,7 @@ spv::Id load(spv::Builder &b, const SpirvShaderParameters ¶ms, SpirvUtilFunc } } - // For non-F32 and non-I32 type, we need to make a destination mask to extract neccessary F32 components out + // For non-F32 and non-I32 type, we need to make a destination mask to extract necessary F32 components out // For example: sa6.xz with DataType = f16 // Would result at least sa6 and sa7 to be extracted out, since sa6 contains f16 x and y, sa7 contains f16 z and w Imm4 extract_mask = dest_mask; diff --git a/vita3k/shader/tests/usse_program_analyzer_test.cpp b/vita3k/shader/tests/usse_program_analyzer_test.cpp deleted file mode 100644 index 51b040d4e7..0000000000 --- a/vita3k/shader/tests/usse_program_analyzer_test.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// Vita3K emulator project -// Copyright (C) 2024 Vita3K team -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this program; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -#include -#include - -#include - -using namespace shader; - -TEST(program_analyzer, simple_branching) { -} diff --git a/vita3k/util/include/util/arm.h b/vita3k/util/include/util/arm.h index f52ae017eb..7deee789e8 100644 --- a/vita3k/util/include/util/arm.h +++ b/vita3k/util/include/util/arm.h @@ -15,10 +15,10 @@ // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -#include - #pragma once +#include + #define INSTRUCTION_UNKNOWN 0 ///< Unknown/unsupported instruction #define INSTRUCTION_MOVW 1 ///< MOVW Rd, \#imm instruction #define INSTRUCTION_MOVT 2 ///< MOVT Rd, \#imm instruction diff --git a/vita3k/util/include/util/byte_ring_buffer.h b/vita3k/util/include/util/byte_ring_buffer.h index 74b73a06a5..acaca6e047 100644 --- a/vita3k/util/include/util/byte_ring_buffer.h +++ b/vita3k/util/include/util/byte_ring_buffer.h @@ -1,10 +1,8 @@ #pragma once #include -#include -#include - #include +#include // Ring buffer for bytes - not multi-thread safe, bring your own locks class ByteRingBuffer { diff --git a/vita3k/util/include/util/bytes.h b/vita3k/util/include/util/bytes.h index b0f2e9ce6a..5eba565ed8 100644 --- a/vita3k/util/include/util/bytes.h +++ b/vita3k/util/include/util/bytes.h @@ -18,7 +18,6 @@ #pragma once #include -#include template T byte_swap(T val); diff --git a/vita3k/util/include/util/instrset_detect.h b/vita3k/util/include/util/instrset_detect.h index b4b3da6634..9d5141f93a 100644 --- a/vita3k/util/include/util/instrset_detect.h +++ b/vita3k/util/include/util/instrset_detect.h @@ -17,7 +17,7 @@ #pragma once -#include +#include namespace util { static inline void cpuid(int output[4], int functionnumber, int ecxleaf = 0); diff --git a/vita3k/util/include/util/net_utils.h b/vita3k/util/include/util/net_utils.h index b3fdb124a7..b99a71dd4e 100644 --- a/vita3k/util/include/util/net_utils.h +++ b/vita3k/util/include/util/net_utils.h @@ -1,13 +1,11 @@ #pragma once -#include -#include #include #include -#include +#include +#include #include -#include namespace net_utils { diff --git a/vita3k/util/include/util/pool.h b/vita3k/util/include/util/pool.h index 50c5c634aa..4e07995cda 100644 --- a/vita3k/util/include/util/pool.h +++ b/vita3k/util/include/util/pool.h @@ -47,7 +47,7 @@ class Pool { // borrow returns PoolItem instance wrapping one of available resources in the pool // if there's no available resource, the thread will wait until resources are returned to the pool - // if PoolItem instance is destroyed, the corresponding resource is considerd to be returned to the pool + // if PoolItem instance is destroyed, the corresponding resource is considered to be returned to the pool PoolItem borrow(); private: diff --git a/vita3k/util/include/util/string_utils.h b/vita3k/util/include/util/string_utils.h index 87a2e21057..288541c65d 100644 --- a/vita3k/util/include/util/string_utils.h +++ b/vita3k/util/include/util/string_utils.h @@ -17,11 +17,7 @@ #pragma once -#include -#include #include -#include -#include #include #include diff --git a/vita3k/util/src/net_utils.cpp b/vita3k/util/src/net_utils.cpp index 029c602e49..94eea4803c 100644 --- a/vita3k/util/src/net_utils.cpp +++ b/vita3k/util/src/net_utils.cpp @@ -379,7 +379,7 @@ std::string get_web_regex_result(const std::string &url, const std::regex ®ex uint64_t get_current_time_ms() { return std::chrono::duration_cast(std::chrono::high_resolution_clock::now().time_since_epoch()).count(); -}; +} static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream) { size_t written = fwrite(ptr, size, nmemb, (FILE *)stream); @@ -418,7 +418,7 @@ bool download_file(const std::string &url, const std::string &output_file_path, }); if (!callback_result->download) { - return 1; // Returning anything thats not 0 aborts the request + return 1; // Returning anything that's not 0 aborts the request } return 0; }; diff --git a/vita3k/util/src/string_utils.cpp b/vita3k/util/src/string_utils.cpp index ac1122db7a..cbe7e9505a 100644 --- a/vita3k/util/src/string_utils.cpp +++ b/vita3k/util/src/string_utils.cpp @@ -19,6 +19,11 @@ #include +#include +#include +#include +#include + namespace string_utils { std::vector split_string(const std::string &str, char delimiter) { diff --git a/vita3k/util/src/tracy.cpp b/vita3k/util/src/tracy.cpp index 34dfd9ac10..be6f89676c 100644 --- a/vita3k/util/src/tracy.cpp +++ b/vita3k/util/src/tracy.cpp @@ -15,6 +15,7 @@ // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +#ifdef TRACY_ENABLE #include #include @@ -22,7 +23,6 @@ #include #include -#ifdef TRACY_ENABLE #include namespace tracy_module_utils { diff --git a/vita3k/vkutil/include/vkutil/objects.h b/vita3k/vkutil/include/vkutil/objects.h index 46faf707ac..34a709762c 100644 --- a/vita3k/vkutil/include/vkutil/objects.h +++ b/vita3k/vkutil/include/vkutil/objects.h @@ -177,4 +177,4 @@ class DestroyQueue { void destroy_objects(); }; -}; // namespace vkutil \ No newline at end of file +} // namespace vkutil \ No newline at end of file