diff options
Diffstat (limited to 'src/common')
34 files changed, 213 insertions, 112 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index d574e4b79..a6dc31b53 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2018 yuzu Emulator Project | ||
| 2 | # SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 1 | if (DEFINED ENV{AZURECIREPO}) | 4 | if (DEFINED ENV{AZURECIREPO}) |
| 2 | set(BUILD_REPOSITORY $ENV{AZURECIREPO}) | 5 | set(BUILD_REPOSITORY $ENV{AZURECIREPO}) |
| 3 | endif() | 6 | endif() |
| @@ -41,6 +44,7 @@ add_custom_command(OUTPUT scm_rev.cpp | |||
| 41 | add_library(common STATIC | 44 | add_library(common STATIC |
| 42 | algorithm.h | 45 | algorithm.h |
| 43 | alignment.h | 46 | alignment.h |
| 47 | announce_multiplayer_room.h | ||
| 44 | assert.cpp | 48 | assert.cpp |
| 45 | assert.h | 49 | assert.h |
| 46 | atomic_helpers.h | 50 | atomic_helpers.h |
diff --git a/src/common/alignment.h b/src/common/alignment.h index 8570c7d3c..7e897334b 100644 --- a/src/common/alignment.h +++ b/src/common/alignment.h | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | // This file is under the public domain. | 1 | // SPDX-FileCopyrightText: 2014 Jannik Vogel <email@jannikvogel.de> |
| 2 | // SPDX-License-Identifier: CC0-1.0 | ||
| 2 | 3 | ||
| 3 | #pragma once | 4 | #pragma once |
| 4 | 5 | ||
diff --git a/src/common/announce_multiplayer_room.h b/src/common/announce_multiplayer_room.h new file mode 100644 index 000000000..0ad9da2be --- /dev/null +++ b/src/common/announce_multiplayer_room.h | |||
| @@ -0,0 +1,143 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include <array> | ||
| 7 | #include <functional> | ||
| 8 | #include <string> | ||
| 9 | #include <vector> | ||
| 10 | #include "common/common_types.h" | ||
| 11 | #include "web_service/web_result.h" | ||
| 12 | |||
| 13 | namespace AnnounceMultiplayerRoom { | ||
| 14 | |||
| 15 | using MacAddress = std::array<u8, 6>; | ||
| 16 | |||
| 17 | struct GameInfo { | ||
| 18 | std::string name{""}; | ||
| 19 | u64 id{0}; | ||
| 20 | }; | ||
| 21 | |||
| 22 | struct Member { | ||
| 23 | std::string username; | ||
| 24 | std::string nickname; | ||
| 25 | std::string display_name; | ||
| 26 | std::string avatar_url; | ||
| 27 | MacAddress mac_address; | ||
| 28 | GameInfo game; | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct RoomInformation { | ||
| 32 | std::string name; ///< Name of the server | ||
| 33 | std::string description; ///< Server description | ||
| 34 | u32 member_slots; ///< Maximum number of members in this room | ||
| 35 | u16 port; ///< The port of this room | ||
| 36 | GameInfo preferred_game; ///< Game to advertise that you want to play | ||
| 37 | std::string host_username; ///< Forum username of the host | ||
| 38 | bool enable_yuzu_mods; ///< Allow yuzu Moderators to moderate on this room | ||
| 39 | }; | ||
| 40 | |||
| 41 | struct Room { | ||
| 42 | RoomInformation information; | ||
| 43 | |||
| 44 | std::string id; | ||
| 45 | std::string verify_uid; ///< UID used for verification | ||
| 46 | std::string ip; | ||
| 47 | u32 net_version; | ||
| 48 | bool has_password; | ||
| 49 | |||
| 50 | std::vector<Member> members; | ||
| 51 | }; | ||
| 52 | using RoomList = std::vector<Room>; | ||
| 53 | |||
| 54 | /** | ||
| 55 | * A AnnounceMultiplayerRoom interface class. A backend to submit/get to/from a web service should | ||
| 56 | * implement this interface. | ||
| 57 | */ | ||
| 58 | class Backend { | ||
| 59 | public: | ||
| 60 | virtual ~Backend() = default; | ||
| 61 | |||
| 62 | /** | ||
| 63 | * Sets the Information that gets used for the announce | ||
| 64 | * @param uid The Id of the room | ||
| 65 | * @param name The name of the room | ||
| 66 | * @param description The room description | ||
| 67 | * @param port The port of the room | ||
| 68 | * @param net_version The version of the libNetwork that gets used | ||
| 69 | * @param has_password True if the room is passowrd protected | ||
| 70 | * @param preferred_game The preferred game of the room | ||
| 71 | * @param preferred_game_id The title id of the preferred game | ||
| 72 | */ | ||
| 73 | virtual void SetRoomInformation(const std::string& name, const std::string& description, | ||
| 74 | const u16 port, const u32 max_player, const u32 net_version, | ||
| 75 | const bool has_password, const GameInfo& preferred_game) = 0; | ||
| 76 | /** | ||
| 77 | * Adds a player information to the data that gets announced | ||
| 78 | * @param nickname The nickname of the player | ||
| 79 | * @param mac_address The MAC Address of the player | ||
| 80 | * @param game_id The title id of the game the player plays | ||
| 81 | * @param game_name The name of the game the player plays | ||
| 82 | */ | ||
| 83 | virtual void AddPlayer(const Member& member) = 0; | ||
| 84 | |||
| 85 | /** | ||
| 86 | * Updates the data in the announce service. Re-register the room when required. | ||
| 87 | * @result The result of the update attempt | ||
| 88 | */ | ||
| 89 | virtual WebService::WebResult Update() = 0; | ||
| 90 | |||
| 91 | /** | ||
| 92 | * Registers the data in the announce service | ||
| 93 | * @result The result of the register attempt. When the result code is Success, A global Guid of | ||
| 94 | * the room which may be used for verification will be in the result's returned_data. | ||
| 95 | */ | ||
| 96 | virtual WebService::WebResult Register() = 0; | ||
| 97 | |||
| 98 | /** | ||
| 99 | * Empties the stored players | ||
| 100 | */ | ||
| 101 | virtual void ClearPlayers() = 0; | ||
| 102 | |||
| 103 | /** | ||
| 104 | * Get the room information from the announce service | ||
| 105 | * @result A list of all rooms the announce service has | ||
| 106 | */ | ||
| 107 | virtual RoomList GetRoomList() = 0; | ||
| 108 | |||
| 109 | /** | ||
| 110 | * Sends a delete message to the announce service | ||
| 111 | */ | ||
| 112 | virtual void Delete() = 0; | ||
| 113 | }; | ||
| 114 | |||
| 115 | /** | ||
| 116 | * Empty implementation of AnnounceMultiplayerRoom interface that drops all data. Used when a | ||
| 117 | * functional backend implementation is not available. | ||
| 118 | */ | ||
| 119 | class NullBackend : public Backend { | ||
| 120 | public: | ||
| 121 | ~NullBackend() = default; | ||
| 122 | void SetRoomInformation(const std::string& /*name*/, const std::string& /*description*/, | ||
| 123 | const u16 /*port*/, const u32 /*max_player*/, const u32 /*net_version*/, | ||
| 124 | const bool /*has_password*/, | ||
| 125 | const GameInfo& /*preferred_game*/) override {} | ||
| 126 | void AddPlayer(const Member& /*member*/) override {} | ||
| 127 | WebService::WebResult Update() override { | ||
| 128 | return WebService::WebResult{WebService::WebResult::Code::NoWebservice, | ||
| 129 | "WebService is missing", ""}; | ||
| 130 | } | ||
| 131 | WebService::WebResult Register() override { | ||
| 132 | return WebService::WebResult{WebService::WebResult::Code::NoWebservice, | ||
| 133 | "WebService is missing", ""}; | ||
| 134 | } | ||
| 135 | void ClearPlayers() override {} | ||
| 136 | RoomList GetRoomList() override { | ||
| 137 | return RoomList{}; | ||
| 138 | } | ||
| 139 | |||
| 140 | void Delete() override {} | ||
| 141 | }; | ||
| 142 | |||
| 143 | } // namespace AnnounceMultiplayerRoom | ||
diff --git a/src/common/atomic_helpers.h b/src/common/atomic_helpers.h index 6d912b52e..bef5015c1 100644 --- a/src/common/atomic_helpers.h +++ b/src/common/atomic_helpers.h | |||
| @@ -1,4 +1,7 @@ | |||
| 1 | // ©2013-2016 Cameron Desrochers. | 1 | // SPDX-FileCopyrightText: 2013-2016 Cameron Desrochers |
| 2 | // SPDX-FileCopyrightText: 2015 Jeff Preshing | ||
| 3 | // SPDX-License-Identifier: BSD-2-Clause AND Zlib | ||
| 4 | |||
| 2 | // Distributed under the simplified BSD license (see the license file that | 5 | // Distributed under the simplified BSD license (see the license file that |
| 3 | // should have come with this header). | 6 | // should have come with this header). |
| 4 | // Uses Jeff Preshing's semaphore implementation (under the terms of its | 7 | // Uses Jeff Preshing's semaphore implementation (under the terms of its |
diff --git a/src/common/detached_tasks.cpp b/src/common/detached_tasks.cpp index ec31d0b88..da64848da 100644 --- a/src/common/detached_tasks.cpp +++ b/src/common/detached_tasks.cpp | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2018 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2018 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #include <thread> | 4 | #include <thread> |
| 6 | #include "common/assert.h" | 5 | #include "common/assert.h" |
diff --git a/src/common/detached_tasks.h b/src/common/detached_tasks.h index 5dd8fc27b..416a2d7f3 100644 --- a/src/common/detached_tasks.h +++ b/src/common/detached_tasks.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2018 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2018 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
diff --git a/src/common/error.cpp b/src/common/error.cpp index d4455e310..ddb03bd45 100644 --- a/src/common/error.cpp +++ b/src/common/error.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2013 Dolphin Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-FileCopyrightText: 2014 Citra Emulator Project |
| 3 | // Refer to the license.txt file included. | 3 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 4 | 4 | ||
| 5 | #include <cstddef> | 5 | #include <cstddef> |
| 6 | #ifdef _WIN32 | 6 | #ifdef _WIN32 |
diff --git a/src/common/error.h b/src/common/error.h index e084d4b0f..62a3bd835 100644 --- a/src/common/error.h +++ b/src/common/error.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2013 Dolphin Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-FileCopyrightText: 2014 Citra Emulator Project |
| 3 | // Refer to the license.txt file included. | 3 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
diff --git a/src/common/fixed_point.h b/src/common/fixed_point.h index 1d45e51b3..4a0f72cc9 100644 --- a/src/common/fixed_point.h +++ b/src/common/fixed_point.h | |||
| @@ -1,28 +1,8 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2015 Evan Teran | ||
| 2 | // SPDX-License-Identifier: MIT | ||
| 3 | |||
| 1 | // From: https://github.com/eteran/cpp-utilities/blob/master/fixed/include/cpp-utilities/fixed.h | 4 | // From: https://github.com/eteran/cpp-utilities/blob/master/fixed/include/cpp-utilities/fixed.h |
| 2 | // See also: http://stackoverflow.com/questions/79677/whats-the-best-way-to-do-fixed-point-math | 5 | // See also: http://stackoverflow.com/questions/79677/whats-the-best-way-to-do-fixed-point-math |
| 3 | /* | ||
| 4 | * The MIT License (MIT) | ||
| 5 | * | ||
| 6 | * Copyright (c) 2015 Evan Teran | ||
| 7 | * | ||
| 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 9 | * of this software and associated documentation files (the "Software"), to deal | ||
| 10 | * in the Software without restriction, including without limitation the rights | ||
| 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 12 | * copies of the Software, and to permit persons to whom the Software is | ||
| 13 | * furnished to do so, subject to the following conditions: | ||
| 14 | * | ||
| 15 | * The above copyright notice and this permission notice shall be included in all | ||
| 16 | * copies or substantial portions of the Software. | ||
| 17 | * | ||
| 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 24 | * SOFTWARE. | ||
| 25 | */ | ||
| 26 | 6 | ||
| 27 | #ifndef FIXED_H_ | 7 | #ifndef FIXED_H_ |
| 28 | #define FIXED_H_ | 8 | #define FIXED_H_ |
diff --git a/src/common/hash.h b/src/common/hash.h index 298930702..b6f3e6d6f 100644 --- a/src/common/hash.h +++ b/src/common/hash.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2015 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2015 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
diff --git a/src/common/input.h b/src/common/input.h index 995c35d9d..213aa2384 100644 --- a/src/common/input.h +++ b/src/common/input.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2017 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2017 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index b3793106d..8ce1c2fd1 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #include <atomic> | 4 | #include <atomic> |
| 6 | #include <chrono> | 5 | #include <chrono> |
diff --git a/src/common/logging/backend.h b/src/common/logging/backend.h index a0e80fe3c..12e5e2498 100644 --- a/src/common/logging/backend.h +++ b/src/common/logging/backend.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp index 6de9bacbf..a959acb74 100644 --- a/src/common/logging/filter.cpp +++ b/src/common/logging/filter.cpp | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #include <algorithm> | 4 | #include <algorithm> |
| 6 | #include "common/logging/filter.h" | 5 | #include "common/logging/filter.h" |
diff --git a/src/common/logging/filter.h b/src/common/logging/filter.h index 29419f051..54d172cc0 100644 --- a/src/common/logging/filter.h +++ b/src/common/logging/filter.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
diff --git a/src/common/logging/log.h b/src/common/logging/log.h index 0c80d01ee..c00c01a9e 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
diff --git a/src/common/logging/text_formatter.cpp b/src/common/logging/text_formatter.cpp index b2cad58d8..09398ea64 100644 --- a/src/common/logging/text_formatter.cpp +++ b/src/common/logging/text_formatter.cpp | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #include <array> | 4 | #include <array> |
| 6 | #include <cstdio> | 5 | #include <cstdio> |
diff --git a/src/common/logging/text_formatter.h b/src/common/logging/text_formatter.h index 92c0bf0c5..0d0ec4370 100644 --- a/src/common/logging/text_formatter.h +++ b/src/common/logging/text_formatter.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
diff --git a/src/common/microprofile.cpp b/src/common/microprofile.cpp index ee25dd37f..e6657c82f 100644 --- a/src/common/microprofile.cpp +++ b/src/common/microprofile.cpp | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2015 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2015 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | // Includes the MicroProfile implementation in this file for compilation | 4 | // Includes the MicroProfile implementation in this file for compilation |
| 6 | #define MICROPROFILE_IMPL 1 | 5 | #define MICROPROFILE_IMPL 1 |
diff --git a/src/common/microprofile.h b/src/common/microprofile.h index 54e7f3cc4..91d14d5e1 100644 --- a/src/common/microprofile.h +++ b/src/common/microprofile.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2015 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2015 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
diff --git a/src/common/microprofileui.h b/src/common/microprofileui.h index 41abe6b75..39ed18ffa 100644 --- a/src/common/microprofileui.h +++ b/src/common/microprofileui.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2015 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2015 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
diff --git a/src/common/param_package.cpp b/src/common/param_package.cpp index 462502e34..629babb81 100644 --- a/src/common/param_package.cpp +++ b/src/common/param_package.cpp | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2017 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2017 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #include <array> | 4 | #include <array> |
| 6 | #include <stdexcept> | 5 | #include <stdexcept> |
diff --git a/src/common/param_package.h b/src/common/param_package.h index c13e45479..d7c13cb1f 100644 --- a/src/common/param_package.h +++ b/src/common/param_package.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2017 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2017 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
diff --git a/src/common/quaternion.h b/src/common/quaternion.h index 4d0871eb4..5bb5f2af0 100644 --- a/src/common/quaternion.h +++ b/src/common/quaternion.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2016 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
diff --git a/src/common/reader_writer_queue.h b/src/common/reader_writer_queue.h index 8d2c9408c..60c41a8cb 100644 --- a/src/common/reader_writer_queue.h +++ b/src/common/reader_writer_queue.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // ©2013-2020 Cameron Desrochers. | 1 | // SPDX-FileCopyrightText: 2013-2020 Cameron Desrochers |
| 2 | // Distributed under the simplified BSD license (see the license file that | 2 | // SPDX-License-Identifier: BSD-2-Clause |
| 3 | // should have come with this header). | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
diff --git a/src/common/scm_rev.cpp.in b/src/common/scm_rev.cpp.in index cc88994c6..f0c124d69 100644 --- a/src/common/scm_rev.cpp.in +++ b/src/common/scm_rev.cpp.in | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #include "common/scm_rev.h" | 4 | #include "common/scm_rev.h" |
| 6 | 5 | ||
diff --git a/src/common/scm_rev.h b/src/common/scm_rev.h index 563015ec9..88404316a 100644 --- a/src/common/scm_rev.h +++ b/src/common/scm_rev.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
diff --git a/src/common/scope_exit.h b/src/common/scope_exit.h index 35dac3a8f..e9c789c88 100644 --- a/src/common/scope_exit.h +++ b/src/common/scope_exit.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
diff --git a/src/common/telemetry.cpp b/src/common/telemetry.cpp index 67261c55b..d26394359 100644 --- a/src/common/telemetry.cpp +++ b/src/common/telemetry.cpp | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2017 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2017 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #include <algorithm> | 4 | #include <algorithm> |
| 6 | #include <cstring> | 5 | #include <cstring> |
diff --git a/src/common/telemetry.h b/src/common/telemetry.h index f9a824a7d..ba633d5a5 100644 --- a/src/common/telemetry.h +++ b/src/common/telemetry.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2017 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2017 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
diff --git a/src/common/uint128.h b/src/common/uint128.h index 199d0f55e..f890ffec2 100644 --- a/src/common/uint128.h +++ b/src/common/uint128.h | |||
| @@ -31,17 +31,12 @@ namespace Common { | |||
| 31 | return _udiv128(r[1], r[0], d, &remainder); | 31 | return _udiv128(r[1], r[0], d, &remainder); |
| 32 | #endif | 32 | #endif |
| 33 | #else | 33 | #else |
| 34 | #ifdef __SIZEOF_INT128__ | ||
| 35 | const auto product = static_cast<unsigned __int128>(a) * static_cast<unsigned __int128>(b); | ||
| 36 | return static_cast<u64>(product / d); | ||
| 37 | #else | ||
| 38 | const u64 diva = a / d; | 34 | const u64 diva = a / d; |
| 39 | const u64 moda = a % d; | 35 | const u64 moda = a % d; |
| 40 | const u64 divb = b / d; | 36 | const u64 divb = b / d; |
| 41 | const u64 modb = b % d; | 37 | const u64 modb = b % d; |
| 42 | return diva * b + moda * divb + moda * modb / d; | 38 | return diva * b + moda * divb + moda * modb / d; |
| 43 | #endif | 39 | #endif |
| 44 | #endif | ||
| 45 | } | 40 | } |
| 46 | 41 | ||
| 47 | // This function multiplies 2 u64 values and produces a u128 value; | 42 | // This function multiplies 2 u64 values and produces a u128 value; |
diff --git a/src/common/x64/native_clock.cpp b/src/common/x64/native_clock.cpp index 6aaa8cdf9..8b08332ab 100644 --- a/src/common/x64/native_clock.cpp +++ b/src/common/x64/native_clock.cpp | |||
| @@ -75,8 +75,8 @@ NativeClock::NativeClock(u64 emulated_cpu_frequency_, u64 emulated_clock_frequen | |||
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | u64 NativeClock::GetRTSC() { | 77 | u64 NativeClock::GetRTSC() { |
| 78 | TimePoint current_time_point{}; | ||
| 79 | TimePoint new_time_point{}; | 78 | TimePoint new_time_point{}; |
| 79 | TimePoint current_time_point{}; | ||
| 80 | 80 | ||
| 81 | current_time_point.pack = Common::AtomicLoad128(time_point.pack.data()); | 81 | current_time_point.pack = Common::AtomicLoad128(time_point.pack.data()); |
| 82 | do { | 82 | do { |
diff --git a/src/common/x64/xbyak_abi.h b/src/common/x64/xbyak_abi.h index 87b3d63a4..67e6e63c8 100644 --- a/src/common/x64/xbyak_abi.h +++ b/src/common/x64/xbyak_abi.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2016 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
diff --git a/src/common/x64/xbyak_util.h b/src/common/x64/xbyak_util.h index 44d2558f1..250e5cddb 100644 --- a/src/common/x64/xbyak_util.h +++ b/src/common/x64/xbyak_util.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2016 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||