DSPCore: Move JIT cycle code to DSPEmitter

Moves x86-specific emitter code out of DSPCore.
This commit is contained in:
Lioncash 2017-01-28 03:39:02 -05:00
parent 5da565a1a1
commit 0d42cbc923
3 changed files with 22 additions and 15 deletions

View File

@ -245,21 +245,7 @@ int DSPCore_RunCycles(int cycles)
{
if (g_dsp_jit)
{
if (g_dsp.external_interrupt_waiting)
{
DSPCore_CheckExternalInterrupt();
DSPCore_CheckExceptions();
DSPCore_SetExternalInterrupt(false);
}
g_cycles_left = cycles;
auto exec_addr = (JIT::x86::DSPEmitter::DSPCompiledCode)g_dsp_jit->m_enter_dispatcher;
exec_addr();
if (g_dsp.reset_dspjit_codespace)
g_dsp_jit->ClearIRAMandDSPJITCodespaceReset();
return g_cycles_left;
return g_dsp_jit->RunCycles(static_cast<u16>(cycles));
}
while (cycles > 0)

View File

@ -48,6 +48,25 @@ DSPEmitter::~DSPEmitter()
FreeCodeSpace();
}
u16 DSPEmitter::RunCycles(u16 cycles)
{
if (g_dsp.external_interrupt_waiting)
{
DSPCore_CheckExternalInterrupt();
DSPCore_CheckExceptions();
DSPCore_SetExternalInterrupt(false);
}
g_cycles_left = cycles;
auto exec_addr = (DSPCompiledCode)m_enter_dispatcher;
exec_addr();
if (g_dsp.reset_dspjit_codespace)
ClearIRAMandDSPJITCodespaceReset();
return g_cycles_left;
}
void DSPEmitter::ClearIRAM()
{
for (int i = 0x0000; i < 0x1000; i++)

View File

@ -32,6 +32,8 @@ public:
DSPEmitter();
~DSPEmitter();
u16 RunCycles(u16 cycles);
void EmitInstruction(UDSPInstruction inst);
void ClearIRAM();
void ClearIRAMandDSPJITCodespaceReset();