summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <ericbunnie@gmail.com>2014-04-18 05:43:55 +0200
committerbunnei <ericbunnie@gmail.com>2014-04-18 05:43:55 +0200
commitc3a4b4bfca154f3f27830fe747c0fd74f8459d84 (patch)
tree3c91454f16cafa94f2076d55998d411236eaf066
parentadded GSP heap memory allocation (diff)
downloadyuzu-c3a4b4bfca154f3f27830fe747c0fd74f8459d84.tar
yuzu-c3a4b4bfca154f3f27830fe747c0fd74f8459d84.tar.gz
yuzu-c3a4b4bfca154f3f27830fe747c0fd74f8459d84.tar.bz2
yuzu-c3a4b4bfca154f3f27830fe747c0fd74f8459d84.tar.lz
yuzu-c3a4b4bfca154f3f27830fe747c0fd74f8459d84.tar.xz
yuzu-c3a4b4bfca154f3f27830fe747c0fd74f8459d84.tar.zst
yuzu-c3a4b4bfca154f3f27830fe747c0fd74f8459d84.zip
-rw-r--r--src/common/log.h2
-rw-r--r--src/common/log_manager.cpp2
-rw-r--r--src/core/core.vcxproj2
-rw-r--r--src/core/core.vcxproj.filters6
-rw-r--r--src/core/hw/hw.cpp61
-rw-r--r--src/core/hw/ndma.cpp48
-rw-r--r--src/core/hw/ndma.h26
7 files changed, 143 insertions, 4 deletions
diff --git a/src/common/log.h b/src/common/log.h
index 2eacf05f2..02db8bd55 100644
--- a/src/common/log.h
+++ b/src/common/log.h
@@ -55,7 +55,7 @@ enum LOG_TYPE {
WII_IPC_HID,
WII_IPC_HLE,
WII_IPC_NET,
- WII_IPC_WC24,
+ NDMA,
HLE,
RENDER,
LCD,
diff --git a/src/common/log_manager.cpp b/src/common/log_manager.cpp
index b2dbbbdac..8e56deb8f 100644
--- a/src/common/log_manager.cpp
+++ b/src/common/log_manager.cpp
@@ -67,7 +67,7 @@ LogManager::LogManager()
m_Log[LogTypes::RENDER] = new LogContainer("RENDER", "RENDER");
m_Log[LogTypes::LCD] = new LogContainer("LCD", "LCD");
m_Log[LogTypes::WII_IPC_NET] = new LogContainer("WII_IPC_NET", "WII IPC NET");
- m_Log[LogTypes::WII_IPC_WC24] = new LogContainer("WII_IPC_WC24", "WII IPC WC24");
+ m_Log[LogTypes::NDMA] = new LogContainer("NDMA", "NDMA");
m_Log[LogTypes::HLE] = new LogContainer("HLE", "High Level Emulation");
m_Log[LogTypes::HW] = new LogContainer("HW", "Hardware");
m_Log[LogTypes::ACTIONREPLAY] = new LogContainer("ActionReplay", "ActionReplay");
diff --git a/src/core/core.vcxproj b/src/core/core.vcxproj
index caf827be4..80bd75eeb 100644
--- a/src/core/core.vcxproj
+++ b/src/core/core.vcxproj
@@ -161,6 +161,7 @@
<ClCompile Include="hle\syscall.cpp" />
<ClCompile Include="hw\hw.cpp" />
<ClCompile Include="hw\hw_lcd.cpp" />
+ <ClCompile Include="hw\ndma.cpp" />
<ClCompile Include="loader.cpp" />
<ClCompile Include="mem_map.cpp" />
<ClCompile Include="mem_map_funcs.cpp" />
@@ -199,6 +200,7 @@
<ClInclude Include="hle\syscall.h" />
<ClInclude Include="hw\hw.h" />
<ClInclude Include="hw\hw_lcd.h" />
+ <ClInclude Include="hw\ndma.h" />
<ClInclude Include="loader.h" />
<ClInclude Include="mem_map.h" />
<ClInclude Include="system.h" />
diff --git a/src/core/core.vcxproj.filters b/src/core/core.vcxproj.filters
index 0a5b5a188..61cb6e405 100644
--- a/src/core/core.vcxproj.filters
+++ b/src/core/core.vcxproj.filters
@@ -102,6 +102,9 @@
<ClCompile Include="hle\service\hid.cpp">
<Filter>hle\service</Filter>
</ClCompile>
+ <ClCompile Include="hw\ndma.cpp">
+ <Filter>hw</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="arm\disassembler\arm_disasm.h">
@@ -199,6 +202,9 @@
<ClInclude Include="hle\service\hid.h">
<Filter>hle\service</Filter>
</ClInclude>
+ <ClInclude Include="hw\ndma.h">
+ <Filter>hw</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<Text Include="CMakeLists.txt" />
diff --git a/src/core/hw/hw.cpp b/src/core/hw/hw.cpp
index 59c348ca9..1f240f09c 100644
--- a/src/core/hw/hw.cpp
+++ b/src/core/hw/hw.cpp
@@ -7,17 +7,72 @@
#include "core/hw/hw.h"
#include "core/hw/hw_lcd.h"
+#include "core/hw/ndma.h"
namespace HW {
+enum {
+ ADDRESS_CONFIG = 0x10000000,
+ ADDRESS_IRQ = 0x10001000,
+ ADDRESS_NDMA = 0x10002000,
+ ADDRESS_TIMER = 0x10003000,
+ ADDRESS_CTRCARD = 0x10004000,
+ ADDRESS_CTRCARD_2 = 0x10005000,
+ ADDRESS_SDMC_NAND = 0x10006000,
+ ADDRESS_SDMC_NAND_2 = 0x10007000, // Apparently not used on retail
+ ADDRESS_PXI = 0x10008000,
+ ADDRESS_AES = 0x10009000,
+ ADDRESS_SHA = 0x1000A000,
+ ADDRESS_RSA = 0x1000B000,
+ ADDRESS_XDMA = 0x1000C000,
+ ADDRESS_SPICARD = 0x1000D800,
+ ADDRESS_CONFIG_2 = 0x10010000,
+ ADDRESS_HASH = 0x10101000,
+ ADDRESS_CSND = 0x10103000,
+ ADDRESS_DSP = 0x10140000,
+ ADDRESS_PDN = 0x10141000,
+ ADDRESS_CODEC = 0x10141000,
+ ADDRESS_SPI = 0x10142000,
+ ADDRESS_SPI_2 = 0x10143000,
+ ADDRESS_I2C = 0x10144000,
+ ADDRESS_CODEC_2 = 0x10145000,
+ ADDRESS_HID = 0x10146000,
+ ADDRESS_PAD = 0x10146000,
+ ADDRESS_PTM = 0x10146000,
+ ADDRESS_I2C_2 = 0x10148000,
+ ADDRESS_SPI_3 = 0x10160000,
+ ADDRESS_I2C_3 = 0x10161000,
+ ADDRESS_MIC = 0x10162000,
+ ADDRESS_PXI_2 = 0x10163000,
+ ADDRESS_NTRCARD = 0x10164000,
+ ADDRESS_DSP_2 = 0x10203000,
+ ADDRESS_HASH_2 = 0x10301000,
+};
+
template <typename T>
inline void Read(T &var, const u32 addr) {
- NOTICE_LOG(HW, "read from address %08X", addr);
+ switch (addr & 0xFFFFF000) {
+
+ case ADDRESS_NDMA:
+ NDMA::Read(var, addr);
+ break;
+
+ default:
+ ERROR_LOG(HW, "unknown Read%d @ 0x%08X", sizeof(var) * 8, addr);
+ }
}
template <typename T>
inline void Write(u32 addr, const T data) {
- NOTICE_LOG(HW, "write to address %08X", addr);
+ switch (addr & 0xFFFFF000) {
+
+ case ADDRESS_NDMA:
+ NDMA::Write(addr, data);
+ break;
+
+ default:
+ ERROR_LOG(HW, "unknown Write%d 0x%08X @ 0x%08X", sizeof(data) * 8, data, addr);
+ }
}
// Explicitly instantiate template functions because we aren't defining this in the header:
@@ -35,11 +90,13 @@ template void Write<u8>(u32 addr, const u8 data);
/// Update hardware
void Update() {
LCD::Update();
+ NDMA::Update();
}
/// Initialize hardware
void Init() {
LCD::Init();
+ NDMA::Init();
NOTICE_LOG(HW, "initialized OK");
}
diff --git a/src/core/hw/ndma.cpp b/src/core/hw/ndma.cpp
new file mode 100644
index 000000000..52e459ebd
--- /dev/null
+++ b/src/core/hw/ndma.cpp
@@ -0,0 +1,48 @@
+// Copyright 2014 Citra Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#include "common/common_types.h"
+#include "common/log.h"
+
+#include "core/hw/ndma.h"
+
+namespace NDMA {
+
+template <typename T>
+inline void Read(T &var, const u32 addr) {
+ ERROR_LOG(NDMA, "unknown Read%d @ 0x%08X", sizeof(var) * 8, addr);
+}
+
+template <typename T>
+inline void Write(u32 addr, const T data) {
+ ERROR_LOG(NDMA, "unknown Write%d 0x%08X @ 0x%08X", sizeof(data) * 8, data, addr);
+}
+
+// Explicitly instantiate template functions because we aren't defining this in the header:
+
+template void Read<u64>(u64 &var, const u32 addr);
+template void Read<u32>(u32 &var, const u32 addr);
+template void Read<u16>(u16 &var, const u32 addr);
+template void Read<u8>(u8 &var, const u32 addr);
+
+template void Write<u64>(u32 addr, const u64 data);
+template void Write<u32>(u32 addr, const u32 data);
+template void Write<u16>(u32 addr, const u16 data);
+template void Write<u8>(u32 addr, const u8 data);
+
+/// Update hardware
+void Update() {
+}
+
+/// Initialize hardware
+void Init() {
+ NOTICE_LOG(LCD, "initialized OK");
+}
+
+/// Shutdown hardware
+void Shutdown() {
+ NOTICE_LOG(LCD, "shutdown OK");
+}
+
+} // namespace
diff --git a/src/core/hw/ndma.h b/src/core/hw/ndma.h
new file mode 100644
index 000000000..d8fa3d40b
--- /dev/null
+++ b/src/core/hw/ndma.h
@@ -0,0 +1,26 @@
+// Copyright 2014 Citra Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include "common/common_types.h"
+
+namespace NDMA {
+
+template <typename T>
+inline void Read(T &var, const u32 addr);
+
+template <typename T>
+inline void Write(u32 addr, const T data);
+
+/// Update hardware
+void Update();
+
+/// Initialize hardware
+void Init();
+
+/// Shutdown hardware
+void Shutdown();
+
+} // namespace