From 77fd8e8f789d7be7b6ff848de05e2f63e8de470e Mon Sep 17 00:00:00 2001 From: Zangetsu38 Date: Tue, 8 Mar 2022 12:44:51 +0100 Subject: [PATCH] project: run format. --- tools/dir_doc.cpp | 58 ++-- vita3k/config/include/config/functions.h | 22 +- vita3k/crypto/include/crypto/aes.h | 2 +- vita3k/dir_doc.cpp | 300 +++++++++--------- vita3k/gxm/include/gxm/functions.h | 6 +- vita3k/gxm/include/gxm/types.h | 8 +- vita3k/host/src/sce_utils.cpp | 4 +- vita3k/host/src/sfo.cpp | 8 +- vita3k/io/include/io/device.h | 82 ++--- vita3k/kernel/include/kernel/callback.h | 46 +-- vita3k/kernel/src/callback.cpp | 14 +- vita3k/mem/src/mem.cpp | 2 +- vita3k/module/src/load_module.cpp | 2 +- vita3k/modules/SceAudio/SceAudio.cpp | 4 +- vita3k/modules/SceAvPlayer/SceAvPlayer.cpp | 16 +- .../SceKernelModulemgr/SceModulemgr.cpp | 4 +- .../SceKernelThreadMgr/SceThreadmgr.cpp | 14 +- .../SceThreadmgrForDriver.cpp | 18 +- .../SceThreadmgrForDriver.h | 18 +- vita3k/modules/SceLibc/SceLibc.cpp | 4 +- .../modules/SceProcessmgr/SceProcessmgr.cpp | 2 +- vita3k/ngs/include/ngs/dsp/playback_rate.h | 42 +-- vita3k/ngs/src/modules/atrac9.cpp | 4 +- vita3k/ngs/src/modules/player.cpp | 2 +- vita3k/np/include/np/functions.h | 6 +- vita3k/renderer/include/renderer/commands.h | 20 +- vita3k/renderer/include/renderer/functions.h | 6 +- vita3k/renderer/include/renderer/pvrt-dec.h | 46 +-- vita3k/renderer/src/gl/texture.cpp | 4 +- vita3k/renderer/src/pvrt-dec.cpp | 46 +-- vita3k/renderer/src/state_set.cpp | 2 +- vita3k/renderer/src/texture_format.cpp | 12 +- .../include/shader/usse_program_analyzer.h | 6 +- .../shader/include/shader/usse_translator.h | 2 +- vita3k/shader/src/spirv_recompiler.cpp | 26 +- vita3k/shader/src/translator/ialu.cpp | 4 +- vita3k/shader/src/translator/texture.cpp | 2 +- vita3k/shader/src/usse_decode_helpers.cpp | 7 +- vita3k/util/include/util/byte_ring_buffer.h | 24 +- vita3k/util/include/util/bytes.h | 2 +- vita3k/util/include/util/float_to_half.h | 14 +- vita3k/util/include/util/fs.h | 14 +- vita3k/util/include/util/function_info.h | 8 +- vita3k/util/include/util/vector_utils.h | 12 +- vita3k/util/src/instrset_detect.cpp | 24 +- vita3k/util/src/util.cpp | 8 +- 46 files changed, 487 insertions(+), 490 deletions(-) diff --git a/tools/dir_doc.cpp b/tools/dir_doc.cpp index 6fed80fb8..773b7bfd7 100644 --- a/tools/dir_doc.cpp +++ b/tools/dir_doc.cpp @@ -1,38 +1,38 @@ /** -* @file tools/dir_doc.cpp -* -* @brief Folder structure description -* -* This `.cpp` file contains descriptions for the `tools` source code folder and its sub-folders. -*/ + * @file tools/dir_doc.cpp + * + * @brief Folder structure description + * + * This `.cpp` file contains descriptions for the `tools` source code folder and its sub-folders. + */ /** -* @dir tools -* -* @brief Standalone tools to aid in emulator development -*/ + * @dir tools + * + * @brief Standalone tools to aid in emulator development + */ /** -* @dir tools/gen-modules -* -* @brief Batch generator for `Sce` modules source files -* -* This tool allows automated generation of `.cpp` files that serve as placeholders to catch unimplemented Vita -* SDK calls and notify them on the terminal log while preventing the emulator from crashing or raising exceptions because of it. -*/ + * @dir tools/gen-modules + * + * @brief Batch generator for `Sce` modules source files + * + * This tool allows automated generation of `.cpp` files that serve as placeholders to catch unimplemented Vita + * SDK calls and notify them on the terminal log while preventing the emulator from crashing or raising exceptions because of it. + */ /** -* @dir tools/native-tool -* -* @brief PS Vita software tool created to reverse engineer the GXM shader language -* -* Needs VitaSDK to be compiled -*/ + * @dir tools/native-tool + * + * @brief PS Vita software tool created to reverse engineer the GXM shader language + * + * Needs VitaSDK to be compiled + */ /** -* @dir tools/usse-decoder-gen -* -* @brief Instruction bitmask generator for the PS Vita GPU's Universal Scalable Shader Engine instruction set -* -* Needs VitaSDK to be compiled -*/ + * @dir tools/usse-decoder-gen + * + * @brief Instruction bitmask generator for the PS Vita GPU's Universal Scalable Shader Engine instruction set + * + * Needs VitaSDK to be compiled + */ diff --git a/vita3k/config/include/config/functions.h b/vita3k/config/include/config/functions.h index fee7baa5c..55b5b2dca 100644 --- a/vita3k/config/include/config/functions.h +++ b/vita3k/config/include/config/functions.h @@ -26,20 +26,20 @@ class Root; namespace config { /** - * \brief Save emulator config to a YML file. Call this function if the YAML file needs to be updated. - * \param cfg Config operations to save. - * \param output_path The location to save the configuration file. - * \return Success on saving the config file, otherwise Error. - */ + * \brief Save emulator config to a YML file. Call this function if the YAML file needs to be updated. + * \param cfg Config operations to save. + * \param output_path The location to save the configuration file. + * \return Success on saving the config file, otherwise Error. + */ ExitCode serialize_config(Config &cfg, const fs::path &output_path); /** - * \brief Initializes config system, parsing command-line args and handling some basic ones: - * --help, --version, --log-level - * \param cfg Config options are returned via this parameter. - * \param root_paths Root location used throughout Vita3K. - * \return Success for completion, QuitRequest if Help or Version is requested, otherwise Error. - */ + * \brief Initializes config system, parsing command-line args and handling some basic ones: + * --help, --version, --log-level + * \param cfg Config options are returned via this parameter. + * \param root_paths Root location used throughout Vita3K. + * \return Success for completion, QuitRequest if Help or Version is requested, otherwise Error. + */ ExitCode init_config(Config &cfg, int argc, char **argv, const Root &root_paths); } // namespace config diff --git a/vita3k/crypto/include/crypto/aes.h b/vita3k/crypto/include/crypto/aes.h index 7f35a72c8..dde2f338e 100644 --- a/vita3k/crypto/include/crypto/aes.h +++ b/vita3k/crypto/include/crypto/aes.h @@ -123,7 +123,7 @@ int aes_crypt_cbc(aes_context *ctx, * both encryption and decryption. So a context initialized with * aes_setkey_enc() for both AES_ENCRYPT and AES_DECRYPT. * - * both + * both * \param ctx AES context * \param mode AES_ENCRYPT or AES_DECRYPT * \param length length of the input data diff --git a/vita3k/dir_doc.cpp b/vita3k/dir_doc.cpp index 1e83e6676..94140bb74 100644 --- a/vita3k/dir_doc.cpp +++ b/vita3k/dir_doc.cpp @@ -1,217 +1,217 @@ /** -* @file vita3k/dir_doc.cpp -* -* @brief Folder structure description -* -* This `.cpp` file contains descriptions for the `vita3k` source code folder and its sub-folders. -*/ + * @file vita3k/dir_doc.cpp + * + * @brief Folder structure description + * + * This `.cpp` file contains descriptions for the `vita3k` source code folder and its sub-folders. + */ /** -* @dir vita3k -* -* @brief Source code files specific to the Vita3K emulator -* -* This folder is divided into different sub-folders that cover specific part/features of the emulatior. -*/ + * @dir vita3k + * + * @brief Source code files specific to the Vita3K emulator + * + * This folder is divided into different sub-folders that cover specific part/features of the emulatior. + */ /** -* @dir vita3k/app -* -* @brief GUI window and graphics rendering backend initiation and management -*/ + * @dir vita3k/app + * + * @brief GUI window and graphics rendering backend initiation and management + */ /** -* @dir vita3k/audio -* -* @brief Audio stream management -*/ + * @dir vita3k/audio + * + * @brief Audio stream management + */ /** -* @dir vita3k/codec -* -* @brief Multimedia decodification and video/audio player for games -*/ + * @dir vita3k/codec + * + * @brief Multimedia decodification and video/audio player for games + */ /** -* @dir vita3k/config -* -* @brief YAML configuration file management and CLI argument parsing -*/ + * @dir vita3k/config + * + * @brief YAML configuration file management and CLI argument parsing + */ /** -* @dir vita3k/cpu -* -* @brief CPU emulation -* -* The PlayStation Vita has an ARMv7 CPU, making game binaries impossible to run on a x86 system unless recompiled. -* Vita3K uses the Unicorn JIT recompiler to turn the Vita's ARM code into x86 code in order to enable execution of games in PCs. -*/ + * @dir vita3k/cpu + * + * @brief CPU emulation + * + * The PlayStation Vita has an ARMv7 CPU, making game binaries impossible to run on a x86 system unless recompiled. + * Vita3K uses the Unicorn JIT recompiler to turn the Vita's ARM code into x86 code in order to enable execution of games in PCs. + */ /** -* @dir vita3k/crypto -* -* @brief Cryptographic tooling -*/ + * @dir vita3k/crypto + * + * @brief Cryptographic tooling + */ /** -* @dir vita3k/ctrl -* -* @brief Gamepad input from host to PS Vita controls bridge -*/ + * @dir vita3k/ctrl + * + * @brief Gamepad input from host to PS Vita controls bridge + */ /** -* @dir vita3k/dialog -* -* @brief PS Vita OS dialog handling -* -* This folder contains the code necessary to handle the calls from the game to create native PS Vita OS dialogs. -*/ + * @dir vita3k/dialog + * + * @brief PS Vita OS dialog handling + * + * This folder contains the code necessary to handle the calls from the game to create native PS Vita OS dialogs. + */ /** -* @dir vita3k/disasm -* -* @brief ARM game code disassembler (used for the "Watch code" debugging option) -*/ + * @dir vita3k/disasm + * + * @brief ARM game code disassembler (used for the "Watch code" debugging option) + */ /** -* @dir vita3k/features -* -* @brief Host setup check for emulation features and optimizations -*/ + * @dir vita3k/features + * + * @brief Host setup check for emulation features and optimizations + */ /** -* @dir vita3k/gdbstub -* -* @brief GDB integration -*/ + * @dir vita3k/gdbstub + * + * @brief GDB integration + */ /** -* @dir vita3k/glutil -* -* @brief OpenGL shading language implementation -*/ + * @dir vita3k/glutil + * + * @brief OpenGL shading language implementation + */ /** -* @dir vita3k/glutil -* -* @brief OpenGL shading language implementation -*/ + * @dir vita3k/glutil + * + * @brief OpenGL shading language implementation + */ /** -* @dir vita3k/gui -* -* @brief UI elements management code -*/ + * @dir vita3k/gui + * + * @brief UI elements management code + */ /** -* @dir vita3k/gxm -* -* @brief Vita's GXM low-level graphics API translation layer -*/ + * @dir vita3k/gxm + * + * @brief Vita's GXM low-level graphics API translation layer + */ /** -* @dir vita3k/host -* -* @brief Essential code needed to emulate the PS Vita OS -*/ + * @dir vita3k/host + * + * @brief Essential code needed to emulate the PS Vita OS + */ /** -* @dir vita3k/io -* -* @brief PS Vita file system emulation and `SceIo` implementation -*/ + * @dir vita3k/io + * + * @brief PS Vita file system emulation and `SceIo` implementation + */ /** -* @dir vita3k/kernel -* -* @brief PS Vita kernel and thread emulation -*/ + * @dir vita3k/kernel + * + * @brief PS Vita kernel and thread emulation + */ /** -* @dir vita3k/mem -* -* @brief Memory management -*/ + * @dir vita3k/mem + * + * @brief Memory management + */ /** -* @dir vita3k/module -* -* @brief PS Vita module (library) loading and ARM calling convention to C++ HLE call bridge -*/ + * @dir vita3k/module + * + * @brief PS Vita module (library) loading and ARM calling convention to C++ HLE call bridge + */ /** -* @dir vita3k/modules -* -* @brief PS Vita SDK/OS call implementations -* -* This folder contains the C++ HLE equivalent implementations to the PlayStation Vita's SDK functions and methods, which -* translate calls to the Vita SDK from games into host OS calls. -* -* All the SDK subsets, methods, functions, constants and variables are described in the [VitaSDK API](https://docs.vitasdk.org/index.html). -*/ + * @dir vita3k/modules + * + * @brief PS Vita SDK/OS call implementations + * + * This folder contains the C++ HLE equivalent implementations to the PlayStation Vita's SDK functions and methods, which + * translate calls to the Vita SDK from games into host OS calls. + * + * All the SDK subsets, methods, functions, constants and variables are described in the [VitaSDK API](https://docs.vitasdk.org/index.html). + */ /** -* @dir vita3k/net -* -* @brief Ground code for `SceNet` -*/ + * @dir vita3k/net + * + * @brief Ground code for `SceNet` + */ /** -* @dir vita3k/ngs -* -* @brief Implementation of Sony's NGS propietary audio library for the PlayStation Vita -*/ + * @dir vita3k/ngs + * + * @brief Implementation of Sony's NGS propietary audio library for the PlayStation Vita + */ /** -* @dir vita3k/nids -* -* @brief NID handling for PS Vita functions -*/ + * @dir vita3k/nids + * + * @brief NID handling for PS Vita functions + */ /** -* @dir vita3k/np -* -* @brief PS Vita `Np` trophy API -*/ + * @dir vita3k/np + * + * @brief PS Vita `Np` trophy API + */ /** -* @dir vita3k/renderer -* -* @brief OpenGL and Vulkan implementations -*/ + * @dir vita3k/renderer + * + * @brief OpenGL and Vulkan implementations + */ /** -* @dir vita3k/rtc -* -* @brief Time and clock implementation -*/ + * @dir vita3k/rtc + * + * @brief Time and clock implementation + */ /** -* @dir vita3k/rtc -* -* @brief Time and clock implementation -*/ + * @dir vita3k/rtc + * + * @brief Time and clock implementation + */ /** -* @dir vita3k/shader -* -* @brief GXM shader binary recompiler -*/ + * @dir vita3k/shader + * + * @brief GXM shader binary recompiler + */ /** -* @dir vita3k/threads -* -* @brief Thread management -*/ + * @dir vita3k/threads + * + * @brief Thread management + */ /** -* @dir vita3k/touch -* -* @brief PS Vita touchscreen emulation -*/ + * @dir vita3k/touch + * + * @brief PS Vita touchscreen emulation + */ /** -* @dir vita3k/util -* -* @brief Several code utils used throughout the source code -*/ + * @dir vita3k/util + * + * @brief Several code utils used throughout the source code + */ diff --git a/vita3k/gxm/include/gxm/functions.h b/vita3k/gxm/include/gxm/functions.h index 314556dde..a8a5fd398 100644 --- a/vita3k/gxm/include/gxm/functions.h +++ b/vita3k/gxm/include/gxm/functions.h @@ -55,9 +55,9 @@ using GxmVertexOutputTexCoordInfos = std::array; void log_parameter(const SceGxmProgramParameter ¶meter); /** -* \brief Returns raw parameter name from GXP -* Therefore, if parameter belongs in a struct, includes it in the form of "struct_name.field_name" -*/ + * \brief Returns raw parameter name from GXP + * Therefore, if parameter belongs in a struct, includes it in the form of "struct_name.field_name" + */ std::string parameter_name_raw(const SceGxmProgramParameter ¶meter); /** diff --git a/vita3k/gxm/include/gxm/types.h b/vita3k/gxm/include/gxm/types.h index bb3943796..78d3d2db8 100644 --- a/vita3k/gxm/include/gxm/types.h +++ b/vita3k/gxm/include/gxm/types.h @@ -1305,11 +1305,11 @@ struct SceGxmUniformBufferInfo { struct SceGxmProgram { std::uint32_t magic; // should be "GXP\0" - std::uint8_t major_version; //min 1 - std::uint8_t minor_version; //min 4 + std::uint8_t major_version; // min 1 + std::uint8_t minor_version; // min 4 std::uint16_t sdk_version; // 0x350 - 3.50 - std::uint32_t size; //size of file - ignoring padding bytes at the end after SceGxmProgramParameter table + std::uint32_t size; // size of file - ignoring padding bytes at the end after SceGxmProgramParameter table std::uint32_t binary_guid; std::uint32_t source_guid; @@ -1327,7 +1327,7 @@ struct SceGxmProgram { std::uint16_t primary_reg_count; // (PAs) std::uint16_t secondary_reg_count; // (SAs) std::uint32_t temp_reg_count1; - std::uint16_t temp_reg_count2; //Temp reg count in selective rate(programmable blending) phase + std::uint16_t temp_reg_count2; // Temp reg count in selective rate(programmable blending) phase std::uint16_t primary_program_phase_count; std::uint32_t primary_program_instr_count; diff --git a/vita3k/host/src/sce_utils.cpp b/vita3k/host/src/sce_utils.cpp index df702e3e8..30787d8c2 100644 --- a/vita3k/host/src/sce_utils.cpp +++ b/vita3k/host/src/sce_utils.cpp @@ -28,7 +28,7 @@ // Credits to TeamMolecule for their original work on this https://github.com/TeamMolecule/sceutils void register_keys(KeyStore &SCE_KEYS, int type) { - //case 0 registers external(retail), 1 registers internal proto keys, proto_keys not added. + // case 0 registers external(retail), 1 registers internal proto keys, proto_keys not added. switch (type) { case 0: SCE_KEYS.register_keys( @@ -858,7 +858,7 @@ void self2elf(const std::string &infile, const std::string &outfile, KeyStore &S fileout.close(); } -//Credits to the vitasdk team/contributors for vita-make-fself https://github.com/vitasdk/vita-toolchain/blob/master/src/vita-make-fself.c +// Credits to the vitasdk team/contributors for vita-make-fself https://github.com/vitasdk/vita-toolchain/blob/master/src/vita-make-fself.c void make_fself(const std::string &input_file, const std::string &output_file) { std::ifstream filein(input_file, std::ios::binary); diff --git a/vita3k/host/src/sfo.cpp b/vita3k/host/src/sfo.cpp index c7a0b4c50..66bedde37 100644 --- a/vita3k/host/src/sfo.cpp +++ b/vita3k/host/src/sfo.cpp @@ -90,8 +90,8 @@ bool load(SfoFile &sfile, const std::vector &content) { memcpy(&sfile.entries[i].data.first[0], &content[sfile.header.key_table_start + sfile.entries[i].entry.key_offset], keySize); - //Quick hack to remove garbage null terminator caused by reading directly - //to buffer + // Quick hack to remove garbage null terminator caused by reading directly + // to buffer sfile.entries[i].data.first = sfile.entries[i].data.first.c_str(); } @@ -103,8 +103,8 @@ bool load(SfoFile &sfile, const std::vector &content) { // The last of data is a terminator memcpy(&sfile.entries[i].data.second[0], &content[sfile.header.data_table_start + sfile.entries[i].entry.data_offset], dataSize - 1); - //Quick hack to remove garbage null terminator caused by reading directly - //to buffer + // Quick hack to remove garbage null terminator caused by reading directly + // to buffer sfile.entries[i].data.second = sfile.entries[i].data.second.c_str(); } diff --git a/vita3k/io/include/io/device.h b/vita3k/io/include/io/device.h index fb1796713..3ded1642e 100644 --- a/vita3k/io/include/io/device.h +++ b/vita3k/io/include/io/device.h @@ -27,10 +27,10 @@ namespace device { /** - * \brief Get a Vita device from a given path. - * \param path The input path to be tested. - * \return The path's root as an enumeration. Otherwise, VitaIoDevice::_INVALID. - */ + * \brief Get a Vita device from a given path. + * \param path The input path to be tested. + * \return The path's root as an enumeration. Otherwise, VitaIoDevice::_INVALID. + */ inline VitaIoDevice get_device(const std::string &path) { if (path.empty()) return VitaIoDevice::_INVALID; @@ -48,20 +48,20 @@ inline VitaIoDevice get_device(const std::string &path) { } /** - * \brief Get a valid Vita device as a string. - * \param dev The input Vita device needed. - * \param with_colon Output the string appended with a colon (default: false) - * \return A string version of the Vita device. - */ + * \brief Get a valid Vita device as a string. + * \param dev The input Vita device needed. + * \param with_colon Output the string appended with a colon (default: false) + * \return A string version of the Vita device. + */ inline std::string get_device_string(const VitaIoDevice dev, const bool with_colon = false) { return with_colon ? std::string(dev._to_string()).append(":") : dev._to_string(); } /** - * \brief Check if the device is a valid output path. - * \param device Input device to be checked. - * \return True if valid, False otherwise. - */ + * \brief Check if the device is a valid output path. + * \param device Input device to be checked. + * \return True if valid, False otherwise. + */ inline bool is_valid_output_path(const VitaIoDevice device) { return !(device == VitaIoDevice::savedata0 || device == VitaIoDevice::savedata1 || device == VitaIoDevice::app0 || device == VitaIoDevice::_INVALID || device == VitaIoDevice::addcont0 || device == VitaIoDevice::tty0 @@ -69,10 +69,10 @@ inline bool is_valid_output_path(const VitaIoDevice device) { } /** - * \brief Check if the device string is valid. - * \param device Input device to be checked. - * \return True if valid, False otherwise. - */ + * \brief Check if the device string is valid. + * \param device Input device to be checked. + * \return True if valid, False otherwise. + */ inline bool is_valid_output_path(const std::string &device) { return !(device == (+VitaIoDevice::savedata0)._to_string() || device == (+VitaIoDevice::savedata1)._to_string() || device == (+VitaIoDevice::app0)._to_string() || device == (+VitaIoDevice::_INVALID)._to_string() || device == (+VitaIoDevice::addcont0)._to_string() || device == (+VitaIoDevice::tty0)._to_string() @@ -80,29 +80,29 @@ inline bool is_valid_output_path(const std::string &device) { } /** - * \brief Construct a normalized path (optionally with an extension) to be outputted onto the Vita. - * \param dev The input Vita device. - * \param path The Vita location needed. - * \param ext The extension of the file (optional). - * \return An std::string of a real Vita translated path. - */ + * \brief Construct a normalized path (optionally with an extension) to be outputted onto the Vita. + * \param dev The input Vita device. + * \param path The Vita location needed. + * \param ext The extension of the file (optional). + * \return An std::string of a real Vita translated path. + */ std::string construct_normalized_path(VitaIoDevice dev, const std::string &path, const std::string &ext = ""); /** - * \brief Remove a device string from the path, and optionally prepend it with a different string. - * \param path Input path to be modified. - * \param device The device to be removed. - * \param mod_path The new path to prepend the path (optional). - * \return The string without the device, normalized. - */ + * \brief Remove a device string from the path, and optionally prepend it with a different string. + * \param path Input path to be modified. + * \param device The device to be removed. + * \param mod_path The new path to prepend the path (optional). + * \return The string without the device, normalized. + */ std::string remove_device_from_path(const std::string &path, VitaIoDevice device, const std::string &mod_path = ""); /** - * \brief Used for removing an extra device from a path. (Note: Not intended to be a permanent solution.) - * \param path The input Vita path. - * \param device The device to be removed. - * \return New path without the duplicate device. - */ + * \brief Used for removing an extra device from a path. (Note: Not intended to be a permanent solution.) + * \param path The input Vita path. + * \param device The device to be removed. + * \return New path without the duplicate device. + */ inline std::string remove_duplicate_device(const std::string &path, VitaIoDevice &device) { auto cur_path = remove_device_from_path(path, device); if (get_device(cur_path) != VitaIoDevice::_INVALID) { @@ -116,13 +116,13 @@ inline std::string remove_duplicate_device(const std::string &path, VitaIoDevice } /** - * \brief Construct the emulated Vita path (optionally with an extension). - * \param dev The input Vita device used. - * \param path The path of the file. - * \param base_path The main output for the file. - * \param ext The extension of the file (optional). - * \return A complete Boost.Filesystem path normalized. - */ + * \brief Construct the emulated Vita path (optionally with an extension). + * \param dev The input Vita device used. + * \param path The path of the file. + * \param base_path The main output for the file. + * \param ext The extension of the file (optional). + * \return A complete Boost.Filesystem path normalized. + */ inline fs::path construct_emulated_path(const VitaIoDevice dev, const fs::path &path, const std::wstring &base_path, const bool redirect_pwd = false, const std::string &ext = "") { if (redirect_pwd && dev == +VitaIoDevice::host0) { return fs::current_path() / path; diff --git a/vita3k/kernel/include/kernel/callback.h b/vita3k/kernel/include/kernel/callback.h index 8afe9744c..fe758cecd 100644 --- a/vita3k/kernel/include/kernel/callback.h +++ b/vita3k/kernel/include/kernel/callback.h @@ -28,12 +28,12 @@ typedef std::shared_ptr ThreadStatePtr; struct Callback { /** * @brief Creates a Callback object - * + * * @param thread Thread object that created this callback * @param name Name of the callback * @param cb_func Pointer to the callback function * @param pCommon User-provided parameter - */ + */ Callback(SceUID thread_id, ThreadStatePtr thread, std::string &name, Ptr cb_func, Ptr pCommon) : thread_id(thread_id) , thread(thread) @@ -43,66 +43,66 @@ struct Callback { /** * @return UID of the thread that created and owns this callback - */ + */ SceUID get_owner_thread_id() { return this->thread_id; } /** * @return Name of the callback - */ + */ const std::string &get_name() { return this->name; } /** * @return Callback function - */ + */ Ptr get_callback_function() const { return this->cb_func; } /** * @return UID of the event that notified the callback last - */ + */ SceUID get_notifier_id(); /** * @return notifyArg from last time callback was notified - */ + */ SceInt32 get_notify_arg(); /** * @return User-provided common argument - */ + */ Ptr get_user_common_ptr() const { return this->userdata; } /** * @brief Notify this callback * @param notifier_id UID of the notifying event * @param notify_arg User-specified notification argument - */ + */ void notify(SceUID notifier_id, SceInt32 notify_arg); /** * @brief Notify this callback from an event, without notification argument * @param notifier_id UID of the event that notifies this callback - */ + */ void event_notify(SceUID notifier_id); /** * @brief Notify this callback directly (not from event) * @param notify_arg User-specified notification argument - */ + */ void direct_notify(SceInt32 notify_arg); /** * @brief Cancels every notification sent to this callback - */ + */ void cancel(); /** * @return true if the callback can be executed, false otherwise - */ + */ bool is_executable(); /** * @return Number of times callback has been notified since last execution - */ + */ uint32_t get_num_notifications(); /** @@ -110,7 +110,7 @@ struct Callback { * @return true if the callback is executed and requests to be deleted (CallbackFunction returned non-zero) * @return false otherwise * @note Calling this method when Callback.executable() == false returns false and does nothing - */ + */ bool execute(); private: @@ -118,15 +118,15 @@ private: bool is_notified() const; std::mutex _mutex; - const SceUID thread_id; //UID of the thread that created this callback - const ThreadStatePtr thread; //Thread object that created this callback - const std::string name; //Name of the callback - const Ptr cb_func; //Function to execute when the callback should run - const Ptr userdata; //User-provided data - passed as pCommon + const SceUID thread_id; // UID of the thread that created this callback + const ThreadStatePtr thread; // Thread object that created this callback + const std::string name; // Name of the callback + const Ptr cb_func; // Function to execute when the callback should run + const Ptr userdata; // User-provided data - passed as pCommon - uint32_t num_notifications = 0; //Number of times this callback has been notified - reset every time it is run - SceInt32 notification_arg = 0; //User-specified argument passed by sceKernelNotifyCallback - SceUID notifier_id = SCE_UID_INVALID_UID; //UID of the last event that notified this thread - SCE_UID_INVALID_UID if not an event + uint32_t num_notifications = 0; // Number of times this callback has been notified - reset every time it is run + SceInt32 notification_arg = 0; // User-specified argument passed by sceKernelNotifyCallback + SceUID notifier_id = SCE_UID_INVALID_UID; // UID of the last event that notified this thread - SCE_UID_INVALID_UID if not an event }; typedef std::shared_ptr CallbackPtr; diff --git a/vita3k/kernel/src/callback.cpp b/vita3k/kernel/src/callback.cpp index a5d3d38e0..495f3cc22 100644 --- a/vita3k/kernel/src/callback.cpp +++ b/vita3k/kernel/src/callback.cpp @@ -51,8 +51,8 @@ SceInt32 Callback::get_notify_arg() { } bool Callback::is_executable() { - //Lock the mutex to ensure that no other call is accessing this Callback - //If we don't lock, num_notifications could be modified right as we're reading it + // Lock the mutex to ensure that no other call is accessing this Callback + // If we don't lock, num_notifications could be modified right as we're reading it std::lock_guard lock(this->_mutex); return this->is_notified(); } @@ -65,13 +65,13 @@ uint32_t Callback::get_num_notifications() { bool Callback::execute() { std::lock_guard lock(this->_mutex); if (!this->is_notified()) - return false; //We can't execute, so we don't want to be unregistered + return false; // We can't execute, so we don't want to be unregistered std::vector args = { (uint32_t)(this->notifier_id), this->num_notifications, (uint32_t)this->notification_arg, this->userdata.address() }; int cb_result = this->thread->run_guest_function(this->cb_func.address(), args); - this->reset(); //Callbacks return to their default state after running + this->reset(); // Callbacks return to their default state after running - return cb_result != 0; //A non-zero return value indicates the callback wants to be deleted + return cb_result != 0; // A non-zero return value indicates the callback wants to be deleted } /** Private methods **/ @@ -79,7 +79,7 @@ bool Callback::execute() { /** * @brief Resets the callback to its default state * @note You MUST lock the callback's mutex before calling this function -*/ + */ void Callback::reset() { this->num_notifications = 0; this->notifier_id = SCE_UID_INVALID_UID; @@ -88,7 +88,7 @@ void Callback::reset() { /** * @return true if the callback has notifications pending, false otherwise * @note You MUST lock the callback's mutex before calling this function -*/ + */ bool Callback::is_notified() const { return (this->num_notifications > 0); } diff --git a/vita3k/mem/src/mem.cpp b/vita3k/mem/src/mem.cpp index c9c3ca6e3..313c67abf 100644 --- a/vita3k/mem/src/mem.cpp +++ b/vita3k/mem/src/mem.cpp @@ -40,7 +40,7 @@ constexpr size_t TOTAL_MEM_SIZE = GB(4); constexpr bool LOG_PROTECT = false; constexpr bool PAGE_NAME_TRACKING = false; -//TODO: support multiple handlers +// TODO: support multiple handlers static AccessViolationHandler access_violation_handler; static void register_access_violation_handler(AccessViolationHandler handler); diff --git a/vita3k/module/src/load_module.cpp b/vita3k/module/src/load_module.cpp index d55e42432..13ed4355e 100644 --- a/vita3k/module/src/load_module.cpp +++ b/vita3k/module/src/load_module.cpp @@ -32,7 +32,7 @@ bool is_lle_module(SceSysmoduleModuleId module_id, HostState &host) { SCE_SYSMODULE_PGF, SCE_SYSMODULE_SYSTEM_GESTURE, SCE_SYSMODULE_XML, - //SCE_SYSMODULE_MP4, // Is not ready for now + // SCE_SYSMODULE_MP4, // Is not ready for now SCE_SYSMODULE_ATRAC, SCE_SYSMODULE_JSON, }; diff --git a/vita3k/modules/SceAudio/SceAudio.cpp b/vita3k/modules/SceAudio/SceAudio.cpp index 1d687172f..e4a2a683e 100644 --- a/vita3k/modules/SceAudio/SceAudio.cpp +++ b/vita3k/modules/SceAudio/SceAudio.cpp @@ -170,7 +170,7 @@ EXPORT(int, sceAudioOutSetPortVolume_forUser) { } EXPORT(int, sceAudioOutSetVolume, int port, SceAudioOutChannelFlag ch, int *vol) { - if (!ch) //no channel selected, no changes + if (!ch) // no channel selected, no changes return 0; const AudioOutPortPtr prt = lock_and_find(port, host.audio.shared.out_ports, host.audio.shared.mutex); @@ -182,7 +182,7 @@ EXPORT(int, sceAudioOutSetVolume, int port, SceAudioOutChannelFlag ch, int *vol) const int volume = static_cast(SDL_MIX_MAXVOLUME * volume_level); prt->volume = volume; - //then update channel volumes in case there was a change + // then update channel volumes in case there was a change prt->left_channel_volume = left; prt->right_channel_volume = right; diff --git a/vita3k/modules/SceAvPlayer/SceAvPlayer.cpp b/vita3k/modules/SceAvPlayer/SceAvPlayer.cpp index e813e33ac..3fbde4338 100644 --- a/vita3k/modules/SceAvPlayer/SceAvPlayer.cpp +++ b/vita3k/modules/SceAvPlayer/SceAvPlayer.cpp @@ -254,13 +254,13 @@ EXPORT(int32_t, sceAvPlayerAddSource, SceUID player_handle, Ptr path const auto buf_ptr = Ptr(buf).get(host.mem); const auto thread = lock_and_find(thread_id, host.kernel.threads, host.kernel.mutex); host.kernel.run_guest_function(player_info->file_manager.open_file.address(), { player_info->file_manager.user_data, path.address() }); - //TODO: support file_size > 4GB (callback function returns uint64_t, but I dont know how to get high dword of uint64_t) + // TODO: support file_size > 4GB (callback function returns uint64_t, but I dont know how to get high dword of uint64_t) const uint32_t file_size = host.kernel.run_guest_function(player_info->file_manager.file_size.address(), { player_info->file_manager.user_data }); auto remaining = file_size; uint32_t offset = 0; while (remaining) { const auto buf_size = std::min((uint32_t)KB(512), remaining); - //zero in 5 parameter means high dword of uint64_t parameter. see previous todo + // zero in 5 parameter means high dword of uint64_t parameter. see previous todo host.kernel.run_guest_function(player_info->file_manager.read_file.address(), { player_info->file_manager.user_data, buf, offset, 0, buf_size }); temp_file.write(buf_ptr, buf_size); offset += buf_size; @@ -277,7 +277,7 @@ EXPORT(int32_t, sceAvPlayerAddSource, SceUID player_handle, Ptr path } player_info->player.queue(file_path); - run_event_callback(host, thread_id, player_info, SCE_AVPLAYER_STATE_BUFFERING, 0, Ptr(0)); //may be important for sound + run_event_callback(host, thread_id, player_info, SCE_AVPLAYER_STATE_BUFFERING, 0, Ptr(0)); // may be important for sound run_event_callback(host, thread_id, player_info, SCE_AVPLAYER_STATE_READY, 0, Ptr(0)); return 0; } @@ -363,7 +363,7 @@ EXPORT(uint32_t, sceAvPlayerGetStreamInfo, SceUID player_handle, uint stream_no, STUBBED("ALWAYS SUSPECTS 2 STREAMS: VIDEO AND AUDIO"); const auto state = host.kernel.obj_store.get(); const PlayerPtr &player_info = lock_and_find(player_handle, state->players, state->mutex); - if (stream_no == 0) { //suspect always two streams: audio and video //first is video + if (stream_no == 0) { // suspect always two streams: audio and video //first is video DecoderSize size = player_info->player.get_size(); stream_info->stream_type = MediaType::VIDEO; stream_info->stream_details.video.width = size.width; @@ -371,7 +371,7 @@ EXPORT(uint32_t, sceAvPlayerGetStreamInfo, SceUID player_handle, uint stream_no, stream_info->stream_details.video.aspect_ratio = static_cast(size.width) / static_cast(size.height); strcpy(stream_info->stream_details.video.language, "ENG"); } else if (stream_no == 1) { // audio - player_info->player.receive_audio(); //TODO: Get audio info without skipping data frames + player_info->player.receive_audio(); // TODO: Get audio info without skipping data frames stream_info->stream_type = MediaType::AUDIO; stream_info->stream_details.audio.channels = player_info->player.last_channels; stream_info->stream_details.audio.sample_rate = player_info->player.last_sample_rate; @@ -417,9 +417,9 @@ EXPORT(bool, sceAvPlayerGetVideoData, SceUID player_handle, SceAvPlayerFrameInfo } else { buffer = get_buffer(player_info, MediaType::VIDEO, host.mem, H264DecoderState::buffer_size(size), false); } - //TODO: catch eof error and call - //uint32_t buf = SCE_AVPLAYER_ERROR_MAYBE_EOF; - //run_event_callback(host, thread_id, player_info, SCE_AVPLAYER_STATE_ERROR, 0, &buf); + // TODO: catch eof error and call + // uint32_t buf = SCE_AVPLAYER_ERROR_MAYBE_EOF; + // run_event_callback(host, thread_id, player_info, SCE_AVPLAYER_STATE_ERROR, 0, &buf); frame_info->timestamp = player_info->player.last_timestamp; frame_info->stream_details.video.width = size.width; diff --git a/vita3k/modules/SceKernelModulemgr/SceModulemgr.cpp b/vita3k/modules/SceKernelModulemgr/SceModulemgr.cpp index 3542467d3..bcc38f6ac 100644 --- a/vita3k/modules/SceKernelModulemgr/SceModulemgr.cpp +++ b/vita3k/modules/SceKernelModulemgr/SceModulemgr.cpp @@ -28,8 +28,8 @@ * \param mod_id UID of the loaded module object * \param entry_point Entry point (module_start) of the loaded module * \param module Module info - * \param host - * \param export_name + * \param host + * \param export_name * \param path File name of module file * \param error_val Error value on failure * \return True on success, false on failure diff --git a/vita3k/modules/SceKernelThreadMgr/SceThreadmgr.cpp b/vita3k/modules/SceKernelThreadMgr/SceThreadmgr.cpp index fbd53cbd5..b29fbbac3 100644 --- a/vita3k/modules/SceKernelThreadMgr/SceThreadmgr.cpp +++ b/vita3k/modules/SceKernelThreadMgr/SceThreadmgr.cpp @@ -152,7 +152,7 @@ EXPORT(SceInt32, _sceKernelGetCallbackInfo, SceUID callbackId, SceKernelCallback return RET_ERROR(SCE_KERNEL_ERROR_UNKNOWN_CALLBACK_ID); if (!pInfo) - return RET_ERROR(SCE_KERNEL_ERROR_ILLEGAL_ADDR); //TODO check result + return RET_ERROR(SCE_KERNEL_ERROR_ILLEGAL_ADDR); // TODO check result if (pInfo->size != sizeof(*pInfo)) return RET_ERROR(SCE_KERNEL_ERROR_INVALID_ARGUMENT_SIZE); @@ -250,7 +250,7 @@ EXPORT(int, _sceKernelGetLwMutexInfoById, SceUID lightweight_mutex_id, Ptrworkarea.get(host.mem)->owner; auto threads = host.kernel.threads; - if (threads[workarea_mutex_owner] == mutex->owner) { //something like optimisation + if (threads[workarea_mutex_owner] == mutex->owner) { // something like optimisation info_data->currentOwnerId = workarea_mutex_owner; } else { info_data->currentOwnerId = -1; @@ -711,7 +711,7 @@ unsigned process_callbacks(HostState &host, SceUID thread_id) { for (CallbackPtr &cb : thread->callbacks) { if (cb->is_executable()) { bool should_delete = cb->execute(); - if (should_delete) //TODO suppport callbacks deletion + if (should_delete) // TODO suppport callbacks deletion LOG_WARN("Callback with name {} requested to be deleted, but this is not supported yet!", cb->get_name()); num_callbacks_processed++; } @@ -807,14 +807,14 @@ int delay_thread(SceUInt delay_us) { } int delay_thread_cb(HostState &host, SceUID thread_id, SceUInt delay_us) { - auto start = std::chrono::high_resolution_clock::now(); //Meseaure the time taken to process callbacks + auto start = std::chrono::high_resolution_clock::now(); // Meseaure the time taken to process callbacks process_callbacks(host, thread_id); auto end = std::chrono::high_resolution_clock::now(); auto elapsed = std::chrono::duration_cast(end - start); - if (delay_us > elapsed.count()) //If we spent less time than requested processing callbacks, sleep the remaining time + if (delay_us > elapsed.count()) // If we spent less time than requested processing callbacks, sleep the remaining time return delay_thread(delay_us - elapsed.count()); - else //Else return directly + else // Else return directly return SCE_KERNEL_OK; } @@ -839,7 +839,7 @@ EXPORT(int, sceKernelDelayThreadCB200, SceUInt delay) { } EXPORT(int, sceKernelDeleteCallback) { - //TODO + // TODO return UNIMPLEMENTED(); } diff --git a/vita3k/modules/SceKernelThreadMgr/SceThreadmgrForDriver.cpp b/vita3k/modules/SceKernelThreadMgr/SceThreadmgrForDriver.cpp index 82193e9e0..f2fe93620 100644 --- a/vita3k/modules/SceKernelThreadMgr/SceThreadmgrForDriver.cpp +++ b/vita3k/modules/SceKernelThreadMgr/SceThreadmgrForDriver.cpp @@ -376,8 +376,8 @@ BRIDGE_IMPL(ksceKernelChangeCurrentThreadAttr) BRIDGE_IMPL(ksceKernelChangeThreadCpuAffinityMask) BRIDGE_IMPL(ksceKernelChangeThreadPriority) BRIDGE_IMPL(ksceKernelChangeThreadSuspendStatus) -//BRIDGE_IMPL(ksceKernelCheckCallback) -//BRIDGE_IMPL(ksceKernelCheckWaitableStatus) +// BRIDGE_IMPL(ksceKernelCheckCallback) +// BRIDGE_IMPL(ksceKernelCheckWaitableStatus) BRIDGE_IMPL(ksceKernelClearEvent) BRIDGE_IMPL(ksceKernelClearEventFlag) BRIDGE_IMPL(ksceKernelCreateCallback) @@ -388,8 +388,8 @@ BRIDGE_IMPL(ksceKernelCreateMutex) BRIDGE_IMPL(ksceKernelCreateSema) BRIDGE_IMPL(ksceKernelCreateSimpleEvent) BRIDGE_IMPL(ksceKernelCreateThread) -//BRIDGE_IMPL(ksceKernelDelayThread) -//BRIDGE_IMPL(ksceKernelDelayThreadCB) +// BRIDGE_IMPL(ksceKernelDelayThread) +// BRIDGE_IMPL(ksceKernelDelayThreadCB) BRIDGE_IMPL(ksceKernelDeleteCallback) BRIDGE_IMPL(ksceKernelDeleteCond) BRIDGE_IMPL(ksceKernelDeleteEventFlag) @@ -399,14 +399,14 @@ BRIDGE_IMPL(ksceKernelDeleteMutex) BRIDGE_IMPL(ksceKernelDeleteSema) BRIDGE_IMPL(ksceKernelDeleteThread) BRIDGE_IMPL(ksceKernelEnqueueWorkQueue) -//BRIDGE_IMPL(ksceKernelExitDeleteThread) -//BRIDGE_IMPL(ksceKernelExitThread) +// BRIDGE_IMPL(ksceKernelExitDeleteThread) +// BRIDGE_IMPL(ksceKernelExitThread) BRIDGE_IMPL(ksceKernelGetCallbackCount) BRIDGE_IMPL(ksceKernelGetMutexInfo) -//BRIDGE_IMPL(ksceKernelGetProcessId) +// BRIDGE_IMPL(ksceKernelGetProcessId) BRIDGE_IMPL(ksceKernelGetProcessIdFromTLS) BRIDGE_IMPL(ksceKernelGetSystemTimeLow) -//BRIDGE_IMPL(ksceKernelGetSystemTimeWide) +// BRIDGE_IMPL(ksceKernelGetSystemTimeWide) BRIDGE_IMPL(ksceKernelGetTLSAddr) BRIDGE_IMPL(ksceKernelGetThreadCpuAffinityMask) BRIDGE_IMPL(ksceKernelGetThreadCpuRegisters) @@ -457,7 +457,7 @@ BRIDGE_IMPL(ksceKernelUnlockReadRWLock) BRIDGE_IMPL(ksceKernelUnlockWriteRWLock) BRIDGE_IMPL(ksceKernelUnregisterCallbackFromEvent) BRIDGE_IMPL(ksceKernelUnregisterCallbackFromEventAll) -//BRIDGE_IMPL(ksceKernelUnregisterThreadEventHandler) +// BRIDGE_IMPL(ksceKernelUnregisterThreadEventHandler) BRIDGE_IMPL(ksceKernelWaitCond) BRIDGE_IMPL(ksceKernelWaitEvent) BRIDGE_IMPL(ksceKernelWaitEventCB) diff --git a/vita3k/modules/SceKernelThreadMgr/SceThreadmgrForDriver.h b/vita3k/modules/SceKernelThreadMgr/SceThreadmgrForDriver.h index c874f13cc..ad834ee4b 100644 --- a/vita3k/modules/SceKernelThreadMgr/SceThreadmgrForDriver.h +++ b/vita3k/modules/SceKernelThreadMgr/SceThreadmgrForDriver.h @@ -26,8 +26,8 @@ BRIDGE_DECL(ksceKernelChangeCurrentThreadAttr) BRIDGE_DECL(ksceKernelChangeThreadCpuAffinityMask) BRIDGE_DECL(ksceKernelChangeThreadPriority) BRIDGE_DECL(ksceKernelChangeThreadSuspendStatus) -//BRIDGE_DECL(ksceKernelCheckCallback) -//BRIDGE_DECL(ksceKernelCheckWaitableStatus) +// BRIDGE_DECL(ksceKernelCheckCallback) +// BRIDGE_DECL(ksceKernelCheckWaitableStatus) BRIDGE_DECL(ksceKernelClearEvent) BRIDGE_DECL(ksceKernelClearEventFlag) BRIDGE_DECL(ksceKernelCreateCallback) @@ -38,8 +38,8 @@ BRIDGE_DECL(ksceKernelCreateMutex) BRIDGE_DECL(ksceKernelCreateSema) BRIDGE_DECL(ksceKernelCreateSimpleEvent) BRIDGE_DECL(ksceKernelCreateThread) -//BRIDGE_DECL(ksceKernelDelayThread) -//BRIDGE_DECL(ksceKernelDelayThreadCB) +// BRIDGE_DECL(ksceKernelDelayThread) +// BRIDGE_DECL(ksceKernelDelayThreadCB) BRIDGE_DECL(ksceKernelDeleteCallback) BRIDGE_DECL(ksceKernelDeleteCond) BRIDGE_DECL(ksceKernelDeleteEventFlag) @@ -49,14 +49,14 @@ BRIDGE_DECL(ksceKernelDeleteMutex) BRIDGE_DECL(ksceKernelDeleteSema) BRIDGE_DECL(ksceKernelDeleteThread) BRIDGE_DECL(ksceKernelEnqueueWorkQueue) -//BRIDGE_DECL(ksceKernelExitDeleteThread) -//BRIDGE_DECL(ksceKernelExitThread) +// BRIDGE_DECL(ksceKernelExitDeleteThread) +// BRIDGE_DECL(ksceKernelExitThread) BRIDGE_DECL(ksceKernelGetCallbackCount) BRIDGE_DECL(ksceKernelGetMutexInfo) -//BRIDGE_DECL(ksceKernelGetProcessId) +// BRIDGE_DECL(ksceKernelGetProcessId) BRIDGE_DECL(ksceKernelGetProcessIdFromTLS) BRIDGE_DECL(ksceKernelGetSystemTimeLow) -//BRIDGE_DECL(ksceKernelGetSystemTimeWide) +// BRIDGE_DECL(ksceKernelGetSystemTimeWide) BRIDGE_DECL(ksceKernelGetTLSAddr) BRIDGE_DECL(ksceKernelGetThreadCpuAffinityMask) BRIDGE_DECL(ksceKernelGetThreadCpuRegisters) @@ -107,7 +107,7 @@ BRIDGE_DECL(ksceKernelUnlockReadRWLock) BRIDGE_DECL(ksceKernelUnlockWriteRWLock) BRIDGE_DECL(ksceKernelUnregisterCallbackFromEvent) BRIDGE_DECL(ksceKernelUnregisterCallbackFromEventAll) -//BRIDGE_DECL(ksceKernelUnregisterThreadEventHandler) +// BRIDGE_DECL(ksceKernelUnregisterThreadEventHandler) BRIDGE_DECL(ksceKernelWaitCond) BRIDGE_DECL(ksceKernelWaitEvent) BRIDGE_DECL(ksceKernelWaitEventCB) diff --git a/vita3k/modules/SceLibc/SceLibc.cpp b/vita3k/modules/SceLibc/SceLibc.cpp index 18b05584c..b4a20f6d8 100644 --- a/vita3k/modules/SceLibc/SceLibc.cpp +++ b/vita3k/modules/SceLibc/SceLibc.cpp @@ -183,9 +183,9 @@ EXPORT(int, __cxa_guard_release) { } EXPORT(void, __cxa_set_dso_handle_main, Ptr dso) { - //LOG_WARN("__cxa_set_dso_handle_main(dso=*0x%x)", dso); + // LOG_WARN("__cxa_set_dso_handle_main(dso=*0x%x)", dso); g_dso = dso; - //return UNIMPLEMENTED(); + // return UNIMPLEMENTED(); } EXPORT(int, __set_exidx_main) { diff --git a/vita3k/modules/SceProcessmgr/SceProcessmgr.cpp b/vita3k/modules/SceProcessmgr/SceProcessmgr.cpp index e571a6a02..1d7ec8792 100644 --- a/vita3k/modules/SceProcessmgr/SceProcessmgr.cpp +++ b/vita3k/modules/SceProcessmgr/SceProcessmgr.cpp @@ -205,7 +205,7 @@ EXPORT(int, sceKernelUnregisterProcessTerminationCallback) { } EXPORT(int, sceLibKernel_9F793F84) { - //Gets a version from the process' SceKernelProcessParam. Used for PSN Auth in SceShell. + // Gets a version from the process' SceKernelProcessParam. Used for PSN Auth in SceShell. auto p_process_param = CALL_EXPORT(sceKernelGetProcessParam, nullptr); auto process_param = p_process_param.get(host.mem); if (process_param && (process_param[1] == '2PSP') && (process_param[2] != 0)) { diff --git a/vita3k/ngs/include/ngs/dsp/playback_rate.h b/vita3k/ngs/include/ngs/dsp/playback_rate.h index be048763b..53b8f1e1f 100644 --- a/vita3k/ngs/include/ngs/dsp/playback_rate.h +++ b/vita3k/ngs/include/ngs/dsp/playback_rate.h @@ -33,9 +33,9 @@ namespace ngs::dsp::playback_rate { /** - * @brief Playback rate scaling settings to be passed to a playback rate - * scaling object - */ + * @brief Playback rate scaling settings to be passed to a playback rate + * scaling object + */ struct scaling_settings { // Scaling factor in a scale of 1 float scaling_factor = 1; @@ -48,8 +48,8 @@ struct scaling_settings { }; /** - * @brief Playback rate scaler abstraction class - */ + * @brief Playback rate scaler abstraction class + */ class Scaler { // Actual scaler object soundtouch::SoundTouch scaler; @@ -64,28 +64,28 @@ class Scaler { public: /** - * @brief Construct a new Scaler object - * - * @param settings Scaling settings - */ + * @brief Construct a new Scaler object + * + * @param settings Scaling settings + */ Scaler(ngs::dsp::playback_rate::scaling_settings *settings); /** - * @brief Take an audio input buffer and apply playback rate scaling according to - * the settings of the provided decoder. - * - * @param audio_input Floating-point PCM audio samples that need to be scaled - * @return The size in samples of the resulting audio buffer due to the scaling - * process - */ + * @brief Take an audio input buffer and apply playback rate scaling according to + * the settings of the provided decoder. + * + * @param audio_input Floating-point PCM audio samples that need to be scaled + * @return The size in samples of the resulting audio buffer due to the scaling + * process + */ unsigned int scale(std::vector *audio_input); /** - * @brief Get audio data resulting of the scaling process - * - * @param audio_output Pointer to a vector with enough size to fit the amount of samples - * specified in the return of `Scaler::scale()` - */ + * @brief Get audio data resulting of the scaling process + * + * @param audio_output Pointer to a vector with enough size to fit the amount of samples + * specified in the return of `Scaler::scale()` + */ int receive(std::vector *audio_output); }; diff --git a/vita3k/ngs/src/modules/atrac9.cpp b/vita3k/ngs/src/modules/atrac9.cpp index b639f9d47..c9d9402c8 100644 --- a/vita3k/ngs/src/modules/atrac9.cpp +++ b/vita3k/ngs/src/modules/atrac9.cpp @@ -100,7 +100,7 @@ bool Module::process(KernelState &kern, const MemState &mem, const SceUID thread data.invoke_callback(kern, mem, thread_id, SCE_NGS_AT9_CALLBACK_REASON_DONE_ALL, 0, 0); finished = true; // TODO: Free all occupied input routes - //unroute_occupied(mem, voice); + // unroute_occupied(mem, voice); } else { data.invoke_callback(kern, mem, thread_id, SCE_NGS_AT9_CALLBACK_REASON_DONE_ONE_BUFFER, prev_index, params->buffer_params[state->current_buffer].buffer.address()); @@ -183,7 +183,7 @@ bool Module::process(KernelState &kern, const MemState &mem, const SceUID thread data.extra_storage.resize(curr_pos + decoder->get_samples_per_superframe() * sizeof(float) * 2); if (decoder->send(input, decoder->get_superframe_size())) { - //convert from int16 to float + // convert from int16 to float uint32_t const channel_count = decoder->get_channel_count(); uint32_t const sample_rate = decoder->get(DecoderQuery::SAMPLE_RATE); std::vector temporary_bytes(decoder->get_samples_per_superframe() * sizeof(int16_t) * channel_count); diff --git a/vita3k/ngs/src/modules/player.cpp b/vita3k/ngs/src/modules/player.cpp index a84e14aa7..c90b61e3c 100644 --- a/vita3k/ngs/src/modules/player.cpp +++ b/vita3k/ngs/src/modules/player.cpp @@ -173,7 +173,7 @@ bool Module::process(KernelState &kern, const MemState &mem, const SceUID thread data.invoke_callback(kern, mem, thread_id, SCE_NGS_PLAYER_CALLBACK_REASON_DONE_ALL, 0, 0); finished = true; // TODO: Free all occupied input routes - //unroute_occupied(mem, voice); + // unroute_occupied(mem, voice); } else { data.invoke_callback(kern, mem, thread_id, SCE_NGS_PLAYER_CALLBACK_REASON_DONE_ONE_BUFFER, prev_index, params->buffer_params[state->current_buffer].buffer.address()); diff --git a/vita3k/np/include/np/functions.h b/vita3k/np/include/np/functions.h index 1c00688b6..f8841b317 100644 --- a/vita3k/np/include/np/functions.h +++ b/vita3k/np/include/np/functions.h @@ -42,13 +42,13 @@ bool deinit(NpTrophyState &state); /** * \brief Create a new trophy context. - * + * * Only one context per 1 communication ID. - * + * * \param np NP state. * \param io IO state. * \param custom_comm Custom communication ID. If this is null, the one passed in NP initialization will be used. - * + * * \returns uint32_t(-1) on failure, else the handle to the context. */ np::trophy::ContextHandle create_trophy_context(NpState &np, IOState *io, const std::wstring &pref_path, diff --git a/vita3k/renderer/include/renderer/commands.h b/vita3k/renderer/include/renderer/commands.h index e4a580194..770b7b319 100644 --- a/vita3k/renderer/include/renderer/commands.h +++ b/vita3k/renderer/include/renderer/commands.h @@ -25,8 +25,8 @@ #include namespace renderer { -#define REPORT_MISSING(backend) //LOG_ERROR("Unimplemented graphics API handler with backend {}", (int)backend) -#define REPORT_STUBBED() //LOG_INFO("Stubbed") +#define REPORT_MISSING(backend) // LOG_ERROR("Unimplemented graphics API handler with backend {}", (int)backend) +#define REPORT_STUBBED() // LOG_INFO("Stubbed") struct Command; @@ -42,26 +42,26 @@ enum class CommandOpcode : std::uint8_t { CreateRenderTarget = 1, /** - * Do draw. - */ + * Do draw. + */ Draw = 2, /** - * This is like a NOP. It only signals back to client. - */ + * This is like a NOP. It only signals back to client. + */ Nop = 3, /** - * Set a GXM state. - */ + * Set a GXM state. + */ SetState = 4, SetContext = 5, SyncSurfaceData = 6, /** - * Signal sync object that fragment has been done. - */ + * Signal sync object that fragment has been done. + */ SignalSyncObject = 9, SignalNotification = 10, diff --git a/vita3k/renderer/include/renderer/functions.h b/vita3k/renderer/include/renderer/functions.h index 9ee500d94..75ea74738 100644 --- a/vita3k/renderer/include/renderer/functions.h +++ b/vita3k/renderer/include/renderer/functions.h @@ -44,7 +44,7 @@ void wishlist(SceGxmSyncObject *sync_object, const SyncObjectSubject subjects); /** * \brief Set list of subject with sync object to done. - * + * * This will also signals wishlists that are waiting. */ void subject_done(SceGxmSyncObject *sync_object, const SyncObjectSubject subjects); @@ -151,9 +151,9 @@ const uint32_t *get_texture_palette(const SceGxmTexture &texture, const MemState /** * \brief Decompresses all the blocks of a DXT compressed texture and stores the resulting pixels in 'image'. - * + * * Output results is in format RGBA, with each channel being 8 bits. - * + * * \param width Texture width. * \param height Texture height. * \param block_storage Pointer to compressed DXT1 blocks. diff --git a/vita3k/renderer/include/renderer/pvrt-dec.h b/vita3k/renderer/include/renderer/pvrt-dec.h index cc629a83b..5c4a26827 100644 --- a/vita3k/renderer/include/renderer/pvrt-dec.h +++ b/vita3k/renderer/include/renderer/pvrt-dec.h @@ -1,28 +1,28 @@ /* PowerVR SDK license: */ /* ----------------------------------------------- -* POWERVR SDK SOFTWARE END USER LICENSE AGREEMENT -* ----------------------------------------------- -* The MIT License (MIT) -* Copyright (c) Imagination Technologies Ltd. -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -*/ + * POWERVR SDK SOFTWARE END USER LICENSE AGREEMENT + * ----------------------------------------------- + * The MIT License (MIT) + * Copyright (c) Imagination Technologies Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ /*! \brief Contains functions to decompress PVRTC or ETC formats into RGBA8888. diff --git a/vita3k/renderer/src/gl/texture.cpp b/vita3k/renderer/src/gl/texture.cpp index c3c99f1c0..4dd51baa6 100644 --- a/vita3k/renderer/src/gl/texture.cpp +++ b/vita3k/renderer/src/gl/texture.cpp @@ -147,13 +147,13 @@ void configure_bound_texture(const SceGxmTexture &gxm_texture) { /** * \brief Try to decompress texture to 32-bit RGBA. - * + * * \param fmt Texture base format. * \param dest Destination texture data. Size must be sufficient enough of align(width, 4) * height * 4 (bytes). * \param data Source data to decompress. * \param width Texture width. * \param height Texture height. - * + * * \return Size of source taken. */ static size_t decompress_compressed_swizz_texture(SceGxmTextureBaseFormat fmt, void *dest, const void *data, const std::uint32_t width, const std::uint32_t height) { diff --git a/vita3k/renderer/src/pvrt-dec.cpp b/vita3k/renderer/src/pvrt-dec.cpp index a1b5dd39d..432c6c71e 100644 --- a/vita3k/renderer/src/pvrt-dec.cpp +++ b/vita3k/renderer/src/pvrt-dec.cpp @@ -1,28 +1,28 @@ /* PowerVR SDK license: */ /* ----------------------------------------------- -* POWERVR SDK SOFTWARE END USER LICENSE AGREEMENT -* ----------------------------------------------- -* The MIT License (MIT) -* Copyright (c) Imagination Technologies Ltd. -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -*/ + * POWERVR SDK SOFTWARE END USER LICENSE AGREEMENT + * ----------------------------------------------- + * The MIT License (MIT) + * Copyright (c) Imagination Technologies Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ /*! \brief Implementation of the Texture Decompression functions. diff --git a/vita3k/renderer/src/state_set.cpp b/vita3k/renderer/src/state_set.cpp index 7cf62af8b..231f3ad0a 100644 --- a/vita3k/renderer/src/state_set.cpp +++ b/vita3k/renderer/src/state_set.cpp @@ -415,7 +415,7 @@ COMMAND(handle_set_state) { auto result = handlers.find(gxm_state_to_set); if (result != handlers.end()) { - //LOG_TRACE("State set: {}", (int)gxm_state_to_set); + // LOG_TRACE("State set: {}", (int)gxm_state_to_set); result->second(renderer, mem, config, helper, render_context, base_path, title_id); } } diff --git a/vita3k/renderer/src/texture_format.cpp b/vita3k/renderer/src/texture_format.cpp index 48f9eeae3..20927f851 100644 --- a/vita3k/renderer/src/texture_format.cpp +++ b/vita3k/renderer/src/texture_format.cpp @@ -214,7 +214,7 @@ bool is_compressed_format(SceGxmTextureBaseFormat base_format, std::uint32_t wid /** * \brief Helper method that packs RGBA channels into a single 4 byte pixel, but reversed for little endian. - * + * * \param r red channel. * \param g green channel. * \param b blue channel. @@ -227,7 +227,7 @@ static std::uint32_t pack_rgba_reversed(std::uint8_t r, std::uint8_t g, std::uin /** * \brief Decompresses one block of a DXT1 texture and stores the resulting pixels at the appropriate offset in 'image', * with custom alpha table. - * + * * \param x x-coordinate of the first pixel in the block. * \param y y-coordinate of the first pixel in the block. * \param width width of the texture being decompressed. @@ -321,7 +321,7 @@ static void decompress_block_dxt1(std::uint32_t x, std::uint32_t y, std::uint32_ /** * \brief Decompresses one block of a DXT3 texture and stores the resulting pixels at the appropriate offset in 'image'. - * + * * \param x x-coordinate of the first pixel in the block. * \param y y-coordinate of the first pixel in the block. * \param width width of the texture being decompressed. @@ -348,7 +348,7 @@ static void decompress_block_dxt3(std::uint32_t x, std::uint32_t y, std::uint32_ /** * \brief Decompresses one block of a DXT5 texture and stores the resulting pixels at the appropriate offset in 'image'. - * + * * \param x x-coordinate of the first pixel in the block. * \param y y-coordinate of the first pixel in the block. * \param width width of the texture being decompressed. @@ -441,9 +441,9 @@ static void decompress_block_dxt5(std::uint32_t x, std::uint32_t y, std::uint32_ /** * \brief Decompresses all the blocks of a DXT compressed texture and stores the resulting pixels in 'image'. - * + * * Output results is in format RGBA, with each channel being 8 bits. - * + * * \param width Texture width. * \param height Texture height. * \param block_storage Pointer to compressed DXT1 blocks. diff --git a/vita3k/shader/include/shader/usse_program_analyzer.h b/vita3k/shader/include/shader/usse_program_analyzer.h index c72b628ed..63343cecb 100644 --- a/vita3k/shader/include/shader/usse_program_analyzer.h +++ b/vita3k/shader/include/shader/usse_program_analyzer.h @@ -35,14 +35,14 @@ struct SceGxmProgram; namespace shader::usse { /** * \brief Check if an instruction is a branch. - * + * * If the instruction is a branch, the passed references will be set * with the predicate and branch offset. - * + * * \param inst Instruction. * \param pred Reference to the value which will contains predicate. * \param br_off Reference to the value which will contains branch offset. - * + * * \returns True on instruction being a branch. */ bool is_kill(const std::uint64_t inst); diff --git a/vita3k/shader/include/shader/usse_translator.h b/vita3k/shader/include/shader/usse_translator.h index 5a86cd296..a984a5416 100644 --- a/vita3k/shader/include/shader/usse_translator.h +++ b/vita3k/shader/include/shader/usse_translator.h @@ -119,7 +119,7 @@ public: * write/dest mask * * \returns A copy of given operand - */ + */ spv::Id load(Operand op, const Imm4 dest_mask, int shift_offset = 0); void reset_for_new_session() { diff --git a/vita3k/shader/src/spirv_recompiler.cpp b/vita3k/shader/src/spirv_recompiler.cpp index 4374b0d84..17ae338d3 100644 --- a/vita3k/shader/src/spirv_recompiler.cpp +++ b/vita3k/shader/src/spirv_recompiler.cpp @@ -438,8 +438,8 @@ static void create_fragment_inputs(spv::Builder &b, SpirvShaderParameters ¶m do_coord = true; } else if (input_id == 0xD000) { // Not sure, comment out for now - //input_id = 10; - //do_coord = true; + // input_id = 10; + // do_coord = true; } if (do_coord) { @@ -501,7 +501,7 @@ static void create_fragment_inputs(spv::Builder &b, SpirvShaderParameters ¶m break; } case 1: { - //Maybe char? + // Maybe char? LOG_WARN("Unsupported texture component: {}", component_type); break; } @@ -1152,16 +1152,16 @@ static spv::Function *make_vert_finalize_function(spv::Builder &b, const SpirvSh add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_TEXCOORD8, "v_TexCoord8", calculate_copy_comp_count(coord_infos[8]), 12); add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_TEXCOORD9, "v_TexCoord9", calculate_copy_comp_count(coord_infos[9]), 13); // TODO: this should be translated to gl_PointSize - //add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_PSIZE, "v_Psize", 1); + // add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_PSIZE, "v_Psize", 1); // TODO: these should be translated to gl_ClipDistance - //add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_CLIP0, "v_Clip0", 1); - //add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_CLIP1, "v_Clip1", 1); - //add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_CLIP2, "v_Clip2", 1); - //add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_CLIP3, "v_Clip3", 1); - //add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_CLIP4, "v_Clip4", 1); - //add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_CLIP5, "v_Clip5", 1); - //add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_CLIP6, "v_Clip6", 1); - //add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_CLIP7, "v_Clip7", 1); + // add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_CLIP0, "v_Clip0", 1); + // add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_CLIP1, "v_Clip1", 1); + // add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_CLIP2, "v_Clip2", 1); + // add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_CLIP3, "v_Clip3", 1); + // add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_CLIP4, "v_Clip4", 1); + // add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_CLIP5, "v_Clip5", 1); + // add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_CLIP6, "v_Clip6", 1); + // add_vertex_output_info(SCE_GXM_VERTEX_PROGRAM_OUTPUT_CLIP7, "v_Clip7", 1); Operand o_op; o_op.bank = RegisterBank::OUTPUT; @@ -1445,7 +1445,7 @@ static std::string convert_spirv_to_glsl(const std::string &shader_name, SpirvCo options.enable_420pack_extension = true; // TODO: this might be needed in the future - //options.vertex.flip_vert_y = true; + // options.vertex.flip_vert_y = true; glsl.set_common_options(options); glsl.add_header_line("// Shader Name: " + shader_name); diff --git a/vita3k/shader/src/translator/ialu.cpp b/vita3k/shader/src/translator/ialu.cpp index 62553c9f7..27b946604 100644 --- a/vita3k/shader/src/translator/ialu.cpp +++ b/vita3k/shader/src/translator/ialu.cpp @@ -115,9 +115,9 @@ bool USSETranslatorVisitor::vbw( case Opcode::SHR: operation = spv::Op::OpShiftRightLogical; break; default: return false; } - //optimisation. (any OR 0 || any XOR 0 || any AND 0xFFFFFFFF) -> assign + // optimisation. (any OR 0 || any XOR 0 || any AND 0xFFFFFFFF) -> assign bool is_const = m_b.getOpCode(src2) == spv::Op::OpConstant; - auto const_val = is_const ? m_b.getConstantScalar(src2) : 1; //default value is intentionally non zero + auto const_val = is_const ? m_b.getConstantScalar(src2) : 1; // default value is intentionally non zero if ((operation == spv::Op::OpBitwiseOr || operation == spv::Op::OpBitwiseXor) && is_const && const_val == 0 || operation == spv::Op::OpBitwiseAnd && is_const && const_val == std::numeric_limits::max()) { inst.opr.src1.type = DataType::F32; diff --git a/vita3k/shader/src/translator/texture.cpp b/vita3k/shader/src/translator/texture.cpp index de4e510db..69f0ccf44 100644 --- a/vita3k/shader/src/translator/texture.cpp +++ b/vita3k/shader/src/translator/texture.cpp @@ -214,7 +214,7 @@ bool USSETranslatorVisitor::smp( break; case 3: { // TODO: figure out what to fill here - //store(inst.opr.dest, stub, 0b1111); + // store(inst.opr.dest, stub, 0b1111); store(inst.opr.dest, result, 0b1111); break; } diff --git a/vita3k/shader/src/usse_decode_helpers.cpp b/vita3k/shader/src/usse_decode_helpers.cpp index 5991a5b04..0cf2a9083 100644 --- a/vita3k/shader/src/usse_decode_helpers.cpp +++ b/vita3k/shader/src/usse_decode_helpers.cpp @@ -68,11 +68,8 @@ static void double_reg(usse::OperandNum ®, RegisterBank reg_bank) { // Operand bank decoding static RegisterBank decode_dest_bank(Imm2 dest_bank, bool bank_ext) { - if (dest_bank == 3) - return RegisterBank::INDEXED1; - else - // TODO: Index stuff - if (bank_ext) + // TODO: Index stuff + if (bank_ext) switch (dest_bank) { case 0: return RegisterBank::SECATTR; case 1: return RegisterBank::SPECIAL; diff --git a/vita3k/util/include/util/byte_ring_buffer.h b/vita3k/util/include/util/byte_ring_buffer.h index 5101fe97e..74b73a06a 100644 --- a/vita3k/util/include/util/byte_ring_buffer.h +++ b/vita3k/util/include/util/byte_ring_buffer.h @@ -6,7 +6,7 @@ #include -//Ring buffer for bytes - not multi-thread safe, bring your own locks +// Ring buffer for bytes - not multi-thread safe, bring your own locks class ByteRingBuffer { public: ByteRingBuffer(std::size_t size) @@ -26,16 +26,16 @@ public: return 0; } - const std::size_t insertSize = std::min(size, Free()); //Biggest we can insert in buffer - if (start <= end) { //There is space between 'end' and buffer end, and potentially between 0 and 'start' - const std::size_t bufEndInsertSize = std::min(capacity - end, insertSize); //Size of data to put between 'end' and buffer end - const std::size_t bufStartInsertSize = std::min(start, insertSize - bufEndInsertSize); //Size of data to put between 0 and start + const std::size_t insertSize = std::min(size, Free()); // Biggest we can insert in buffer + if (start <= end) { // There is space between 'end' and buffer end, and potentially between 0 and 'start' + const std::size_t bufEndInsertSize = std::min(capacity - end, insertSize); // Size of data to put between 'end' and buffer end + const std::size_t bufStartInsertSize = std::min(start, insertSize - bufEndInsertSize); // Size of data to put between 0 and start assert((bufEndInsertSize + bufStartInsertSize) == insertSize); memcpy(&buffer[end], static_cast(in), bufEndInsertSize); memcpy(&buffer[0], static_cast(in) + bufEndInsertSize, bufStartInsertSize); - } else { //There is space between 'end' and 'start' + } else { // There is space between 'end' and 'start' memcpy(&buffer[end], static_cast(in), insertSize); } @@ -45,7 +45,7 @@ public: } std::size_t Remove(void *out, std::size_t size) { - std::size_t removed = Peek(out, size); //If empty, Peek should copy 0 + std::size_t removed = Peek(out, size); // If empty, Peek should copy 0 start = (start + removed) % capacity; used -= removed; return removed; @@ -57,11 +57,11 @@ public: } const std::size_t extractSize = std::min(size, Used()); - if (start < end) { //Data between 'start' and 'end'-1 + if (start < end) { // Data between 'start' and 'end'-1 memcpy(out, &buffer[start], extractSize); - } else { //Data between 'start' and buffer end, and potentially between 0 and 'end'-1 - const std::size_t bufTailSize = std::min(capacity - start, extractSize); //Size of stuff to copy between 'start' and buffer end - const std::size_t bufHeadSize = std::min(end, extractSize - bufTailSize); //Size of stuff to copy at buffer start + } else { // Data between 'start' and buffer end, and potentially between 0 and 'end'-1 + const std::size_t bufTailSize = std::min(capacity - start, extractSize); // Size of stuff to copy between 'start' and buffer end + const std::size_t bufHeadSize = std::min(end, extractSize - bufTailSize); // Size of stuff to copy at buffer start assert((bufTailSize + bufHeadSize) == extractSize); memcpy(out, &buffer[start], bufTailSize); @@ -74,7 +74,7 @@ private: std::unique_ptr buffer; const std::size_t capacity; - //buffer[start] -> buffer[end - 1] is used + // buffer[start] -> buffer[end - 1] is used std::size_t start = 0; std::size_t end = 0; std::size_t used = 0; diff --git a/vita3k/util/include/util/bytes.h b/vita3k/util/include/util/bytes.h index 1ce9619dd..98ce78aff 100644 --- a/vita3k/util/include/util/bytes.h +++ b/vita3k/util/include/util/bytes.h @@ -30,7 +30,7 @@ enum EndianType { /** * \brief Get system endian type. - * + * * Can be use at both compile-time and run-time. Only supports little and big endian. */ constexpr EndianType get_system_endian_type() { diff --git a/vita3k/util/include/util/float_to_half.h b/vita3k/util/include/util/float_to_half.h index cb772cfca..bd45f04c2 100644 --- a/vita3k/util/include/util/float_to_half.h +++ b/vita3k/util/include/util/float_to_half.h @@ -15,8 +15,8 @@ // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -//original source:https://stackoverflow.com/questions/1659440/32-bit-to-16-bit-floating-point-conversion -//public domain +// original source:https://stackoverflow.com/questions/1659440/32-bit-to-16-bit-floating-point-conversion +// public domain #include // CHAR_BIT #include // uint32_t, uint64_t, etc. @@ -77,7 +77,7 @@ struct raw_float_type_info { using raw_flt16_type_info = raw_float_type_info; using raw_flt32_type_info = raw_float_type_info; using raw_flt64_type_info = raw_float_type_info; -//using raw_flt128_type_info = raw_float_type_info< uint128_t, 112, 15 >; +// using raw_flt128_type_info = raw_float_type_info< uint128_t, 112, 15 >; template ::digits - 1, int EXP_BITS = sizeof(T) * CHAR_BIT - SIG_BITS - 1> @@ -123,13 +123,13 @@ struct raw_float_encoder { bits = std::bit_cast(norm); bits += (bits >> sig_diff) & 1; // add tie breaking bias bits += (raw_type(1) << (sig_diff - 1)) - 1; // round up to half - //if( is_sub ) bits = std::bit_cast< raw_type >( subn ); + // if( is_sub ) bits = std::bit_cast< raw_type >( subn ); bits ^= -is_sub & (std::bit_cast(subn) ^ bits); } bits >>= sig_diff; // truncate - //if( enc::inf < bits ) bits = enc::inf; // fix overflow + // if( enc::inf < bits ) bits = enc::inf; // fix overflow bits ^= -(enc::inf < bits) & (enc::inf ^ bits); - //if( is_nan ) bits = enc::qnan; + // if( is_nan ) bits = enc::qnan; bits ^= -is_nan & (enc::qnan ^ bits); bits |= sign >> bit_diff; // restore sign return enc_type(bits); @@ -149,7 +149,7 @@ struct raw_float_encoder { bits = (sign << bit_diff) | (bits << sig_diff); auto val = std::bit_cast(bits) * std::bit_cast(bias_mul); bits = std::bit_cast(val); - //if( !is_norm ) bits |= flt::inf; + // if( !is_norm ) bits |= flt::inf; bits |= -!is_norm & flt::inf; return std::bit_cast(bits); } diff --git a/vita3k/util/include/util/fs.h b/vita3k/util/include/util/fs.h index 46ec6bfb1..96e564b6c 100644 --- a/vita3k/util/include/util/fs.h +++ b/vita3k/util/include/util/fs.h @@ -54,13 +54,13 @@ public: namespace fs_utils { /** - * \brief Construct a file name (optionally with an extension) to be placed in a Vita3K directory. - * \param base_path The main output path for the file. - * \param folder_path The sub-directory/sub-directories to output to. - * \param file_name The name of the file. - * \param extension The extension of the file (optional) - * \return A complete Boost.Filesystem file path normalized. - */ + * \brief Construct a file name (optionally with an extension) to be placed in a Vita3K directory. + * \param base_path The main output path for the file. + * \param folder_path The sub-directory/sub-directories to output to. + * \param file_name The name of the file. + * \param extension The extension of the file (optional) + * \return A complete Boost.Filesystem file path normalized. + */ inline fs::path construct_file_name(const fs::path &base_path, const fs::path &folder_path, const fs::path &file_name, const fs::path &extension = "") { fs::path full_file_path{ base_path / folder_path / file_name }; if (!extension.empty()) diff --git a/vita3k/util/include/util/function_info.h b/vita3k/util/include/util/function_info.h index 5c0354853..e256fb9a3 100644 --- a/vita3k/util/include/util/function_info.h +++ b/vita3k/util/include/util/function_info.h @@ -17,10 +17,10 @@ template struct FunctionInfo : public FunctionInfo {}; /** -* Partial specialization for function types. -* -* This is used as the supporting base for all other specializations. -*/ + * Partial specialization for function types. + * + * This is used as the supporting base for all other specializations. + */ template struct FunctionInfo { static constexpr size_t args_count = sizeof...(Args); diff --git a/vita3k/util/include/util/vector_utils.h b/vita3k/util/include/util/vector_utils.h index 35231864d..cd8a0dd44 100644 --- a/vita3k/util/include/util/vector_utils.h +++ b/vita3k/util/include/util/vector_utils.h @@ -23,12 +23,12 @@ namespace vector_utils { /** - * \brief Merges and sorts two vectors. Also eliminates duplicates. - * Optimal based on: http://stackoverflow.com/a/24477023 - * \param cur The current vector. - * \param append The new vector to append. Always assume to be smaller than cur. - * \return A vector of the same type as the inputs. - */ + * \brief Merges and sorts two vectors. Also eliminates duplicates. + * Optimal based on: http://stackoverflow.com/a/24477023 + * \param cur The current vector. + * \param append The new vector to append. Always assume to be smaller than cur. + * \return A vector of the same type as the inputs. + */ template , typename H = std::hash, typename P = std::equal_to> std::vector merge_vectors(const std::vector &cur, const std::vector &append) { std::vector new_vector = cur; diff --git a/vita3k/util/src/instrset_detect.cpp b/vita3k/util/src/instrset_detect.cpp index 38a272d48..3a8da962d 100644 --- a/vita3k/util/src/instrset_detect.cpp +++ b/vita3k/util/src/instrset_detect.cpp @@ -1,17 +1,17 @@ /************************** instrset_detect.cpp **************************** -* Author: Agner Fog -* Date created: 2012-05-30 -* Last modified: 2019-08-01 -* Version: 2.00.00 -* Project: vector class library -* Description: -* Functions for checking which instruction sets are supported. -* -* (c) Copyright 2012-2019 Agner Fog. -* Apache License version 2.0 or later. -******************************************************************************/ + * Author: Agner Fog + * Date created: 2012-05-30 + * Last modified: 2019-08-01 + * Version: 2.00.00 + * Project: vector class library + * Description: + * Functions for checking which instruction sets are supported. + * + * (c) Copyright 2012-2019 Agner Fog. + * Apache License version 2.0 or later. + ******************************************************************************/ -//some code from instrset.h was also added and +// some code from instrset.h was also added and #include // Header files for non-vector intrinsic functions including _BitScanReverse(int), __cpuid(int[4],int), _xgetbv(int) diff --git a/vita3k/util/src/util.cpp b/vita3k/util/src/util.cpp index 1d62cb4d9..1e6b03e6d 100644 --- a/vita3k/util/src/util.cpp +++ b/vita3k/util/src/util.cpp @@ -286,9 +286,9 @@ void float_to_half_AVX_F16C(const float *src, std::uint16_t *dest, const int tot #endif #if (defined(__AVX__) && defined(__F16C__)) || defined(__AVX2__) -//forced use AVX+F16C instruction set -//AVX2 checked intentionally cause MSVC does not have __F16C__ macros -//and checking AVX is not enough for some CPU architectures (Intel Sandy bridge) +// forced use AVX+F16C instruction set +// AVX2 checked intentionally cause MSVC does not have __F16C__ macros +// and checking AVX is not enough for some CPU architectures (Intel Sandy bridge) void float_to_half(const float *src, std::uint16_t *dest, const int total) { float_to_half_AVX_F16C(src, dest, total); } @@ -300,7 +300,7 @@ void float_to_half_basic(const float *src, std::uint16_t *dest, const int total) } } #if defined(_MSC_VER) -//check and use AVX+F16C instruction set if possible +// check and use AVX+F16C instruction set if possible // use function variable as imitation of self-modifying code. // on first use we check processor features and set appropriate realisation, later we immediately use appropriate realisation