diff options
| author | 2016-12-17 01:20:47 -0500 | |
|---|---|---|
| committer | 2016-12-21 23:48:14 -0500 | |
| commit | 5ac5cbeab7387b2eabd4618291e223fd7189bb8b (patch) | |
| tree | e035f870b86f930876a5ced2c1e2be9f6a087a91 /src | |
| parent | core: Remove HLE module, consolidate code & various cleanups. (diff) | |
| download | yuzu-5ac5cbeab7387b2eabd4618291e223fd7189bb8b.tar.gz yuzu-5ac5cbeab7387b2eabd4618291e223fd7189bb8b.tar.xz yuzu-5ac5cbeab7387b2eabd4618291e223fd7189bb8b.zip | |
Address clang-format issues.
Diffstat (limited to 'src')
| -rw-r--r-- | src/citra/citra.cpp | 6 | ||||
| -rw-r--r-- | src/citra_qt/main.cpp | 27 | ||||
| -rw-r--r-- | src/core/core.cpp | 6 | ||||
| -rw-r--r-- | src/core/core.h | 25 | ||||
| -rw-r--r-- | src/core/file_sys/archive_extsavedata.cpp | 7 | ||||
| -rw-r--r-- | src/core/gdbstub/gdbstub.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/fs/archive.h | 4 | ||||
| -rw-r--r-- | src/core/hle/svc.cpp | 19 |
8 files changed, 49 insertions, 49 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index febfc5dc8..99c096ac7 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp | |||
| @@ -126,13 +126,13 @@ int main(int argc, char** argv) { | |||
| 126 | Settings::values.use_gdbstub = use_gdbstub; | 126 | Settings::values.use_gdbstub = use_gdbstub; |
| 127 | Settings::Apply(); | 127 | Settings::Apply(); |
| 128 | 128 | ||
| 129 | std::unique_ptr<EmuWindow_SDL2> emu_window{ std::make_unique<EmuWindow_SDL2>() }; | 129 | std::unique_ptr<EmuWindow_SDL2> emu_window{std::make_unique<EmuWindow_SDL2>()}; |
| 130 | 130 | ||
| 131 | Core::System& system{ Core::System::GetInstance() }; | 131 | Core::System& system{Core::System::GetInstance()}; |
| 132 | 132 | ||
| 133 | SCOPE_EXIT({ system.Shutdown(); }); | 133 | SCOPE_EXIT({ system.Shutdown(); }); |
| 134 | 134 | ||
| 135 | const Core::System::ResultStatus load_result{ system.Load(emu_window.get(), filepath) }; | 135 | const Core::System::ResultStatus load_result{system.Load(emu_window.get(), filepath)}; |
| 136 | 136 | ||
| 137 | switch (load_result) { | 137 | switch (load_result) { |
| 138 | case Core::System::ResultStatus::ErrorGetLoader: | 138 | case Core::System::ResultStatus::ErrorGetLoader: |
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index e27c09b53..6d59cf640 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -283,49 +283,48 @@ bool GMainWindow::LoadROM(const std::string& filename) { | |||
| 283 | 283 | ||
| 284 | if (!gladLoadGL()) { | 284 | if (!gladLoadGL()) { |
| 285 | QMessageBox::critical(this, tr("Error while starting Citra!"), | 285 | QMessageBox::critical(this, tr("Error while starting Citra!"), |
| 286 | tr("Failed to initialize the video core!\n\n" | 286 | tr("Failed to initialize the video core!\n\n" |
| 287 | "Please ensure that your GPU supports OpenGL 3.3 and that you " | 287 | "Please ensure that your GPU supports OpenGL 3.3 and that you " |
| 288 | "have the latest graphics driver.")); | 288 | "have the latest graphics driver.")); |
| 289 | return false; | 289 | return false; |
| 290 | } | 290 | } |
| 291 | 291 | ||
| 292 | Core::System& system{ Core::System::GetInstance() }; | 292 | Core::System& system{Core::System::GetInstance()}; |
| 293 | 293 | ||
| 294 | const Core::System::ResultStatus result{ system.Load(render_window, filename) }; | 294 | const Core::System::ResultStatus result{system.Load(render_window, filename)}; |
| 295 | 295 | ||
| 296 | if (result != Core::System::ResultStatus::Success) { | 296 | if (result != Core::System::ResultStatus::Success) { |
| 297 | switch (result) { | 297 | switch (result) { |
| 298 | case Core::System::ResultStatus::ErrorGetLoader: | 298 | case Core::System::ResultStatus::ErrorGetLoader: |
| 299 | LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", filename.c_str()); | 299 | LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", filename.c_str()); |
| 300 | QMessageBox::critical(this, tr("Error while loading ROM!"), | 300 | QMessageBox::critical(this, tr("Error while loading ROM!"), |
| 301 | tr("The ROM format is not supported.")); | 301 | tr("The ROM format is not supported.")); |
| 302 | break; | 302 | break; |
| 303 | 303 | ||
| 304 | case Core::System::ResultStatus::ErrorSystemMode: | 304 | case Core::System::ResultStatus::ErrorSystemMode: |
| 305 | LOG_CRITICAL(Frontend, "Failed to load ROM!"); | 305 | LOG_CRITICAL(Frontend, "Failed to load ROM!"); |
| 306 | QMessageBox::critical(this, tr("Error while loading ROM!"), | 306 | QMessageBox::critical(this, tr("Error while loading ROM!"), |
| 307 | tr("Could not determine the system mode.")); | 307 | tr("Could not determine the system mode.")); |
| 308 | break; | 308 | break; |
| 309 | 309 | ||
| 310 | case Core::System::ResultStatus::ErrorLoader_ErrorEncrypted: | 310 | case Core::System::ResultStatus::ErrorLoader_ErrorEncrypted: { |
| 311 | { | ||
| 312 | // Build the MessageBox ourselves to have clickable link | 311 | // Build the MessageBox ourselves to have clickable link |
| 313 | QMessageBox popup_error; | 312 | QMessageBox popup_error; |
| 314 | popup_error.setTextFormat(Qt::RichText); | 313 | popup_error.setTextFormat(Qt::RichText); |
| 315 | popup_error.setWindowTitle(tr("Error while loading ROM!")); | 314 | popup_error.setWindowTitle(tr("Error while loading ROM!")); |
| 316 | popup_error.setText( | 315 | popup_error.setText( |
| 317 | tr("The game that you are trying to load must be decrypted before being used with " | 316 | tr("The game that you are trying to load must be decrypted before being used with " |
| 318 | "Citra.<br/><br/>" | 317 | "Citra.<br/><br/>" |
| 319 | "For more information on dumping and decrypting games, please see: <a " | 318 | "For more information on dumping and decrypting games, please see: <a " |
| 320 | "href='https://citra-emu.org/wiki/Dumping-Game-Cartridges'>https://" | 319 | "href='https://citra-emu.org/wiki/Dumping-Game-Cartridges'>https://" |
| 321 | "citra-emu.org/wiki/Dumping-Game-Cartridges</a>")); | 320 | "citra-emu.org/wiki/Dumping-Game-Cartridges</a>")); |
| 322 | popup_error.setIcon(QMessageBox::Critical); | 321 | popup_error.setIcon(QMessageBox::Critical); |
| 323 | popup_error.exec(); | 322 | popup_error.exec(); |
| 324 | break; | 323 | break; |
| 325 | } | 324 | } |
| 326 | case Core::System::ResultStatus::ErrorLoader_ErrorInvalidFormat: | 325 | case Core::System::ResultStatus::ErrorLoader_ErrorInvalidFormat: |
| 327 | QMessageBox::critical(this, tr("Error while loading ROM!"), | 326 | QMessageBox::critical(this, tr("Error while loading ROM!"), |
| 328 | tr("The ROM format is not supported.")); | 327 | tr("The ROM format is not supported.")); |
| 329 | break; | 328 | break; |
| 330 | 329 | ||
| 331 | default: | 330 | default: |
diff --git a/src/core/core.cpp b/src/core/core.cpp index 67d7cf7b2..fabd3f42a 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -78,20 +78,20 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file | |||
| 78 | return ResultStatus::ErrorGetLoader; | 78 | return ResultStatus::ErrorGetLoader; |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | boost::optional<u32> system_mode{ app_loader->LoadKernelSystemMode() }; | 81 | boost::optional<u32> system_mode{app_loader->LoadKernelSystemMode()}; |
| 82 | if (!system_mode) { | 82 | if (!system_mode) { |
| 83 | LOG_CRITICAL(Core, "Failed to determine system mode!"); | 83 | LOG_CRITICAL(Core, "Failed to determine system mode!"); |
| 84 | return ResultStatus::ErrorSystemMode; | 84 | return ResultStatus::ErrorSystemMode; |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | ResultStatus init_result{ Init(emu_window, system_mode.get()) }; | 87 | ResultStatus init_result{Init(emu_window, system_mode.get())}; |
| 88 | if (init_result != ResultStatus::Success) { | 88 | if (init_result != ResultStatus::Success) { |
| 89 | LOG_CRITICAL(Core, "Failed to initialize system (Error %i)!", init_result); | 89 | LOG_CRITICAL(Core, "Failed to initialize system (Error %i)!", init_result); |
| 90 | System::Shutdown(); | 90 | System::Shutdown(); |
| 91 | return init_result; | 91 | return init_result; |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | const Loader::ResultStatus load_result{ app_loader->Load() }; | 94 | const Loader::ResultStatus load_result{app_loader->Load()}; |
| 95 | if (Loader::ResultStatus::Success != load_result) { | 95 | if (Loader::ResultStatus::Success != load_result) { |
| 96 | LOG_CRITICAL(Core, "Failed to load ROM (Error %i)!", load_result); | 96 | LOG_CRITICAL(Core, "Failed to load ROM (Error %i)!", load_result); |
| 97 | System::Shutdown(); | 97 | System::Shutdown(); |
diff --git a/src/core/core.h b/src/core/core.h index 8194db6a2..728c24c1c 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
| @@ -42,23 +42,24 @@ public: | |||
| 42 | 42 | ||
| 43 | /// Enumeration representing the return values of the System Initialize and Load process. | 43 | /// Enumeration representing the return values of the System Initialize and Load process. |
| 44 | enum class ResultStatus : u32 { | 44 | enum class ResultStatus : u32 { |
| 45 | Success, ///< Succeeded | 45 | Success, ///< Succeeded |
| 46 | ErrorNotInitialized, ///< Error trying to use core prior to initialization | 46 | ErrorNotInitialized, ///< Error trying to use core prior to initialization |
| 47 | ErrorGetLoader, ///< Error finding the correct application loader | 47 | ErrorGetLoader, ///< Error finding the correct application loader |
| 48 | ErrorSystemMode, ///< Error determining the system mode | 48 | ErrorSystemMode, ///< Error determining the system mode |
| 49 | ErrorLoader, ///< Error loading the specified application | 49 | ErrorLoader, ///< Error loading the specified application |
| 50 | ErrorLoader_ErrorEncrypted, ///< Error loading the specified application due to encryption | 50 | ErrorLoader_ErrorEncrypted, ///< Error loading the specified application due to encryption |
| 51 | ErrorLoader_ErrorInvalidFormat, ///< Error loading the specified application due to an invalid format | 51 | ErrorLoader_ErrorInvalidFormat, ///< Error loading the specified application due to an |
| 52 | ErrorVideoCore, ///< Error in the video core | 52 | /// invalid format |
| 53 | ErrorVideoCore, ///< Error in the video core | ||
| 53 | }; | 54 | }; |
| 54 | 55 | ||
| 55 | /** | 56 | /** |
| 56 | * Run the core CPU loop | 57 | * Run the core CPU loop |
| 57 | * This function runs the core for the specified number of CPU instructions before trying to update | 58 | * This function runs the core for the specified number of CPU instructions before trying to |
| 58 | * hardware. This is much faster than SingleStep (and should be equivalent), as the CPU is not | 59 | * update hardware. This is much faster than SingleStep (and should be equivalent), as the CPU |
| 59 | * required to do a full dispatch with each instruction. NOTE: the number of instructions requested | 60 | * is not required to do a full dispatch with each instruction. NOTE: the number of instructions |
| 60 | * is not guaranteed to run, as this will be interrupted preemptively if a hardware update is | 61 | * requested is not guaranteed to run, as this will be interrupted preemptively if a hardware |
| 61 | * requested (e.g. on a thread switch). | 62 | * update is requested (e.g. on a thread switch). |
| 62 | * @param tight_loop Number of instructions to execute. | 63 | * @param tight_loop Number of instructions to execute. |
| 63 | * @return Result status, indicating whethor or not the operation succeeded. | 64 | * @return Result status, indicating whethor or not the operation succeeded. |
| 64 | */ | 65 | */ |
diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp index b9fc77e34..51ce78435 100644 --- a/src/core/file_sys/archive_extsavedata.cpp +++ b/src/core/file_sys/archive_extsavedata.cpp | |||
| @@ -141,11 +141,10 @@ std::string GetExtSaveDataPath(const std::string& mount_point, const Path& path) | |||
| 141 | 141 | ||
| 142 | std::string GetExtDataContainerPath(const std::string& mount_point, bool shared) { | 142 | std::string GetExtDataContainerPath(const std::string& mount_point, bool shared) { |
| 143 | if (shared) | 143 | if (shared) |
| 144 | return Common::StringFromFormat("%sdata/%s/extdata/", mount_point.c_str(), | 144 | return Common::StringFromFormat("%sdata/%s/extdata/", mount_point.c_str(), SYSTEM_ID); |
| 145 | SYSTEM_ID); | ||
| 146 | 145 | ||
| 147 | return Common::StringFromFormat("%sNintendo 3DS/%s/%s/extdata/", mount_point.c_str(), | 146 | return Common::StringFromFormat("%sNintendo 3DS/%s/%s/extdata/", mount_point.c_str(), SYSTEM_ID, |
| 148 | SYSTEM_ID, SDCARD_ID); | 147 | SDCARD_ID); |
| 149 | } | 148 | } |
| 150 | 149 | ||
| 151 | Path ConstructExtDataBinaryPath(u32 media_type, u32 high, u32 low) { | 150 | Path ConstructExtDataBinaryPath(u32 media_type, u32 high, u32 low) { |
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index 9acdd402b..c75d5fc5e 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp | |||
| @@ -30,12 +30,12 @@ | |||
| 30 | #include <unistd.h> | 30 | #include <unistd.h> |
| 31 | #endif | 31 | #endif |
| 32 | 32 | ||
| 33 | #include "core/loader/loader.h" | ||
| 34 | #include "common/logging/log.h" | 33 | #include "common/logging/log.h" |
| 35 | #include "common/string_util.h" | 34 | #include "common/string_util.h" |
| 36 | #include "core/arm/arm_interface.h" | 35 | #include "core/arm/arm_interface.h" |
| 37 | #include "core/core.h" | 36 | #include "core/core.h" |
| 38 | #include "core/gdbstub/gdbstub.h" | 37 | #include "core/gdbstub/gdbstub.h" |
| 38 | #include "core/loader/loader.h" | ||
| 39 | #include "core/memory.h" | 39 | #include "core/memory.h" |
| 40 | 40 | ||
| 41 | const int GDB_BUFFER_SIZE = 10000; | 41 | const int GDB_BUFFER_SIZE = 10000; |
| @@ -629,7 +629,7 @@ static void WriteRegisters() { | |||
| 629 | i += 2; | 629 | i += 2; |
| 630 | } else if (reg > CPSR_REGISTER && reg < FPSCR_REGISTER) { | 630 | } else if (reg > CPSR_REGISTER && reg < FPSCR_REGISTER) { |
| 631 | Core::AppCore().SetVFPReg(reg - CPSR_REGISTER - 1, | 631 | Core::AppCore().SetVFPReg(reg - CPSR_REGISTER - 1, |
| 632 | GdbHexToInt(buffer_ptr + i * CHAR_BIT)); | 632 | GdbHexToInt(buffer_ptr + i * CHAR_BIT)); |
| 633 | i++; // Skip padding | 633 | i++; // Skip padding |
| 634 | } else if (reg == FPSCR_REGISTER) { | 634 | } else if (reg == FPSCR_REGISTER) { |
| 635 | Core::AppCore().SetVFPSystemReg(VFP_FPSCR, GdbHexToInt(buffer_ptr + i * CHAR_BIT)); | 635 | Core::AppCore().SetVFPSystemReg(VFP_FPSCR, GdbHexToInt(buffer_ptr + i * CHAR_BIT)); |
diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h index 0aa373f40..519c1f3a9 100644 --- a/src/core/hle/service/fs/archive.h +++ b/src/core/hle/service/fs/archive.h | |||
| @@ -17,9 +17,9 @@ class FileBackend; | |||
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | /// The unique system identifier hash, also known as ID0 | 19 | /// The unique system identifier hash, also known as ID0 |
| 20 | static constexpr char SYSTEM_ID[]{ "00000000000000000000000000000000" }; | 20 | static constexpr char SYSTEM_ID[]{"00000000000000000000000000000000"}; |
| 21 | /// The scrambled SD card CID, also known as ID1 | 21 | /// The scrambled SD card CID, also known as ID1 |
| 22 | static constexpr char SDCARD_ID[]{ "00000000000000000000000000000000" }; | 22 | static constexpr char SDCARD_ID[]{"00000000000000000000000000000000"}; |
| 23 | 23 | ||
| 24 | namespace Service { | 24 | namespace Service { |
| 25 | namespace FS { | 25 | namespace FS { |
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 5a52525c6..1f89ccfd5 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp | |||
| @@ -166,7 +166,8 @@ static ResultCode ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 add | |||
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | /// Maps a memory block to specified address | 168 | /// Maps a memory block to specified address |
| 169 | static ResultCode MapMemoryBlock(Kernel::Handle handle, u32 addr, u32 permissions, u32 other_permissions) { | 169 | static ResultCode MapMemoryBlock(Kernel::Handle handle, u32 addr, u32 permissions, |
| 170 | u32 other_permissions) { | ||
| 170 | using Kernel::SharedMemory; | 171 | using Kernel::SharedMemory; |
| 171 | using Kernel::MemoryPermission; | 172 | using Kernel::MemoryPermission; |
| 172 | 173 | ||
| @@ -295,8 +296,8 @@ static ResultCode WaitSynchronization1(Kernel::Handle handle, s64 nano_seconds) | |||
| 295 | } | 296 | } |
| 296 | 297 | ||
| 297 | /// Wait for the given handles to synchronize, timeout after the specified nanoseconds | 298 | /// Wait for the given handles to synchronize, timeout after the specified nanoseconds |
| 298 | static ResultCode WaitSynchronizationN(s32* out, Kernel::Handle* handles, s32 handle_count, bool wait_all, | 299 | static ResultCode WaitSynchronizationN(s32* out, Kernel::Handle* handles, s32 handle_count, |
| 299 | s64 nano_seconds) { | 300 | bool wait_all, s64 nano_seconds) { |
| 300 | Kernel::Thread* thread = Kernel::GetCurrentThread(); | 301 | Kernel::Thread* thread = Kernel::GetCurrentThread(); |
| 301 | 302 | ||
| 302 | // Check if 'handles' is invalid | 303 | // Check if 'handles' is invalid |
| @@ -507,8 +508,8 @@ static ResultCode GetResourceLimitCurrentValues(s64* values, Kernel::Handle reso | |||
| 507 | } | 508 | } |
| 508 | 509 | ||
| 509 | /// Get resource limit max values | 510 | /// Get resource limit max values |
| 510 | static ResultCode GetResourceLimitLimitValues(s64* values, Kernel::Handle resource_limit_handle, u32* names, | 511 | static ResultCode GetResourceLimitLimitValues(s64* values, Kernel::Handle resource_limit_handle, |
| 511 | u32 name_count) { | 512 | u32* names, u32 name_count) { |
| 512 | LOG_TRACE(Kernel_SVC, "called resource_limit=%08X, names=%p, name_count=%d", | 513 | LOG_TRACE(Kernel_SVC, "called resource_limit=%08X, names=%p, name_count=%d", |
| 513 | resource_limit_handle, names, name_count); | 514 | resource_limit_handle, names, name_count); |
| 514 | 515 | ||
| @@ -860,8 +861,8 @@ static s64 GetSystemTick() { | |||
| 860 | } | 861 | } |
| 861 | 862 | ||
| 862 | /// Creates a memory block at the specified address with the specified permissions and size | 863 | /// Creates a memory block at the specified address with the specified permissions and size |
| 863 | static ResultCode CreateMemoryBlock(Kernel::Handle* out_handle, u32 addr, u32 size, u32 my_permission, | 864 | static ResultCode CreateMemoryBlock(Kernel::Handle* out_handle, u32 addr, u32 size, |
| 864 | u32 other_permission) { | 865 | u32 my_permission, u32 other_permission) { |
| 865 | using Kernel::SharedMemory; | 866 | using Kernel::SharedMemory; |
| 866 | 867 | ||
| 867 | if (size % Memory::PAGE_SIZE != 0) | 868 | if (size % Memory::PAGE_SIZE != 0) |
| @@ -912,8 +913,8 @@ static ResultCode CreateMemoryBlock(Kernel::Handle* out_handle, u32 addr, u32 si | |||
| 912 | return RESULT_SUCCESS; | 913 | return RESULT_SUCCESS; |
| 913 | } | 914 | } |
| 914 | 915 | ||
| 915 | static ResultCode CreatePort(Kernel::Handle* server_port, Kernel::Handle* client_port, const char* name, | 916 | static ResultCode CreatePort(Kernel::Handle* server_port, Kernel::Handle* client_port, |
| 916 | u32 max_sessions) { | 917 | const char* name, u32 max_sessions) { |
| 917 | // TODO(Subv): Implement named ports. | 918 | // TODO(Subv): Implement named ports. |
| 918 | ASSERT_MSG(name == nullptr, "Named ports are currently unimplemented"); | 919 | ASSERT_MSG(name == nullptr, "Named ports are currently unimplemented"); |
| 919 | 920 | ||