Fix a potential issue when someone has a CPU core that isn't available on that host set in the INI file, it would just fail out. Now it defaults to interpreter.

This commit is contained in:
Ryan Houdek 2013-03-08 10:52:04 -06:00
parent be217bf096
commit f6d45ea461
3 changed files with 9 additions and 4 deletions

View File

@ -81,6 +81,7 @@ namespace JitInterface
default:
{
PanicAlert("Unrecognizable cpu_core: %d", core);
jit = NULL;
return NULL;
break;
}

View File

@ -51,6 +51,3 @@ namespace JitInterface
extern bool bFakeVMEM;
extern bool bMMU;
#ifdef _M_ARM
#include "JitArm32/Jit.h"
#endif

View File

@ -168,6 +168,11 @@ void Init(int cpu_core)
}
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;
}
@ -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;
}
}