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