aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/CMakeLists.txt1
-rw-r--r--src/core/arm/arm_interface.h1
-rw-r--r--src/core/arm/dyncom/arm_dyncom.cpp2
-rw-r--r--src/core/arm/interpreter/armsupp.cpp2
-rw-r--r--src/core/arm/skyeye_common/armmmu.h2
-rw-r--r--src/core/arm/skyeye_common/vfp/vfp.cpp1
-rw-r--r--src/core/core.cpp1
-rw-r--r--src/core/core_timing.h2
-rw-r--r--src/core/file_sys/archive_backend.cpp127
-rw-r--r--src/core/file_sys/archive_backend.h147
-rw-r--r--src/core/file_sys/archive_extsavedata.cpp1
-rw-r--r--src/core/file_sys/archive_romfs.cpp1
-rw-r--r--src/core/file_sys/archive_savedata.cpp1
-rw-r--r--src/core/file_sys/archive_savedatacheck.cpp1
-rw-r--r--src/core/file_sys/archive_sdmc.cpp1
-rw-r--r--src/core/file_sys/directory_backend.h3
-rw-r--r--src/core/file_sys/disk_archive.cpp1
-rw-r--r--src/core/file_sys/disk_archive.h2
-rw-r--r--src/core/file_sys/file_backend.h2
-rw-r--r--src/core/file_sys/ivfc_archive.cpp1
-rw-r--r--src/core/file_sys/ivfc_archive.h2
-rw-r--r--src/core/hle/config_mem.cpp5
-rw-r--r--src/core/hle/hle.h7
-rw-r--r--src/core/hle/kernel/address_arbiter.cpp1
-rw-r--r--src/core/hle/kernel/event.cpp2
-rw-r--r--src/core/hle/kernel/kernel.cpp3
-rw-r--r--src/core/hle/kernel/kernel.h14
-rw-r--r--src/core/hle/kernel/mutex.cpp2
-rw-r--r--src/core/hle/kernel/semaphore.cpp2
-rw-r--r--src/core/hle/kernel/shared_memory.cpp2
-rw-r--r--src/core/hle/kernel/thread.cpp4
-rw-r--r--src/core/hle/kernel/timer.cpp3
-rw-r--r--src/core/hle/result.h1
-rw-r--r--src/core/hle/service/am_sys.cpp2
-rw-r--r--src/core/hle/service/apt/apt.cpp2
-rw-r--r--src/core/hle/service/apt/apt_s.cpp3
-rw-r--r--src/core/hle/service/apt/apt_u.cpp1
-rw-r--r--src/core/hle/service/cfg/cfg.cpp8
-rw-r--r--src/core/hle/service/cfg/cfg_u.cpp2
-rw-r--r--src/core/hle/service/dsp_dsp.cpp2
-rw-r--r--src/core/hle/service/err_f.cpp2
-rw-r--r--src/core/hle/service/fs/archive.cpp11
-rw-r--r--src/core/hle/service/fs/archive.h16
-rw-r--r--src/core/hle/service/fs/fs_user.cpp5
-rw-r--r--src/core/hle/service/hid/hid.cpp2
-rw-r--r--src/core/hle/service/ldr_ro.cpp2
-rw-r--r--src/core/hle/service/nim_u.cpp2
-rw-r--r--src/core/hle/service/ns_s.cpp2
-rw-r--r--src/core/hle/service/nwm_uds.cpp2
-rw-r--r--src/core/hle/service/ptm/ptm.cpp3
-rw-r--r--src/core/hle/service/ptm/ptm_u.cpp2
-rw-r--r--src/core/hle/service/service.cpp2
-rw-r--r--src/core/hle/service/service.h2
-rw-r--r--src/core/hle/service/soc_u.cpp1
-rw-r--r--src/core/hle/service/srv.cpp2
-rw-r--r--src/core/hle/service/y2r_u.cpp2
-rw-r--r--src/core/hle/shared_page.cpp4
-rw-r--r--src/core/hle/svc.cpp3
-rw-r--r--src/core/hw/gpu.h4
-rw-r--r--src/core/hw/hw.cpp1
-rw-r--r--src/core/hw/lcd.cpp3
-rw-r--r--src/core/hw/lcd.h3
-rw-r--r--src/core/loader/3dsx.cpp2
-rw-r--r--src/core/loader/elf.cpp3
-rw-r--r--src/core/loader/loader.cpp1
-rw-r--r--src/core/loader/loader.h2
-rw-r--r--src/core/loader/ncch.cpp2
-rw-r--r--src/core/loader/ncch.h4
-rw-r--r--src/core/mem_map.cpp4
-rw-r--r--src/core/mem_map.h3
-rw-r--r--src/core/mem_map_funcs.cpp4
71 files changed, 278 insertions, 191 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 42733b95..fa6b4215 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -12,6 +12,7 @@ set(SRCS
arm/skyeye_common/vfp/vfpdouble.cpp
arm/skyeye_common/vfp/vfpinstr.cpp
arm/skyeye_common/vfp/vfpsingle.cpp
+ file_sys/archive_backend.cpp
file_sys/archive_extsavedata.cpp
file_sys/archive_romfs.cpp
file_sys/archive_savedata.cpp
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h
index 31066377..85ed2c69 100644
--- a/src/core/arm/arm_interface.h
+++ b/src/core/arm/arm_interface.h
@@ -4,7 +4,6 @@
#pragma once
-#include "common/common.h"
#include "common/common_types.h"
#include "core/arm/skyeye_common/arm_regformat.h"
diff --git a/src/core/arm/dyncom/arm_dyncom.cpp b/src/core/arm/dyncom/arm_dyncom.cpp
index 12841326..42a63e46 100644
--- a/src/core/arm/dyncom/arm_dyncom.cpp
+++ b/src/core/arm/dyncom/arm_dyncom.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include <cstring>
+
#include "common/make_unique.h"
#include "core/arm/skyeye_common/armemu.h"
diff --git a/src/core/arm/interpreter/armsupp.cpp b/src/core/arm/interpreter/armsupp.cpp
index a68d5369..15c6f595 100644
--- a/src/core/arm/interpreter/armsupp.cpp
+++ b/src/core/arm/interpreter/armsupp.cpp
@@ -15,6 +15,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+#include "common/logging/log.h"
+
#include "core/mem_map.h"
#include "core/arm/skyeye_common/armdefs.h"
#include "core/arm/skyeye_common/arm_regformat.h"
diff --git a/src/core/arm/skyeye_common/armmmu.h b/src/core/arm/skyeye_common/armmmu.h
index 22e564c3..0463d83c 100644
--- a/src/core/arm/skyeye_common/armmmu.h
+++ b/src/core/arm/skyeye_common/armmmu.h
@@ -20,6 +20,8 @@
#pragma once
+#include "common/swap.h"
+
#include "core/mem_map.h"
#include "core/arm/skyeye_common/armdefs.h"
diff --git a/src/core/arm/skyeye_common/vfp/vfp.cpp b/src/core/arm/skyeye_common/vfp/vfp.cpp
index d0fa157a..b88d4775 100644
--- a/src/core/arm/skyeye_common/vfp/vfp.cpp
+++ b/src/core/arm/skyeye_common/vfp/vfp.cpp
@@ -20,7 +20,6 @@
/* Note: this file handles interface with arm core and vfp registers */
-#include "common/common.h"
#include "common/logging/log.h"
#include "core/arm/skyeye_common/armdefs.h"
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 81e64231..1c9680d4 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include "common/common_types.h"
+#include "common/logging/log.h"
#include "core/core.h"
#include "core/core_timing.h"
diff --git a/src/core/core_timing.h b/src/core/core_timing.h
index d62ff360..01519608 100644
--- a/src/core/core_timing.h
+++ b/src/core/core_timing.h
@@ -21,7 +21,7 @@
#include <functional>
-#include "common/common.h"
+#include "common/common_types.h"
extern int g_clock_rate_arm11;
diff --git a/src/core/file_sys/archive_backend.cpp b/src/core/file_sys/archive_backend.cpp
new file mode 100644
index 00000000..0439868a
--- /dev/null
+++ b/src/core/file_sys/archive_backend.cpp
@@ -0,0 +1,127 @@
+// Copyright 2015 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include <sstream>
+
+#include "common/logging/log.h"
+#include "common/string_util.h"
+
+#include "core/file_sys/archive_backend.h"
+#include "core/mem_map.h"
+
+
+namespace FileSys {
+
+Path::Path(LowPathType type, u32 size, u32 pointer) : type(type) {
+ switch (type) {
+ case Binary:
+ {
+ u8* data = Memory::GetPointer(pointer);
+ binary = std::vector<u8>(data, data + size);
+ break;
+ }
+
+ case Char:
+ {
+ const char* data = reinterpret_cast<const char*>(Memory::GetPointer(pointer));
+ string = std::string(data, size - 1); // Data is always null-terminated.
+ break;
+ }
+
+ case Wchar:
+ {
+ const char16_t* data = reinterpret_cast<const char16_t*>(Memory::GetPointer(pointer));
+ u16str = std::u16string(data, size/2 - 1); // Data is always null-terminated.
+ break;
+ }
+
+ default:
+ break;
+ }
+}
+
+const std::string Path::DebugStr() const {
+ switch (GetType()) {
+ case Invalid:
+ default:
+ return "[Invalid]";
+ case Empty:
+ return "[Empty]";
+ case Binary:
+ {
+ std::stringstream res;
+ res << "[Binary: ";
+ for (unsigned byte : binary)
+ res << std::hex << std::setw(2) << std::setfill('0') << byte;
+ res << ']';
+ return res.str();
+ }
+ case Char:
+ return "[Char: " + AsString() + ']';
+ case Wchar:
+ return "[Wchar: " + AsString() + ']';
+ }
+}
+
+const std::string Path::AsString() const {
+ switch (GetType()) {
+ case Char:
+ return string;
+ case Wchar:
+ return Common::UTF16ToUTF8(u16str);
+ case Empty:
+ return{};
+ case Invalid:
+ case Binary:
+ default:
+ // TODO(yuriks): Add assert
+ LOG_ERROR(Service_FS, "LowPathType cannot be converted to string!");
+ return{};
+ }
+}
+
+const std::u16string Path::AsU16Str() const {
+ switch (GetType()) {
+ case Char:
+ return Common::UTF8ToUTF16(string);
+ case Wchar:
+ return u16str;
+ case Empty:
+ return{};
+ case Invalid:
+ case Binary:
+ // TODO(yuriks): Add assert
+ LOG_ERROR(Service_FS, "LowPathType cannot be converted to u16string!");
+ return{};
+ }
+}
+
+const std::vector<u8> Path::AsBinary() const {
+ switch (GetType()) {
+ case Binary:
+ return binary;
+ case Char:
+ return std::vector<u8>(string.begin(), string.end());
+ case Wchar:
+ {
+ // use two u8 for each character of u16str
+ std::vector<u8> to_return(u16str.size() * 2);
+ for (size_t i = 0; i < u16str.size(); ++i) {
+ u16 tmp_char = u16str.at(i);
+ to_return[i*2] = (tmp_char & 0xFF00) >> 8;
+ to_return[i*2 + 1] = (tmp_char & 0x00FF);
+ }
+ return to_return;
+ }
+ case Empty:
+ return{};
+ case Invalid:
+ default:
+ // TODO(yuriks): Add assert
+ LOG_ERROR(Service_FS, "LowPathType cannot be converted to binary!");
+ return{};
+ }
+}
+
+}
diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h
index 43a10654..c6a1be79 100644
--- a/src/core/file_sys/archive_backend.h
+++ b/src/core/file_sys/archive_backend.h
@@ -5,22 +5,21 @@
#pragma once
#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
-#include "common/common_types.h"
-#include "common/string_util.h"
#include "common/bit_field.h"
+#include "common/common_types.h"
-#include "core/file_sys/file_backend.h"
-#include "core/file_sys/directory_backend.h"
-
-#include "core/mem_map.h"
-#include "core/hle/kernel/kernel.h"
+#include "core/hle/result.h"
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// FileSys namespace
namespace FileSys {
+class FileBackend;
+class DirectoryBackend;
+
// Path string type
enum LowPathType : u32 {
Invalid = 0,
@@ -39,134 +38,22 @@ union Mode {
class Path {
public:
+ Path() : type(Invalid) {}
+ Path(const char* path) : type(Char), string(path) {}
+ Path(std::vector<u8> binary_data) : type(Binary), binary(std::move(binary_data)) {}
+ Path(LowPathType type, u32 size, u32 pointer);
- Path() : type(Invalid) {
- }
-
- Path(const char* path) : type(Char), string(path) {
- }
-
- Path(std::vector<u8> binary_data) : type(Binary), binary(std::move(binary_data)) {
- }
-
- Path(LowPathType type, u32 size, u32 pointer) : type(type) {
- switch (type) {
- case Binary:
- {
- u8* data = Memory::GetPointer(pointer);
- binary = std::vector<u8>(data, data + size);
- break;
- }
-
- case Char:
- {
- const char* data = reinterpret_cast<const char*>(Memory::GetPointer(pointer));
- string = std::string(data, size - 1); // Data is always null-terminated.
- break;
- }
-
- case Wchar:
- {
- const char16_t* data = reinterpret_cast<const char16_t*>(Memory::GetPointer(pointer));
- u16str = std::u16string(data, size/2 - 1); // Data is always null-terminated.
- break;
- }
-
- default:
- break;
- }
- }
-
- LowPathType GetType() const {
- return type;
- }
+ LowPathType GetType() const { return type; }
/**
* Gets the string representation of the path for debugging
* @return String representation of the path for debugging
*/
- const std::string DebugStr() const {
- switch (GetType()) {
- case Invalid:
- default:
- return "[Invalid]";
- case Empty:
- return "[Empty]";
- case Binary:
- {
- std::stringstream res;
- res << "[Binary: ";
- for (unsigned byte : binary)
- res << std::hex << std::setw(2) << std::setfill('0') << byte;
- res << ']';
- return res.str();
- }
- case Char:
- return "[Char: " + AsString() + ']';
- case Wchar:
- return "[Wchar: " + AsString() + ']';
- }
- }
+ const std::string DebugStr() const;
- const std::string AsString() const {
- switch (GetType()) {
- case Char:
- return string;
- case Wchar:
- return Common::UTF16ToUTF8(u16str);
- case Empty:
- return {};
- case Invalid:
- case Binary:
- default:
- // TODO(yuriks): Add assert
- LOG_ERROR(Service_FS, "LowPathType cannot be converted to string!");
- return {};
- }
- }
-
- const std::u16string AsU16Str() const {
- switch (GetType()) {
- case Char:
- return Common::UTF8ToUTF16(string);
- case Wchar:
- return u16str;
- case Empty:
- return {};
- case Invalid:
- case Binary:
- // TODO(yuriks): Add assert
- LOG_ERROR(Service_FS, "LowPathType cannot be converted to u16string!");
- return {};
- }
- }
-
- const std::vector<u8> AsBinary() const {
- switch (GetType()) {
- case Binary:
- return binary;
- case Char:
- return std::vector<u8>(string.begin(), string.end());
- case Wchar:
- {
- // use two u8 for each character of u16str
- std::vector<u8> to_return(u16str.size() * 2);
- for (size_t i = 0; i < u16str.size(); ++i) {
- u16 tmp_char = u16str.at(i);
- to_return[i*2] = (tmp_char & 0xFF00) >> 8;
- to_return[i*2 + 1] = (tmp_char & 0x00FF);
- }
- return to_return;
- }
- case Empty:
- return {};
- case Invalid:
- default:
- // TODO(yuriks): Add assert
- LOG_ERROR(Service_FS, "LowPathType cannot be converted to binary!");
- return {};
- }
- }
+ const std::string AsString() const;
+ const std::u16string AsU16Str() const;
+ const std::vector<u8> AsBinary() const;
private:
LowPathType type;
diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp
index 3076fa26..38d498d0 100644
--- a/src/core/file_sys/archive_extsavedata.cpp
+++ b/src/core/file_sys/archive_extsavedata.cpp
@@ -6,6 +6,7 @@
#include "common/common_types.h"
#include "common/file_util.h"
+#include "common/logging/log.h"
#include "common/make_unique.h"
#include "core/file_sys/archive_extsavedata.h"
diff --git a/src/core/file_sys/archive_romfs.cpp b/src/core/file_sys/archive_romfs.cpp
index bf54a386..d4a12ed1 100644
--- a/src/core/file_sys/archive_romfs.cpp
+++ b/src/core/file_sys/archive_romfs.cpp
@@ -6,6 +6,7 @@
#include "common/common_types.h"
#include "common/file_util.h"
+#include "common/logging/log.h"
#include "common/make_unique.h"
#include "core/file_sys/archive_romfs.h"
diff --git a/src/core/file_sys/archive_savedata.cpp b/src/core/file_sys/archive_savedata.cpp
index 8496e06f..12624fa3 100644
--- a/src/core/file_sys/archive_savedata.cpp
+++ b/src/core/file_sys/archive_savedata.cpp
@@ -6,6 +6,7 @@
#include "common/common_types.h"
#include "common/file_util.h"
+#include "common/logging/log.h"
#include "common/make_unique.h"
#include "core/file_sys/archive_savedata.h"
diff --git a/src/core/file_sys/archive_savedatacheck.cpp b/src/core/file_sys/archive_savedatacheck.cpp
index 47d8a9d2..e7e4fbf1 100644
--- a/src/core/file_sys/archive_savedatacheck.cpp
+++ b/src/core/file_sys/archive_savedatacheck.cpp
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include "common/file_util.h"
+#include "common/logging/log.h"
#include "common/make_unique.h"
#include "core/file_sys/archive_savedatacheck.h"
diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp
index 92b20c7f..c1234a18 100644
--- a/src/core/file_sys/archive_sdmc.cpp
+++ b/src/core/file_sys/archive_sdmc.cpp
@@ -6,6 +6,7 @@
#include "common/common_types.h"
#include "common/file_util.h"
+#include "common/logging/log.h"
#include "common/make_unique.h"
#include "core/file_sys/archive_sdmc.h"
diff --git a/src/core/file_sys/directory_backend.h b/src/core/file_sys/directory_backend.h
index 7f327dc4..a25dc0cf 100644
--- a/src/core/file_sys/directory_backend.h
+++ b/src/core/file_sys/directory_backend.h
@@ -4,12 +4,11 @@
#pragma once
+#include <array>
#include <cstddef>
#include "common/common_types.h"
-#include "core/hle/kernel/kernel.h"
-
////////////////////////////////////////////////////////////////////////////////////////////////////
// FileSys namespace
diff --git a/src/core/file_sys/disk_archive.cpp b/src/core/file_sys/disk_archive.cpp
index f53fd57d..9980cced 100644
--- a/src/core/file_sys/disk_archive.cpp
+++ b/src/core/file_sys/disk_archive.cpp
@@ -6,6 +6,7 @@
#include "common/common_types.h"
#include "common/file_util.h"
+#include "common/logging/log.h"
#include "common/make_unique.h"
#include "core/file_sys/disk_archive.h"
diff --git a/src/core/file_sys/disk_archive.h b/src/core/file_sys/disk_archive.h
index 770bd715..a22d3837 100644
--- a/src/core/file_sys/disk_archive.h
+++ b/src/core/file_sys/disk_archive.h
@@ -8,6 +8,8 @@
#include "common/file_util.h"
#include "core/file_sys/archive_backend.h"
+#include "core/file_sys/directory_backend.h"
+#include "core/file_sys/file_backend.h"
#include "core/loader/loader.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/file_sys/file_backend.h b/src/core/file_sys/file_backend.h
index 35890af1..0fcff184 100644
--- a/src/core/file_sys/file_backend.h
+++ b/src/core/file_sys/file_backend.h
@@ -6,8 +6,6 @@
#include "common/common_types.h"
-#include "core/hle/kernel/kernel.h"
-
////////////////////////////////////////////////////////////////////////////////////////////////////
// FileSys namespace
diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp
index 35aca54f..2d2509d1 100644
--- a/src/core/file_sys/ivfc_archive.cpp
+++ b/src/core/file_sys/ivfc_archive.cpp
@@ -6,6 +6,7 @@
#include "common/common_types.h"
#include "common/file_util.h"
+#include "common/logging/log.h"
#include "common/make_unique.h"
#include "core/file_sys/ivfc_archive.h"
diff --git a/src/core/file_sys/ivfc_archive.h b/src/core/file_sys/ivfc_archive.h
index 1aff9e0a..10415798 100644
--- a/src/core/file_sys/ivfc_archive.h
+++ b/src/core/file_sys/ivfc_archive.h
@@ -10,6 +10,8 @@
#include "common/common_types.h"
#include "core/file_sys/archive_backend.h"
+#include "core/file_sys/directory_backend.h"
+#include "core/file_sys/file_backend.h"
#include "core/loader/loader.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/hle/config_mem.cpp b/src/core/hle/config_mem.cpp
index 9fcfcc28..35dc9cf5 100644
--- a/src/core/hle/config_mem.cpp
+++ b/src/core/hle/config_mem.cpp
@@ -2,6 +2,9 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include <cstring>
+
+#include "common/assert.h"
#include "common/common_types.h"
#include "common/common_funcs.h"
@@ -61,7 +64,7 @@ template void Read<u16>(u16 &var, const u32 addr);
template void Read<u8>(u8 &var, const u32 addr);
void Init() {
- memset(&config_mem, 0, sizeof(config_mem));
+ std::memset(&config_mem, 0, sizeof(config_mem));
config_mem.update_flag = 0; // No update
config_mem.sys_core_ver = 0x2;
diff --git a/src/core/hle/hle.h b/src/core/hle/hle.h
index 23de1aab..e0b97797 100644
--- a/src/core/hle/hle.h
+++ b/src/core/hle/hle.h
@@ -4,6 +4,13 @@
#pragma once
+#include "common/common_types.h"
+
+typedef u32 Handle;
+typedef s32 Result;
+
+const Handle INVALID_HANDLE = 0;
+
namespace HLE {
extern bool g_reschedule; ///< If true, immediately reschedules the CPU to a new thread
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp
index 19135266..9d7f6b28 100644
--- a/src/core/hle/kernel/address_arbiter.cpp
+++ b/src/core/hle/kernel/address_arbiter.cpp
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include "common/common_types.h"
+#include "common/logging/log.h"
#include "core/mem_map.h"
diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp
index 420906ec..f338f326 100644
--- a/src/core/hle/kernel/event.cpp
+++ b/src/core/hle/kernel/event.cpp
@@ -6,7 +6,7 @@
#include <algorithm>
#include <vector>
-#include "common/common.h"
+#include "common/assert.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/event.h"
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index fca582bb..533fe65f 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -4,7 +4,8 @@
#include <algorithm>
-#include "common/common.h"
+#include "common/assert.h"
+#include "common/logging/log.h"
#include "core/arm/arm_interface.h"
#include "core/core.h"
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index ab06fa02..a7bc6b71 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -10,18 +10,10 @@
#include <string>
#include <vector>
-#include "common/common.h"
-#include "core/hle/result.h"
-
-typedef u32 Handle;
-typedef s32 Result;
+#include "common/common_types.h"
-// TODO: It would be nice to eventually replace these with strong types that prevent accidental
-// conversion between each other.
-typedef u32 VAddr; ///< Represents a pointer in the userspace virtual address space.
-typedef u32 PAddr; ///< Represents a pointer in the ARM11 physical address space.
-
-const Handle INVALID_HANDLE = 0;
+#include "core/hle/hle.h"
+#include "core/hle/result.h"
namespace Kernel {
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp
index ebc9e79d..f530217f 100644
--- a/src/core/hle/kernel/mutex.cpp
+++ b/src/core/hle/kernel/mutex.cpp
@@ -7,7 +7,7 @@
#include <boost/range/algorithm_ext/erase.hpp>
-#include "common/common.h"
+#include "common/assert.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/mutex.h"
diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp
index 6aecc24a..5d6543ef 100644
--- a/src/core/hle/kernel/semaphore.cpp
+++ b/src/core/hle/kernel/semaphore.cpp
@@ -2,7 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include "common/common.h"
+#include "common/assert.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/semaphore.h"
diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp
index 9b2511b5..cb5c1669 100644
--- a/src/core/hle/kernel/shared_memory.cpp
+++ b/src/core/hle/kernel/shared_memory.cpp
@@ -2,7 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include "common/common.h"
+#include "common/logging/log.h"
#include "core/mem_map.h"
#include "core/hle/kernel/shared_memory.h"
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index d678f5f6..9577b889 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -6,7 +6,9 @@
#include <list>
#include <vector>
-#include "common/common.h"
+#include "common/assert.h"
+#include "common/common_types.h"
+#include "common/logging/log.h"
#include "common/math_util.h"
#include "common/thread_queue_list.h"
diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp
index 36979248..e69fece6 100644
--- a/src/core/hle/kernel/timer.cpp
+++ b/src/core/hle/kernel/timer.cpp
@@ -2,7 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include "common/common.h"
+#include "common/assert.h"
+#include "common/logging/log.h"
#include "core/core_timing.h"
#include "core/hle/kernel/kernel.h"
diff --git a/src/core/hle/result.h b/src/core/hle/result.h
index 3648a168..ce633d84 100644
--- a/src/core/hle/result.h
+++ b/src/core/hle/result.h
@@ -8,6 +8,7 @@
#include <type_traits>
#include <utility>
+#include "common/assert.h"
#include "common/bit_field.h"
#include "common/common_funcs.h"
#include "common/common_types.h"
diff --git a/src/core/hle/service/am_sys.cpp b/src/core/hle/service/am_sys.cpp
index b244190a..f9e3fe4b 100644
--- a/src/core/hle/service/am_sys.cpp
+++ b/src/core/hle/service/am_sys.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include "common/logging/log.h"
+
#include "core/hle/hle.h"
#include "core/hle/service/am_sys.h"
diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp
index 98ae80b3..560c9dcf 100644
--- a/src/core/hle/service/apt/apt.cpp
+++ b/src/core/hle/service/apt/apt.cpp
@@ -2,7 +2,9 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include "common/common_paths.h"
#include "common/file_util.h"
+#include "common/logging/log.h"
#include "core/hle/service/service.h"
#include "core/hle/service/apt/apt.h"
diff --git a/src/core/hle/service/apt/apt_s.cpp b/src/core/hle/service/apt/apt_s.cpp
index 3fd34865..396d1f04 100644
--- a/src/core/hle/service/apt/apt_s.cpp
+++ b/src/core/hle/service/apt/apt_s.cpp
@@ -3,9 +3,6 @@
// Refer to the license.txt file included.
-#include "common/common.h"
-#include "common/file_util.h"
-
#include "core/hle/hle.h"
#include "core/hle/service/apt/apt.h"
#include "core/hle/service/apt/apt_s.h"
diff --git a/src/core/hle/service/apt/apt_u.cpp b/src/core/hle/service/apt/apt_u.cpp
index 5ab23801..d006b593 100644
--- a/src/core/hle/service/apt/apt_u.cpp
+++ b/src/core/hle/service/apt/apt_u.cpp
@@ -3,7 +3,6 @@
// Refer to the license.txt file included.
-#include "common/common.h"
#include "common/file_util.h"
#include "core/hle/service/apt/apt.h"
diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp
index 5eccdecf..2d26c933 100644
--- a/src/core/hle/service/cfg/cfg.cpp
+++ b/src/core/hle/service/cfg/cfg.cpp
@@ -4,12 +4,16 @@
#include <algorithm>
-#include "core/hle/service/fs/archive.h"
-#include "core/hle/service/service.h"
+#include "common/logging/log.h"
+#include "common/string_util.h"
+
+#include "core/file_sys/file_backend.h"
#include "core/hle/service/cfg/cfg.h"
#include "core/hle/service/cfg/cfg_i.h"
#include "core/hle/service/cfg/cfg_s.h"
#include "core/hle/service/cfg/cfg_u.h"
+#include "core/hle/service/fs/archive.h"
+#include "core/hle/service/service.h"
namespace Service {
namespace CFG {
diff --git a/src/core/hle/service/cfg/cfg_u.cpp b/src/core/hle/service/cfg/cfg_u.cpp
index c8c1c5b1..221de991 100644
--- a/src/core/hle/service/cfg/cfg_u.cpp
+++ b/src/core/hle/service/cfg/cfg_u.cpp
@@ -3,7 +3,9 @@
// Refer to the license.txt file included.
#include "common/file_util.h"
+#include "common/logging/log.h"
#include "common/string_util.h"
+
#include "core/settings.h"
#include "core/file_sys/archive_systemsavedata.h"
#include "core/hle/hle.h"
diff --git a/src/core/hle/service/dsp_dsp.cpp b/src/core/hle/service/dsp_dsp.cpp
index 2e759a3e..20dc4d64 100644
--- a/src/core/hle/service/dsp_dsp.cpp
+++ b/src/core/hle/service/dsp_dsp.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include "common/logging/log.h"
+
#include "core/hle/hle.h"
#include "core/hle/kernel/event.h"
#include "core/hle/service/dsp_dsp.h"
diff --git a/src/core/hle/service/err_f.cpp b/src/core/hle/service/err_f.cpp
index 58c5acd1..e8c06c1c 100644
--- a/src/core/hle/service/err_f.cpp
+++ b/src/core/hle/service/err_f.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include "common/logging/log.h"
+
#include "core/hle/hle.h"
#include "core/hle/service/err_f.h"
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp
index b0fd834c..6d4a9c7c 100644
--- a/src/core/hle/service/fs/archive.cpp
+++ b/src/core/hle/service/fs/archive.cpp
@@ -9,6 +9,7 @@
#include "common/common_types.h"
#include "common/file_util.h"
+#include "common/logging/log.h"
#include "common/make_unique.h"
#include "common/math_util.h"
@@ -78,6 +79,11 @@ enum class DirectoryCommand : u32 {
Close = 0x08020000,
};
+File::File(std::unique_ptr<FileSys::FileBackend>&& backend, const FileSys::Path & path)
+ : path(path), priority(0), backend(std::move(backend)) {}
+
+File::~File() {}
+
ResultVal<bool> File::SyncRequest() {
u32* cmd_buff = Kernel::GetCommandBuffer();
FileCommand cmd = static_cast<FileCommand>(cmd_buff[0]);
@@ -172,6 +178,11 @@ ResultVal<bool> File::SyncRequest() {
return MakeResult<bool>(false);
}
+Directory::Directory(std::unique_ptr<FileSys::DirectoryBackend>&& backend, const FileSys::Path & path)
+ : path(path), backend(std::move(backend)) {}
+
+Directory::~Directory() {}
+
ResultVal<bool> Directory::SyncRequest() {
u32* cmd_buff = Kernel::GetCommandBuffer();
DirectoryCommand cmd = static_cast<DirectoryCommand>(cmd_buff[0]);
diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h
index b00f0fd6..faab0cb7 100644
--- a/src/core/hle/service/fs/archive.h
+++ b/src/core/hle/service/fs/archive.h
@@ -45,31 +45,27 @@ typedef u64 ArchiveHandle;
class File : public Kernel::Session {
public:
- File(std::unique_ptr<FileSys::FileBackend>&& backend, const FileSys::Path& path)
- : path(path), priority(0), backend(std::move(backend)) {
- }
+ File(std::unique_ptr<FileSys::FileBackend>&& backend, const FileSys::Path& path);
+ ~File();
std::string GetName() const override { return "Path: " + path.DebugStr(); }
+ ResultVal<bool> SyncRequest() override;
FileSys::Path path; ///< Path of the file
u32 priority; ///< Priority of the file. TODO(Subv): Find out what this means
std::unique_ptr<FileSys::FileBackend> backend; ///< File backend interface
-
- ResultVal<bool> SyncRequest() override;
};
class Directory : public Kernel::Session {
public:
- Directory(std::unique_ptr<FileSys::DirectoryBackend>&& backend, const FileSys::Path& path)
- : path(path), backend(std::move(backend)) {
- }
+ Directory(std::unique_ptr<FileSys::DirectoryBackend>&& backend, const FileSys::Path& path);
+ ~Directory();
std::string GetName() const override { return "Directory: " + path.DebugStr(); }
+ ResultVal<bool> SyncRequest() override;
FileSys::Path path; ///< Path of the directory
std::unique_ptr<FileSys::DirectoryBackend> backend; ///< File backend interface
-
- ResultVal<bool> SyncRequest() override;
};
/**
diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp
index 5bc94b1b..0d2a426b 100644
--- a/src/core/hle/service/fs/fs_user.cpp
+++ b/src/core/hle/service/fs/fs_user.cpp
@@ -2,10 +2,13 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include "common/common.h"
+#include "common/assert.h"
+#include "common/common_types.h"
#include "common/file_util.h"
+#include "common/logging/log.h"
#include "common/scope_exit.h"
#include "common/string_util.h"
+
#include "core/hle/result.h"
#include "core/hle/service/fs/archive.h"
#include "core/hle/service/fs/fs_user.h"
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 0f30f743..dd85848d 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include "common/logging/log.h"
+
#include "core/hle/service/service.h"
#include "core/hle/service/hid/hid.h"
#include "core/hle/service/hid/hid_spvr.h"
diff --git a/src/core/hle/service/ldr_ro.cpp b/src/core/hle/service/ldr_ro.cpp
index c0c4a234..155b97f6 100644
--- a/src/core/hle/service/ldr_ro.cpp
+++ b/src/core/hle/service/ldr_ro.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include "common/logging/log.h"
+
#include "core/hle/hle.h"
#include "core/hle/service/ldr_ro.h"
diff --git a/src/core/hle/service/nim_u.cpp b/src/core/hle/service/nim_u.cpp
index a87d17ef..5f13bd98 100644
--- a/src/core/hle/service/nim_u.cpp
+++ b/src/core/hle/service/nim_u.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include "common/logging/log.h"
+
#include "core/hle/hle.h"
#include "core/hle/service/nim_u.h"
diff --git a/src/core/hle/service/ns_s.cpp b/src/core/hle/service/ns_s.cpp
index 5cf3e203..6b3ef6ec 100644
--- a/src/core/hle/service/ns_s.cpp
+++ b/src/core/hle/service/ns_s.cpp
@@ -3,8 +3,6 @@
// Refer to the license.txt file included.
-#include "common/common.h"
-
#include "core/hle/hle.h"
#include "core/hle/service/ns_s.h"
diff --git a/src/core/hle/service/nwm_uds.cpp b/src/core/hle/service/nwm_uds.cpp
index 4b06efc3..25b01860 100644
--- a/src/core/hle/service/nwm_uds.cpp
+++ b/src/core/hle/service/nwm_uds.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include "common/logging/log.h"
+
#include "core/hle/hle.h"
#include "core/hle/kernel/event.h"
#include "core/hle/service/nwm_uds.h"
diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp
index d44510c1..6480a323 100644
--- a/src/core/hle/service/ptm/ptm.cpp
+++ b/src/core/hle/service/ptm/ptm.cpp
@@ -2,12 +2,13 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include "core/hle/service/service.h"
+#include "core/file_sys/file_backend.h"
#include "core/hle/service/fs/archive.h"
#include "core/hle/service/ptm/ptm.h"
#include "core/hle/service/ptm/ptm_play.h"
#include "core/hle/service/ptm/ptm_sysm.h"
#include "core/hle/service/ptm/ptm_u.h"
+#include "core/hle/service/service.h"
namespace Service {
namespace PTM {
diff --git a/src/core/hle/service/ptm/ptm_u.cpp b/src/core/hle/service/ptm/ptm_u.cpp
index 0af7c8bf..9d6a5b0d 100644
--- a/src/core/hle/service/ptm/ptm_u.cpp
+++ b/src/core/hle/service/ptm/ptm_u.cpp
@@ -2,7 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include "common/make_unique.h"
+#include "common/logging/log.h"
#include "core/hle/hle.h"
#include "core/hle/service/ptm/ptm.h"
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index d50327cb..64185c62 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -2,7 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include "common/common.h"
+#include "common/logging/log.h"
#include "common/string_util.h"
#include "core/hle/service/service.h"
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h
index 21ada67b..77bfb9ff 100644
--- a/src/core/hle/service/service.h
+++ b/src/core/hle/service/service.h
@@ -9,7 +9,7 @@
#include <boost/container/flat_map.hpp>
-#include "common/common.h"
+#include "common/common_types.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/session.h"
diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp
index 231ead18..39b8d65f 100644
--- a/src/core/hle/service/soc_u.cpp
+++ b/src/core/hle/service/soc_u.cpp
@@ -2,6 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include "common/logging/log.h"
#include "common/platform.h"
#if EMU_PLATFORM == PLATFORM_WINDOWS
diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp
index cc59a03c..6c49fa6c 100644
--- a/src/core/hle/service/srv.cpp
+++ b/src/core/hle/service/srv.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include "common/logging/log.h"
+
#include "core/hle/hle.h"
#include "core/hle/service/srv.h"
#include "core/hle/kernel/event.h"
diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp
index 33ecf64a..085192a0 100644
--- a/src/core/hle/service/y2r_u.cpp
+++ b/src/core/hle/service/y2r_u.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include "common/logging/log.h"
+
#include "core/hle/hle.h"
#include "core/hle/kernel/event.h"
#include "core/hle/service/y2r_u.h"
diff --git a/src/core/hle/shared_page.cpp b/src/core/hle/shared_page.cpp
index 94fae255..4f227a37 100644
--- a/src/core/hle/shared_page.cpp
+++ b/src/core/hle/shared_page.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include <cstring>
+
#include "common/common_types.h"
#include "common/common_funcs.h"
@@ -62,7 +64,7 @@ template void Read<u16>(u16 &var, const u32 addr);
template void Read<u8>(u8 &var, const u32 addr);
void Set3DSlider(float amount) {
- memset(&shared_page, 0, sizeof(shared_page));
+ std::memset(&shared_page, 0, sizeof(shared_page));
shared_page.sliderstate_3d = amount;
shared_page.ledstate_3d = (amount == 0.0f); // off when non-zero
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 2da488d8..393cfbe7 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -4,6 +4,7 @@
#include <map>
+#include "common/logging/log.h"
#include "common/profiler.h"
#include "common/string_util.h"
#include "common/symbols.h"
@@ -311,7 +312,7 @@ static ResultCode GetResourceLimit(Handle* resource_limit, Handle process) {
/// Get resource limit current values
static ResultCode GetResourceLimitCurrentValues(s64* values, Handle resource_limit, void* names,
s32 name_count) {
- LOG_ERROR(Kernel_SVC, "(UNIMPLEMENTED) called resource_limit=%08X, names=%s, name_count=%d",
+ LOG_ERROR(Kernel_SVC, "(UNIMPLEMENTED) called resource_limit=%08X, names=%p, name_count=%d",
resource_limit, names, name_count);
Memory::Write32(Core::g_app_core->GetReg(0), 0); // Normmatt: Set used memory to 0 for now
return RESULT_SUCCESS;
diff --git a/src/core/hw/gpu.h b/src/core/hw/gpu.h
index c8f88449..699bcd2a 100644
--- a/src/core/hw/gpu.h
+++ b/src/core/hw/gpu.h
@@ -6,8 +6,10 @@
#include <cstddef>
-#include "common/common_types.h"
+#include "common/assert.h"
#include "common/bit_field.h"
+#include "common/common_funcs.h"
+#include "common/common_types.h"
namespace GPU {
diff --git a/src/core/hw/hw.cpp b/src/core/hw/hw.cpp
index 23695813..f4906cc7 100644
--- a/src/core/hw/hw.cpp
+++ b/src/core/hw/hw.cpp
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include "common/common_types.h"
+#include "common/logging/log.h"
#include "core/hw/hw.h"
#include "core/hw/gpu.h"
diff --git a/src/core/hw/lcd.cpp b/src/core/hw/lcd.cpp
index 8a09c3bc..09134c95 100644
--- a/src/core/hw/lcd.cpp
+++ b/src/core/hw/lcd.cpp
@@ -2,7 +2,10 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include <cstring>
+
#include "common/common_types.h"
+#include "common/logging/log.h"
#include "core/arm/arm_interface.h"
#include "core/hle/hle.h"
diff --git a/src/core/hw/lcd.h b/src/core/hw/lcd.h
index 43893a62..fb14c3b2 100644
--- a/src/core/hw/lcd.h
+++ b/src/core/hw/lcd.h
@@ -6,8 +6,9 @@
#include <cstddef>
-#include "common/common_types.h"
#include "common/bit_field.h"
+#include "common/common_funcs.h"
+#include "common/common_types.h"
#define LCD_REG_INDEX(field_name) (offsetof(LCD::Regs, field_name) / sizeof(u32))
diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp
index 958dd03e..5d806c5d 100644
--- a/src/core/loader/3dsx.cpp
+++ b/src/core/loader/3dsx.cpp
@@ -5,6 +5,8 @@
#include <algorithm>
#include <vector>
+#include "common/logging/log.h"
+
#include "core/file_sys/archive_romfs.h"
#include "core/loader/elf.h"
#include "core/loader/ncch.h"
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp
index 773eaf77..467e9192 100644
--- a/src/core/loader/elf.cpp
+++ b/src/core/loader/elf.cpp
@@ -5,8 +5,9 @@
#include <string>
#include <memory>
-#include "common/common.h"
+#include "common/common_types.h"
#include "common/file_util.h"
+#include "common/logging/log.h"
#include "common/symbols.h"
#include "core/mem_map.h"
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp
index aca09b37..de0ab540 100644
--- a/src/core/loader/loader.cpp
+++ b/src/core/loader/loader.cpp
@@ -4,6 +4,7 @@
#include <string>
+#include "common/logging/log.h"
#include "common/make_unique.h"
#include "core/file_sys/archive_romfs.h"
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h
index 3510c6b2..2b87239c 100644
--- a/src/core/loader/loader.h
+++ b/src/core/loader/loader.h
@@ -6,7 +6,7 @@
#include <vector>
-#include "common/common.h"
+#include "common/common_types.h"
#include "common/file_util.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp
index 4efed78b..9bce2b79 100644
--- a/src/core/loader/ncch.cpp
+++ b/src/core/loader/ncch.cpp
@@ -4,6 +4,8 @@
#include <memory>
+#include "common/logging/log.h"
+
#include "core/loader/ncch.h"
#include "core/hle/kernel/kernel.h"
#include "core/mem_map.h"
diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h
index 3dd151db..44c72a4e 100644
--- a/src/core/loader/ncch.h
+++ b/src/core/loader/ncch.h
@@ -4,7 +4,9 @@
#pragma once
-#include "common/common.h"
+#include <memory>
+
+#include "common/common_types.h"
#include "core/loader/loader.h"
diff --git a/src/core/mem_map.cpp b/src/core/mem_map.cpp
index 22e359b3..ae88cfb1 100644
--- a/src/core/mem_map.cpp
+++ b/src/core/mem_map.cpp
@@ -2,7 +2,9 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include "common/common.h"
+#include "common/common_funcs.h"
+#include "common/common_types.h"
+#include "common/logging/log.h"
#include "common/mem_arena.h"
#include "core/mem_map.h"
diff --git a/src/core/mem_map.h b/src/core/mem_map.h
index 1af02973..b11f2ea6 100644
--- a/src/core/mem_map.h
+++ b/src/core/mem_map.h
@@ -4,11 +4,8 @@
#pragma once
-#include "common/common.h"
#include "common/common_types.h"
-#include "core/hle/kernel/kernel.h"
-
namespace Memory {
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp
index 8759ebdf..9a19c9bf 100644
--- a/src/core/mem_map_funcs.cpp
+++ b/src/core/mem_map_funcs.cpp
@@ -4,7 +4,9 @@
#include <map>
-#include "common/common.h"
+#include "common/common_types.h"
+#include "common/logging/log.h"
+#include "common/swap.h"
#include "core/mem_map.h"
#include "core/hw/hw.h"