Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix a potential issue when someone has a CPU core that isn't availabl…
…e on that host set in the INI file, it would just fail out. Now it defaults to interpreter.
  • Loading branch information
Sonicadvance1 committed Mar 8, 2013
1 parent be217bf commit f6d45ea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions Source/Core/Core/Src/PowerPC/JitInterface.cpp
Expand Up @@ -81,6 +81,7 @@ namespace JitInterface
default:
{
PanicAlert("Unrecognizable cpu_core: %d", core);
jit = NULL;
return NULL;
break;
}
Expand Down
3 changes: 0 additions & 3 deletions Source/Core/Core/Src/PowerPC/JitInterface.h
Expand Up @@ -51,6 +51,3 @@ namespace JitInterface
extern bool bFakeVMEM;
extern bool bMMU;

#ifdef _M_ARM
#include "JitArm32/Jit.h"
#endif
9 changes: 8 additions & 1 deletion Source/Core/Core/Src/PowerPC/PowerPC.cpp
Expand Up @@ -161,13 +161,18 @@ void Init(int cpu_core)

switch (cpu_core)
{
case 0:
case 0:
{
cpu_core_base = interpreter;
break;
}
default:
cpu_core_base = JitInterface::InitJitCore(cpu_core);
if (!cpu_core_base) // Handle Situations where JIT core isn't available
{
WARN_LOG(POWERPC, "Jit core %d not available. Defaulting to interpreter.", cpu_core);
cpu_core_base = interpreter;
}
break;
}

Expand Down Expand Up @@ -213,6 +218,8 @@ void SetMode(CoreMode new_mode)
case MODE_JIT: // Switching from interpreter to JIT.
// Don't really need to do much. It'll work, the cache will refill itself.
cpu_core_base = JitInterface::GetCore();
if (!cpu_core_base) // Has a chance to not get a working JIT core if one isn't active on host
cpu_core_base = interpreter;
break;
}
}
Expand Down

0 comments on commit f6d45ea

Please sign in to comment.