summaryrefslogtreecommitdiff
path: root/Source/Core/DSPCore/Src/DSPCore.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2010-11-28 05:28:21 +0000
committerskidau <skidau@gmail.com>2010-11-28 05:28:21 +0000
commit6a6fb9cce94d3c4474553eb078297439e6ea1586 (patch)
treee1b6a6252fcd8eeec4b5c97f62acb11ec9cbf8a7 /Source/Core/DSPCore/Src/DSPCore.cpp
parent88916a61daf0768c8e6ab8453c249e6b24d7ab81 (diff)
LLE JIT: Added an ASM dispatcher. Should help pave the way for future optimisation.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6486 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DSPCore/Src/DSPCore.cpp')
-rw-r--r--Source/Core/DSPCore/Src/DSPCore.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/Source/Core/DSPCore/Src/DSPCore.cpp b/Source/Core/DSPCore/Src/DSPCore.cpp
index 49726732c5..0609fb578b 100644
--- a/Source/Core/DSPCore/Src/DSPCore.cpp
+++ b/Source/Core/DSPCore/Src/DSPCore.cpp
@@ -37,6 +37,7 @@
SDSP g_dsp;
DSPBreakpoints dsp_breakpoints;
DSPCoreState core_state = DSPCORE_STOP;
+int cyclesLeft = 0;
DSPEmitter *jit = NULL;
Common::Event step_event;
@@ -71,6 +72,7 @@ bool DSPCore_Init(const char *irom_filename, const char *coef_filename,
bool bUsingJIT)
{
g_dsp.step_counter = 0;
+ cyclesLeft = 0;
jit = NULL;
g_dsp.irom = (u16*)AllocateMemoryPages(DSP_IROM_BYTE_SIZE);
@@ -224,13 +226,18 @@ void DSPCore_CheckExceptions()
// Handle state changes and stepping.
int DSPCore_RunCycles(int cycles)
{
- static int spare_cycles = 0;
if (jit)
{
// DSPCore_CheckExceptions();
// DSPCore_CheckExternalInterrupt();
- spare_cycles = jit->RunForCycles(cycles + spare_cycles);
- return 0;
+ cyclesLeft = cycles;
+
+ CompiledCode pExecAddr = (CompiledCode)jit->enterDispatcher;
+ pExecAddr();
+
+ // To use the C++ dispatcher, uncomment the line below and comment out the two lines above
+ //jit->RunForCycles(cyclesLeft);
+ return cyclesLeft;
}
while (cycles > 0) {
@@ -284,7 +291,8 @@ void DSPCore_Step()
step_event.Set();
}
-void CompileCurrent() {
+void CompileCurrent()
+{
jit->Compile(g_dsp.pc);
}