mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-21 09:21:02 +00:00
Block dlist execution while in virtual progress.
Fixes #1224. Also, fix drawsync late by a GPU cycle, so interrupts line up. It would break at least Ys Seven without that.
This commit is contained in:
parent
12f4bf3664
commit
957394258c
@ -17,6 +17,7 @@ GPUCommon::GPUCommon() :
|
||||
currentList(NULL),
|
||||
isbreak(false),
|
||||
drawCompleteTicks(0),
|
||||
busyTicks(0),
|
||||
dumpNextFrame_(false),
|
||||
dumpThisFrame_(false),
|
||||
interruptsEnabled_(true)
|
||||
@ -417,7 +418,7 @@ bool GPUCommon::InterpretList(DisplayList &list)
|
||||
prev = op;
|
||||
}
|
||||
|
||||
UpdateCycles(list.pc);
|
||||
UpdateCycles(list.pc - 4, list.pc);
|
||||
|
||||
time_update();
|
||||
gpuStats.msProcessingDisplayLists += time_now_d() - start;
|
||||
@ -436,6 +437,12 @@ bool GPUCommon::ProcessDLQueue()
|
||||
startingTicks = CoreTiming::GetTicks();
|
||||
cyclesExecuted = 0;
|
||||
|
||||
if (startingTicks < busyTicks)
|
||||
{
|
||||
DEBUG_LOG(HLE, "Can't execute a list yet, still busy for %lld ticks", busyTicks - startingTicks);
|
||||
return false;
|
||||
}
|
||||
|
||||
DisplayListQueue::iterator iter = dlQueue.begin();
|
||||
while (iter != dlQueue.end())
|
||||
{
|
||||
@ -456,6 +463,7 @@ bool GPUCommon::ProcessDLQueue()
|
||||
currentList = NULL;
|
||||
|
||||
drawCompleteTicks = startingTicks + cyclesExecuted;
|
||||
busyTicks = std::max(busyTicks, drawCompleteTicks);
|
||||
__GeTriggerSync(WAITTYPE_GEDRAWSYNC, 1, drawCompleteTicks);
|
||||
|
||||
return true; //no more lists!
|
||||
@ -642,6 +650,7 @@ void GPUCommon::ExecuteOp(u32 op, u32 diff) {
|
||||
gpuState = GPUSTATE_DONE;
|
||||
if (!interruptsEnabled_ || !__GeTriggerInterrupt(currentList->id, currentList->pc, startingTicks + cyclesExecuted)) {
|
||||
currentList->waitTicks = startingTicks + cyclesExecuted;
|
||||
busyTicks = std::max(busyTicks, currentList->waitTicks);
|
||||
__GeTriggerSync(WAITTYPE_GELISTSYNC, currentList->id, currentList->waitTicks);
|
||||
}
|
||||
break;
|
||||
@ -678,6 +687,8 @@ void GPUCommon::DoState(PointerWrap &p) {
|
||||
p.Do(gpuState);
|
||||
p.Do(isbreak);
|
||||
p.Do(drawCompleteTicks);
|
||||
// TODO
|
||||
//p.Do(busyTicks);
|
||||
p.DoMarker("GPUCommon");
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,7 @@ protected:
|
||||
GPUState gpuState;
|
||||
bool isbreak;
|
||||
u64 drawCompleteTicks;
|
||||
u64 busyTicks;
|
||||
|
||||
u64 startingTicks;
|
||||
u32 cycleLastPC;
|
||||
|
Loading…
x
Reference in New Issue
Block a user