Add a function to run the CPU core.
This commit is contained in:
parent
f7a39d1b12
commit
b17b23f1f2
6 changed files with 14 additions and 15 deletions
|
@ -34,9 +34,6 @@ enum GPUCore {
|
||||||
struct CoreParameter
|
struct CoreParameter
|
||||||
{
|
{
|
||||||
CoreParameter() : collectEmuLog(0), unthrottle(false), fpsLimit(0), updateRecent(true) {}
|
CoreParameter() : collectEmuLog(0), unthrottle(false), fpsLimit(0), updateRecent(true) {}
|
||||||
// 0 = Interpreter
|
|
||||||
// 1 = Jit
|
|
||||||
// 2 = JitIL
|
|
||||||
CPUCore cpuCore;
|
CPUCore cpuCore;
|
||||||
GPUCore gpuCore;
|
GPUCore gpuCore;
|
||||||
bool enableSound; // there aren't multiple sound cores.
|
bool enableSound; // there aren't multiple sound cores.
|
||||||
|
|
|
@ -150,6 +150,14 @@ void PSP_Shutdown()
|
||||||
currentCPU = 0;
|
currentCPU = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PSP_RunLoopUntil(u64 globalticks) {
|
||||||
|
mipsr4k.RunLoopUntil(globalticks);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PSP_RunLoopFor(int cycles) {
|
||||||
|
PSP_RunLoopUntil(CoreTiming::GetTicks() + cycles);
|
||||||
|
}
|
||||||
|
|
||||||
CoreParameter &PSP_CoreParameter()
|
CoreParameter &PSP_CoreParameter()
|
||||||
{
|
{
|
||||||
return coreParameter;
|
return coreParameter;
|
||||||
|
|
|
@ -41,8 +41,8 @@ extern GlobalUIState globalUIState;
|
||||||
bool PSP_Init(const CoreParameter &coreParam, std::string *error_string);
|
bool PSP_Init(const CoreParameter &coreParam, std::string *error_string);
|
||||||
bool PSP_IsInited();
|
bool PSP_IsInited();
|
||||||
void PSP_Shutdown();
|
void PSP_Shutdown();
|
||||||
void PSP_HWAdvance(int cycles);
|
void PSP_RunLoopUntil(u64 globalticks);
|
||||||
void PSP_SWI();
|
void PSP_RunLoopFor(int cycles);
|
||||||
|
|
||||||
void GetSysDirectories(std::string &memstickpath, std::string &flash0path);
|
void GetSysDirectories(std::string &memstickpath, std::string &flash0path);
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
#include "Core/Core.h"
|
#include "Core/Core.h"
|
||||||
#include "Core/Host.h"
|
#include "Core/Host.h"
|
||||||
#include "Core/System.h"
|
#include "Core/System.h"
|
||||||
#include "Core/MIPS/MIPS.h"
|
|
||||||
#include "GPU/GPUState.h"
|
#include "GPU/GPUState.h"
|
||||||
#include "GPU/GPUInterface.h"
|
#include "GPU/GPUInterface.h"
|
||||||
#include "Core/HLE/sceCtrl.h"
|
#include "Core/HLE/sceCtrl.h"
|
||||||
|
@ -477,8 +476,7 @@ void EmuScreen::render() {
|
||||||
|
|
||||||
// Run until CORE_NEXTFRAME
|
// Run until CORE_NEXTFRAME
|
||||||
while (coreState == CORE_RUNNING) {
|
while (coreState == CORE_RUNNING) {
|
||||||
u64 nowTicks = CoreTiming::GetTicks();
|
PSP_RunLoopFor(blockTicks);
|
||||||
mipsr4k.RunLoopUntil(nowTicks + blockTicks);
|
|
||||||
}
|
}
|
||||||
// Hopefully coreState is now CORE_NEXTFRAME
|
// Hopefully coreState is now CORE_NEXTFRAME
|
||||||
if (coreState == CORE_NEXTFRAME) {
|
if (coreState == CORE_NEXTFRAME) {
|
||||||
|
|
|
@ -99,8 +99,7 @@ void RunTests()
|
||||||
while (true) {
|
while (true) {
|
||||||
int blockTicks = usToCycles(1000000 / 10);
|
int blockTicks = usToCycles(1000000 / 10);
|
||||||
while (coreState == CORE_RUNNING) {
|
while (coreState == CORE_RUNNING) {
|
||||||
u64 nowTicks = CoreTiming::GetTicks();
|
PSP_RunLoopFor(blockTicks);
|
||||||
mipsr4k.RunLoopUntil(nowTicks + blockTicks);
|
|
||||||
}
|
}
|
||||||
// Hopefully coreState is now CORE_NEXTFRAME
|
// Hopefully coreState is now CORE_NEXTFRAME
|
||||||
if (coreState == CORE_NEXTFRAME) {
|
if (coreState == CORE_NEXTFRAME) {
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
#include "Core/CoreTiming.h"
|
#include "Core/CoreTiming.h"
|
||||||
#include "Core/System.h"
|
#include "Core/System.h"
|
||||||
#include "Core/HLE/sceUtility.h"
|
#include "Core/HLE/sceUtility.h"
|
||||||
#include "Core/MIPS/MIPS.h"
|
|
||||||
#include "Core/Host.h"
|
#include "Core/Host.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "LogManager.h"
|
#include "LogManager.h"
|
||||||
|
@ -229,10 +228,8 @@ int main(int argc, const char* argv[])
|
||||||
coreState = CORE_RUNNING;
|
coreState = CORE_RUNNING;
|
||||||
while (coreState == CORE_RUNNING)
|
while (coreState == CORE_RUNNING)
|
||||||
{
|
{
|
||||||
// Run for a frame at a time, just because.
|
int blockTicks = usToCycles(1000000 / 10);
|
||||||
u64 nowTicks = CoreTiming::GetTicks();
|
PSP_RunLoopFor(blockTicks);
|
||||||
u64 frameTicks = usToCycles(1000000/60);
|
|
||||||
mipsr4k.RunLoopUntil(nowTicks + frameTicks);
|
|
||||||
|
|
||||||
// If we were rendering, this might be a nice time to do something about it.
|
// If we were rendering, this might be a nice time to do something about it.
|
||||||
if (coreState == CORE_NEXTFRAME) {
|
if (coreState == CORE_NEXTFRAME) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue