summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2016-12-22 20:09:50 -0500
committerLioncash <mathew1800@gmail.com>2016-12-22 20:09:52 -0500
commit5852e3961d141978676f4cd3211990c30316a577 (patch)
treeed05f023ee4e441123bd519c97b4a5d706689f59 /Source
parentaf28ce7ecba9c3b5e17c203f784213a416d00f4f (diff)
DSPMemoryMap: Move function implementations into the cpp file
This allows removing DSPCore and DSPTables includes from the header file. Doing allows resolving quite a bit of indirect includes that were present throughout the DSP source files. Another plus with this is that changes to the DSPEmitter don't require an almost total rebuild of all DSP source files. The underlying reason for most of the files being rebuilt it because DSPMemoryMap is used quite extensively, however its header includes DSPTables.h. DSPTables.h includes DSPEmitter.h as it uses the DSPEmitter type in a typedef. So any change to the emitter would propagate through the DSPMemoryMap header. This will no longer happen.
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/DSP/DSPMemoryMap.cpp18
-rw-r--r--Source/Core/Core/DSP/DSPMemoryMap.h23
-rw-r--r--Source/Core/Core/DSP/Interpreter/DSPIntExtOps.cpp1
-rw-r--r--Source/Core/Core/DSP/Jit/DSPEmitter.cpp2
-rw-r--r--Source/Core/Core/DSP/Jit/DSPJitArithmetic.cpp1
-rw-r--r--Source/Core/Core/DSP/Jit/DSPJitBranch.cpp2
-rw-r--r--Source/Core/Core/DSP/Jit/DSPJitExtOps.cpp2
-rw-r--r--Source/Core/Core/DSP/Jit/DSPJitLoadStore.cpp1
-rw-r--r--Source/Core/Core/DSP/Jit/DSPJitMisc.cpp1
-rw-r--r--Source/Core/Core/DSP/Jit/DSPJitRegCache.cpp1
-rw-r--r--Source/Core/Core/DSP/Jit/DSPJitUtil.cpp2
11 files changed, 31 insertions, 23 deletions
diff --git a/Source/Core/Core/DSP/DSPMemoryMap.cpp b/Source/Core/Core/DSP/DSPMemoryMap.cpp
index 98f3aff1d6..7b5524e2ea 100644
--- a/Source/Core/Core/DSP/DSPMemoryMap.cpp
+++ b/Source/Core/Core/DSP/DSPMemoryMap.cpp
@@ -64,3 +64,21 @@ void dsp_dmem_write(u16 addr, u16 val)
break;
}
}
+
+u16 dsp_fetch_code()
+{
+ u16 opc = dsp_imem_read(g_dsp.pc);
+
+ g_dsp.pc++;
+ return opc;
+}
+
+u16 dsp_peek_code()
+{
+ return dsp_imem_read(g_dsp.pc);
+}
+
+void dsp_skip_inst()
+{
+ g_dsp.pc += opTable[dsp_peek_code()]->size;
+}
diff --git a/Source/Core/Core/DSP/DSPMemoryMap.h b/Source/Core/Core/DSP/DSPMemoryMap.h
index d9ebcef9fb..db6ed4f8f3 100644
--- a/Source/Core/Core/DSP/DSPMemoryMap.h
+++ b/Source/Core/Core/DSP/DSPMemoryMap.h
@@ -7,27 +7,10 @@
#include "Common/CommonTypes.h"
-#include "Core/DSP/DSPCore.h"
-#include "Core/DSP/DSPTables.h"
-
u16 dsp_imem_read(u16 addr);
void dsp_dmem_write(u16 addr, u16 val);
u16 dsp_dmem_read(u16 addr);
-inline u16 dsp_fetch_code()
-{
- u16 opc = dsp_imem_read(g_dsp.pc);
-
- g_dsp.pc++;
- return opc;
-}
-
-inline u16 dsp_peek_code()
-{
- return dsp_imem_read(g_dsp.pc);
-}
-
-inline void dsp_skip_inst()
-{
- g_dsp.pc += opTable[dsp_peek_code()]->size;
-}
+u16 dsp_fetch_code();
+u16 dsp_peek_code();
+void dsp_skip_inst();
diff --git a/Source/Core/Core/DSP/Interpreter/DSPIntExtOps.cpp b/Source/Core/Core/DSP/Interpreter/DSPIntExtOps.cpp
index 337e2322a5..7b5cc46960 100644
--- a/Source/Core/Core/DSP/Interpreter/DSPIntExtOps.cpp
+++ b/Source/Core/Core/DSP/Interpreter/DSPIntExtOps.cpp
@@ -5,6 +5,7 @@
#include "Core/DSP/Interpreter/DSPIntExtOps.h"
#include "Core/DSP/DSPMemoryMap.h"
+#include "Core/DSP/DSPTables.h"
#include "Core/DSP/Interpreter/DSPIntUtil.h"
// not needed for game ucodes (it slows down interpreter/dspjit32 + easier to compare int VS
diff --git a/Source/Core/Core/DSP/Jit/DSPEmitter.cpp b/Source/Core/Core/DSP/Jit/DSPEmitter.cpp
index b86cedec3e..c1fb7c3156 100644
--- a/Source/Core/Core/DSP/Jit/DSPEmitter.cpp
+++ b/Source/Core/Core/DSP/Jit/DSPEmitter.cpp
@@ -15,7 +15,7 @@
#include "Core/DSP/DSPCore.h"
#include "Core/DSP/DSPHost.h"
#include "Core/DSP/DSPMemoryMap.h"
-#include "Core/DSP/Interpreter/DSPInterpreter.h"
+#include "Core/DSP/DSPTables.h"
#define MAX_BLOCK_SIZE 250
#define DSP_IDLE_SKIP_CYCLES 0x1000
diff --git a/Source/Core/Core/DSP/Jit/DSPJitArithmetic.cpp b/Source/Core/Core/DSP/Jit/DSPJitArithmetic.cpp
index 1bc8cf2a04..b647327a92 100644
--- a/Source/Core/Core/DSP/Jit/DSPJitArithmetic.cpp
+++ b/Source/Core/Core/DSP/Jit/DSPJitArithmetic.cpp
@@ -6,6 +6,7 @@
#include "Common/CommonTypes.h"
+#include "Core/DSP/DSPCore.h"
#include "Core/DSP/DSPMemoryMap.h"
#include "Core/DSP/Jit/DSPEmitter.h"
diff --git a/Source/Core/Core/DSP/Jit/DSPJitBranch.cpp b/Source/Core/Core/DSP/Jit/DSPJitBranch.cpp
index 1fbc3d9bd3..5cc72548a2 100644
--- a/Source/Core/Core/DSP/Jit/DSPJitBranch.cpp
+++ b/Source/Core/Core/DSP/Jit/DSPJitBranch.cpp
@@ -5,7 +5,9 @@
#include "Common/CommonTypes.h"
#include "Core/DSP/DSPAnalyzer.h"
+#include "Core/DSP/DSPCore.h"
#include "Core/DSP/DSPMemoryMap.h"
+#include "Core/DSP/DSPTables.h"
#include "Core/DSP/Jit/DSPEmitter.h"
using namespace Gen;
diff --git a/Source/Core/Core/DSP/Jit/DSPJitExtOps.cpp b/Source/Core/Core/DSP/Jit/DSPJitExtOps.cpp
index dfcdd5743e..1dc75e43d4 100644
--- a/Source/Core/Core/DSP/Jit/DSPJitExtOps.cpp
+++ b/Source/Core/Core/DSP/Jit/DSPJitExtOps.cpp
@@ -4,7 +4,7 @@
#include "Common/CommonTypes.h"
-#include "Core/DSP/DSPMemoryMap.h"
+#include "Core/DSP/DSPCore.h"
#include "Core/DSP/Jit/DSPEmitter.h"
using namespace Gen;
diff --git a/Source/Core/Core/DSP/Jit/DSPJitLoadStore.cpp b/Source/Core/Core/DSP/Jit/DSPJitLoadStore.cpp
index f0f61e5296..645fdbcaa7 100644
--- a/Source/Core/Core/DSP/Jit/DSPJitLoadStore.cpp
+++ b/Source/Core/Core/DSP/Jit/DSPJitLoadStore.cpp
@@ -6,6 +6,7 @@
#include "Common/CommonTypes.h"
+#include "Core/DSP/DSPCore.h"
#include "Core/DSP/DSPMemoryMap.h"
#include "Core/DSP/Interpreter/DSPInterpreter.h"
#include "Core/DSP/Jit/DSPEmitter.h"
diff --git a/Source/Core/Core/DSP/Jit/DSPJitMisc.cpp b/Source/Core/Core/DSP/Jit/DSPJitMisc.cpp
index 8dcdb6f153..0b064047a2 100644
--- a/Source/Core/Core/DSP/Jit/DSPJitMisc.cpp
+++ b/Source/Core/Core/DSP/Jit/DSPJitMisc.cpp
@@ -4,6 +4,7 @@
#include "Common/CommonTypes.h"
+#include "Core/DSP/DSPCore.h"
#include "Core/DSP/DSPMemoryMap.h"
#include "Core/DSP/Interpreter/DSPInterpreter.h"
#include "Core/DSP/Jit/DSPEmitter.h"
diff --git a/Source/Core/Core/DSP/Jit/DSPJitRegCache.cpp b/Source/Core/Core/DSP/Jit/DSPJitRegCache.cpp
index f5b754cdad..63b91c424b 100644
--- a/Source/Core/Core/DSP/Jit/DSPJitRegCache.cpp
+++ b/Source/Core/Core/DSP/Jit/DSPJitRegCache.cpp
@@ -9,6 +9,7 @@
#include "Common/Assert.h"
#include "Common/Logging/Log.h"
+#include "Core/DSP/DSPCore.h"
#include "Core/DSP/DSPMemoryMap.h"
#include "Core/DSP/Jit/DSPEmitter.h"
diff --git a/Source/Core/Core/DSP/Jit/DSPJitUtil.cpp b/Source/Core/Core/DSP/Jit/DSPJitUtil.cpp
index c03cb782f8..9b273e619b 100644
--- a/Source/Core/Core/DSP/Jit/DSPJitUtil.cpp
+++ b/Source/Core/Core/DSP/Jit/DSPJitUtil.cpp
@@ -4,8 +4,8 @@
#include "Common/CommonTypes.h"
+#include "Core/DSP/DSPCore.h"
#include "Core/DSP/DSPHWInterface.h"
-#include "Core/DSP/DSPMemoryMap.h"
#include "Core/DSP/Jit/DSPEmitter.h"
using namespace Gen;