diff options
| author | 2018-08-02 14:58:01 -0400 | |
|---|---|---|
| committer | 2018-08-02 14:58:01 -0400 | |
| commit | 4de18e054b7b7bcd71561548f73571ee9e5b8aea (patch) | |
| tree | 307732a9c85e47c019d9c013bef4c211b9b4e3f2 /src | |
| parent | Merge pull request #902 from lioncash/array (diff) | |
| parent | hw: Remove unused files (diff) | |
| download | yuzu-4de18e054b7b7bcd71561548f73571ee9e5b8aea.tar.gz yuzu-4de18e054b7b7bcd71561548f73571ee9e5b8aea.tar.xz yuzu-4de18e054b7b7bcd71561548f73571ee9e5b8aea.zip | |
Merge pull request #899 from lioncash/unused
hw: Remove unused files
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/core/core.cpp | 3 | ||||
| -rw-r--r-- | src/core/hw/aes/ccm.cpp | 28 | ||||
| -rw-r--r-- | src/core/hw/hw.cpp | 96 | ||||
| -rw-r--r-- | src/core/hw/hw.h | 50 | ||||
| -rw-r--r-- | src/core/hw/lcd.cpp | 67 | ||||
| -rw-r--r-- | src/core/hw/lcd.h | 86 |
7 files changed, 0 insertions, 334 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 5567737a1..a85397450 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -311,10 +311,6 @@ add_library(core STATIC | |||
| 311 | hle/service/vi/vi_u.h | 311 | hle/service/vi/vi_u.h |
| 312 | hle/service/wlan/wlan.cpp | 312 | hle/service/wlan/wlan.cpp |
| 313 | hle/service/wlan/wlan.h | 313 | hle/service/wlan/wlan.h |
| 314 | hw/hw.cpp | ||
| 315 | hw/hw.h | ||
| 316 | hw/lcd.cpp | ||
| 317 | hw/lcd.h | ||
| 318 | loader/deconstructed_rom_directory.cpp | 314 | loader/deconstructed_rom_directory.cpp |
| 319 | loader/deconstructed_rom_directory.h | 315 | loader/deconstructed_rom_directory.h |
| 320 | loader/elf.cpp | 316 | loader/elf.cpp |
diff --git a/src/core/core.cpp b/src/core/core.cpp index b7f4b4532..dd845a78a 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include "core/hle/service/service.h" | 15 | #include "core/hle/service/service.h" |
| 16 | #include "core/hle/service/sm/controller.h" | 16 | #include "core/hle/service/sm/controller.h" |
| 17 | #include "core/hle/service/sm/sm.h" | 17 | #include "core/hle/service/sm/sm.h" |
| 18 | #include "core/hw/hw.h" | ||
| 19 | #include "core/loader/loader.h" | 18 | #include "core/loader/loader.h" |
| 20 | #include "core/memory_setup.h" | 19 | #include "core/memory_setup.h" |
| 21 | #include "core/settings.h" | 20 | #include "core/settings.h" |
| @@ -180,7 +179,6 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { | |||
| 180 | telemetry_session = std::make_unique<Core::TelemetrySession>(); | 179 | telemetry_session = std::make_unique<Core::TelemetrySession>(); |
| 181 | service_manager = std::make_shared<Service::SM::ServiceManager>(); | 180 | service_manager = std::make_shared<Service::SM::ServiceManager>(); |
| 182 | 181 | ||
| 183 | HW::Init(); | ||
| 184 | Kernel::Init(system_mode); | 182 | Kernel::Init(system_mode); |
| 185 | Service::Init(service_manager); | 183 | Service::Init(service_manager); |
| 186 | GDBStub::Init(); | 184 | GDBStub::Init(); |
| @@ -224,7 +222,6 @@ void System::Shutdown() { | |||
| 224 | GDBStub::Shutdown(); | 222 | GDBStub::Shutdown(); |
| 225 | Service::Shutdown(); | 223 | Service::Shutdown(); |
| 226 | Kernel::Shutdown(); | 224 | Kernel::Shutdown(); |
| 227 | HW::Shutdown(); | ||
| 228 | service_manager.reset(); | 225 | service_manager.reset(); |
| 229 | telemetry_session.reset(); | 226 | telemetry_session.reset(); |
| 230 | gpu_core.reset(); | 227 | gpu_core.reset(); |
diff --git a/src/core/hw/aes/ccm.cpp b/src/core/hw/aes/ccm.cpp deleted file mode 100644 index 1ee37aaa4..000000000 --- a/src/core/hw/aes/ccm.cpp +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | // Copyright 2017 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <algorithm> | ||
| 6 | #include "common/alignment.h" | ||
| 7 | #include "common/assert.h" | ||
| 8 | #include "common/logging/log.h" | ||
| 9 | #include "core/hw/aes/ccm.h" | ||
| 10 | #include "core/hw/aes/key.h" | ||
| 11 | |||
| 12 | namespace HW { | ||
| 13 | namespace AES { | ||
| 14 | |||
| 15 | std::vector<u8> EncryptSignCCM(const std::vector<u8>& pdata, const CCMNonce& nonce, | ||
| 16 | size_t slot_id) { | ||
| 17 | UNIMPLEMENTED(); | ||
| 18 | return {}; | ||
| 19 | } | ||
| 20 | |||
| 21 | std::vector<u8> DecryptVerifyCCM(const std::vector<u8>& cipher, const CCMNonce& nonce, | ||
| 22 | size_t slot_id) { | ||
| 23 | UNIMPLEMENTED(); | ||
| 24 | return {}; | ||
| 25 | } | ||
| 26 | |||
| 27 | } // namespace AES | ||
| 28 | } // namespace HW | ||
diff --git a/src/core/hw/hw.cpp b/src/core/hw/hw.cpp deleted file mode 100644 index 2f48068c1..000000000 --- a/src/core/hw/hw.cpp +++ /dev/null | |||
| @@ -1,96 +0,0 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "common/common_types.h" | ||
| 6 | #include "common/logging/log.h" | ||
| 7 | #include "core/hw/hw.h" | ||
| 8 | #include "core/hw/lcd.h" | ||
| 9 | |||
| 10 | namespace HW { | ||
| 11 | |||
| 12 | template <typename T> | ||
| 13 | inline void Read(T& var, const u32 addr) { | ||
| 14 | switch (addr & 0xFFFFF000) { | ||
| 15 | case VADDR_GPU: | ||
| 16 | case VADDR_GPU + 0x1000: | ||
| 17 | case VADDR_GPU + 0x2000: | ||
| 18 | case VADDR_GPU + 0x3000: | ||
| 19 | case VADDR_GPU + 0x4000: | ||
| 20 | case VADDR_GPU + 0x5000: | ||
| 21 | case VADDR_GPU + 0x6000: | ||
| 22 | case VADDR_GPU + 0x7000: | ||
| 23 | case VADDR_GPU + 0x8000: | ||
| 24 | case VADDR_GPU + 0x9000: | ||
| 25 | case VADDR_GPU + 0xA000: | ||
| 26 | case VADDR_GPU + 0xB000: | ||
| 27 | case VADDR_GPU + 0xC000: | ||
| 28 | case VADDR_GPU + 0xD000: | ||
| 29 | case VADDR_GPU + 0xE000: | ||
| 30 | case VADDR_GPU + 0xF000: | ||
| 31 | break; | ||
| 32 | case VADDR_LCD: | ||
| 33 | LCD::Read(var, addr); | ||
| 34 | break; | ||
| 35 | default: | ||
| 36 | LOG_ERROR(HW_Memory, "Unknown Read{} @ 0x{:08X}", sizeof(var) * 8, addr); | ||
| 37 | break; | ||
| 38 | } | ||
| 39 | } | ||
| 40 | |||
| 41 | template <typename T> | ||
| 42 | inline void Write(u32 addr, const T data) { | ||
| 43 | switch (addr & 0xFFFFF000) { | ||
| 44 | case VADDR_GPU: | ||
| 45 | case VADDR_GPU + 0x1000: | ||
| 46 | case VADDR_GPU + 0x2000: | ||
| 47 | case VADDR_GPU + 0x3000: | ||
| 48 | case VADDR_GPU + 0x4000: | ||
| 49 | case VADDR_GPU + 0x5000: | ||
| 50 | case VADDR_GPU + 0x6000: | ||
| 51 | case VADDR_GPU + 0x7000: | ||
| 52 | case VADDR_GPU + 0x8000: | ||
| 53 | case VADDR_GPU + 0x9000: | ||
| 54 | case VADDR_GPU + 0xA000: | ||
| 55 | case VADDR_GPU + 0xB000: | ||
| 56 | case VADDR_GPU + 0xC000: | ||
| 57 | case VADDR_GPU + 0xD000: | ||
| 58 | case VADDR_GPU + 0xE000: | ||
| 59 | case VADDR_GPU + 0xF000: | ||
| 60 | break; | ||
| 61 | case VADDR_LCD: | ||
| 62 | LCD::Write(addr, data); | ||
| 63 | break; | ||
| 64 | default: | ||
| 65 | LOG_ERROR(HW_Memory, "Unknown Write{} 0x{:08X} @ 0x{:08X}", sizeof(data) * 8, data, addr); | ||
| 66 | break; | ||
| 67 | } | ||
| 68 | } | ||
| 69 | |||
| 70 | // Explicitly instantiate template functions because we aren't defining this in the header: | ||
| 71 | |||
| 72 | template void Read<u64>(u64& var, const u32 addr); | ||
| 73 | template void Read<u32>(u32& var, const u32 addr); | ||
| 74 | template void Read<u16>(u16& var, const u32 addr); | ||
| 75 | template void Read<u8>(u8& var, const u32 addr); | ||
| 76 | |||
| 77 | template void Write<u64>(u32 addr, const u64 data); | ||
| 78 | template void Write<u32>(u32 addr, const u32 data); | ||
| 79 | template void Write<u16>(u32 addr, const u16 data); | ||
| 80 | template void Write<u8>(u32 addr, const u8 data); | ||
| 81 | |||
| 82 | /// Update hardware | ||
| 83 | void Update() {} | ||
| 84 | |||
| 85 | /// Initialize hardware | ||
| 86 | void Init() { | ||
| 87 | LCD::Init(); | ||
| 88 | LOG_DEBUG(HW, "Initialized OK"); | ||
| 89 | } | ||
| 90 | |||
| 91 | /// Shutdown hardware | ||
| 92 | void Shutdown() { | ||
| 93 | LCD::Shutdown(); | ||
| 94 | LOG_DEBUG(HW, "Shutdown OK"); | ||
| 95 | } | ||
| 96 | } // namespace HW | ||
diff --git a/src/core/hw/hw.h b/src/core/hw/hw.h deleted file mode 100644 index 5890d2b5c..000000000 --- a/src/core/hw/hw.h +++ /dev/null | |||
| @@ -1,50 +0,0 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "common/common_types.h" | ||
| 8 | |||
| 9 | namespace HW { | ||
| 10 | |||
| 11 | /// Beginnings of IO register regions, in the user VA space. | ||
| 12 | enum : u32 { | ||
| 13 | VADDR_HASH = 0x1EC01000, | ||
| 14 | VADDR_CSND = 0x1EC03000, | ||
| 15 | VADDR_DSP = 0x1EC40000, | ||
| 16 | VADDR_PDN = 0x1EC41000, | ||
| 17 | VADDR_CODEC = 0x1EC41000, | ||
| 18 | VADDR_SPI = 0x1EC42000, | ||
| 19 | VADDR_SPI_2 = 0x1EC43000, // Only used under TWL_FIRM? | ||
| 20 | VADDR_I2C = 0x1EC44000, | ||
| 21 | VADDR_CODEC_2 = 0x1EC45000, | ||
| 22 | VADDR_HID = 0x1EC46000, | ||
| 23 | VADDR_GPIO = 0x1EC47000, | ||
| 24 | VADDR_I2C_2 = 0x1EC48000, | ||
| 25 | VADDR_SPI_3 = 0x1EC60000, | ||
| 26 | VADDR_I2C_3 = 0x1EC61000, | ||
| 27 | VADDR_MIC = 0x1EC62000, | ||
| 28 | VADDR_PXI = 0x1EC63000, | ||
| 29 | VADDR_LCD = 0x1ED02000, | ||
| 30 | VADDR_DSP_2 = 0x1ED03000, | ||
| 31 | VADDR_HASH_2 = 0x1EE01000, | ||
| 32 | VADDR_GPU = 0x1EF00000, | ||
| 33 | }; | ||
| 34 | |||
| 35 | template <typename T> | ||
| 36 | void Read(T& var, const u32 addr); | ||
| 37 | |||
| 38 | template <typename T> | ||
| 39 | void Write(u32 addr, const T data); | ||
| 40 | |||
| 41 | /// Update hardware | ||
| 42 | void Update(); | ||
| 43 | |||
| 44 | /// Initialize hardware | ||
| 45 | void Init(); | ||
| 46 | |||
| 47 | /// Shutdown hardware | ||
| 48 | void Shutdown(); | ||
| 49 | |||
| 50 | } // namespace HW | ||
diff --git a/src/core/hw/lcd.cpp b/src/core/hw/lcd.cpp deleted file mode 100644 index 0b62174d5..000000000 --- a/src/core/hw/lcd.cpp +++ /dev/null | |||
| @@ -1,67 +0,0 @@ | |||
| 1 | // Copyright 2015 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <cstring> | ||
| 6 | #include "common/common_types.h" | ||
| 7 | #include "common/logging/log.h" | ||
| 8 | #include "core/hw/hw.h" | ||
| 9 | #include "core/hw/lcd.h" | ||
| 10 | #include "core/tracer/recorder.h" | ||
| 11 | |||
| 12 | namespace LCD { | ||
| 13 | |||
| 14 | Regs g_regs; | ||
| 15 | |||
| 16 | template <typename T> | ||
| 17 | inline void Read(T& var, const u32 raw_addr) { | ||
| 18 | u32 addr = raw_addr - HW::VADDR_LCD; | ||
| 19 | u32 index = addr / 4; | ||
| 20 | |||
| 21 | // Reads other than u32 are untested, so I'd rather have them abort than silently fail | ||
| 22 | if (index >= 0x400 || !std::is_same<T, u32>::value) { | ||
| 23 | LOG_ERROR(HW_LCD, "Unknown Read{} @ 0x{:08X}", sizeof(var) * 8, addr); | ||
| 24 | return; | ||
| 25 | } | ||
| 26 | |||
| 27 | var = g_regs[index]; | ||
| 28 | } | ||
| 29 | |||
| 30 | template <typename T> | ||
| 31 | inline void Write(u32 addr, const T data) { | ||
| 32 | addr -= HW::VADDR_LCD; | ||
| 33 | u32 index = addr / 4; | ||
| 34 | |||
| 35 | // Writes other than u32 are untested, so I'd rather have them abort than silently fail | ||
| 36 | if (index >= 0x400 || !std::is_same<T, u32>::value) { | ||
| 37 | LOG_ERROR(HW_LCD, "Unknown Write{} 0x{:08X} @ 0x{:08X}", sizeof(data) * 8, data, addr); | ||
| 38 | return; | ||
| 39 | } | ||
| 40 | |||
| 41 | g_regs[index] = static_cast<u32>(data); | ||
| 42 | } | ||
| 43 | |||
| 44 | // Explicitly instantiate template functions because we aren't defining this in the header: | ||
| 45 | |||
| 46 | template void Read<u64>(u64& var, const u32 addr); | ||
| 47 | template void Read<u32>(u32& var, const u32 addr); | ||
| 48 | template void Read<u16>(u16& var, const u32 addr); | ||
| 49 | template void Read<u8>(u8& var, const u32 addr); | ||
| 50 | |||
| 51 | template void Write<u64>(u32 addr, const u64 data); | ||
| 52 | template void Write<u32>(u32 addr, const u32 data); | ||
| 53 | template void Write<u16>(u32 addr, const u16 data); | ||
| 54 | template void Write<u8>(u32 addr, const u8 data); | ||
| 55 | |||
| 56 | /// Initialize hardware | ||
| 57 | void Init() { | ||
| 58 | memset(&g_regs, 0, sizeof(g_regs)); | ||
| 59 | LOG_DEBUG(HW_LCD, "Initialized OK"); | ||
| 60 | } | ||
| 61 | |||
| 62 | /// Shutdown hardware | ||
| 63 | void Shutdown() { | ||
| 64 | LOG_DEBUG(HW_LCD, "Shutdown OK"); | ||
| 65 | } | ||
| 66 | |||
| 67 | } // namespace LCD | ||
diff --git a/src/core/hw/lcd.h b/src/core/hw/lcd.h deleted file mode 100644 index d2db9700f..000000000 --- a/src/core/hw/lcd.h +++ /dev/null | |||
| @@ -1,86 +0,0 @@ | |||
| 1 | // Copyright 2015 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <cstddef> | ||
| 8 | #include <type_traits> | ||
| 9 | #include "common/bit_field.h" | ||
| 10 | #include "common/common_funcs.h" | ||
| 11 | #include "common/common_types.h" | ||
| 12 | |||
| 13 | #define LCD_REG_INDEX(field_name) (offsetof(LCD::Regs, field_name) / sizeof(u32)) | ||
| 14 | |||
| 15 | namespace LCD { | ||
| 16 | |||
| 17 | struct Regs { | ||
| 18 | |||
| 19 | union ColorFill { | ||
| 20 | u32 raw; | ||
| 21 | |||
| 22 | BitField<0, 8, u32> color_r; | ||
| 23 | BitField<8, 8, u32> color_g; | ||
| 24 | BitField<16, 8, u32> color_b; | ||
| 25 | BitField<24, 1, u32> is_enabled; | ||
| 26 | }; | ||
| 27 | |||
| 28 | INSERT_PADDING_WORDS(0x81); | ||
| 29 | ColorFill color_fill_top; | ||
| 30 | INSERT_PADDING_WORDS(0xE); | ||
| 31 | u32 backlight_top; | ||
| 32 | |||
| 33 | INSERT_PADDING_WORDS(0x1F0); | ||
| 34 | |||
| 35 | ColorFill color_fill_bottom; | ||
| 36 | INSERT_PADDING_WORDS(0xE); | ||
| 37 | u32 backlight_bottom; | ||
| 38 | INSERT_PADDING_WORDS(0x16F); | ||
| 39 | |||
| 40 | static constexpr size_t NumIds() { | ||
| 41 | return sizeof(Regs) / sizeof(u32); | ||
| 42 | } | ||
| 43 | |||
| 44 | const u32& operator[](int index) const { | ||
| 45 | const u32* content = reinterpret_cast<const u32*>(this); | ||
| 46 | return content[index]; | ||
| 47 | } | ||
| 48 | |||
| 49 | u32& operator[](int index) { | ||
| 50 | u32* content = reinterpret_cast<u32*>(this); | ||
| 51 | return content[index]; | ||
| 52 | } | ||
| 53 | }; | ||
| 54 | static_assert(std::is_standard_layout<Regs>::value, "Structure does not use standard layout"); | ||
| 55 | |||
| 56 | // TODO: MSVC does not support using offsetof() on non-static data members even though this | ||
| 57 | // is technically allowed since C++11. This macro should be enabled once MSVC adds | ||
| 58 | // support for that. | ||
| 59 | #ifndef _MSC_VER | ||
| 60 | #define ASSERT_REG_POSITION(field_name, position) \ | ||
| 61 | static_assert(offsetof(Regs, field_name) == position * 4, \ | ||
| 62 | "Field " #field_name " has invalid position") | ||
| 63 | |||
| 64 | ASSERT_REG_POSITION(color_fill_top, 0x81); | ||
| 65 | ASSERT_REG_POSITION(backlight_top, 0x90); | ||
| 66 | ASSERT_REG_POSITION(color_fill_bottom, 0x281); | ||
| 67 | ASSERT_REG_POSITION(backlight_bottom, 0x290); | ||
| 68 | |||
| 69 | #undef ASSERT_REG_POSITION | ||
| 70 | #endif // !defined(_MSC_VER) | ||
| 71 | |||
| 72 | extern Regs g_regs; | ||
| 73 | |||
| 74 | template <typename T> | ||
| 75 | void Read(T& var, const u32 addr); | ||
| 76 | |||
| 77 | template <typename T> | ||
| 78 | void Write(u32 addr, const T data); | ||
| 79 | |||
| 80 | /// Initialize hardware | ||
| 81 | void Init(); | ||
| 82 | |||
| 83 | /// Shutdown hardware | ||
| 84 | void Shutdown(); | ||
| 85 | |||
| 86 | } // namespace LCD | ||