void GPUCommon::SlowRunLoop(DisplayList &list) { const bool dumpThisFrame = dumpThisFrame_; while (downcount > 0) { u32 op = Memory::ReadUnchecked_U32(list.pc); u32 cmd = op >> 24; #if defined(USING_QT_UI) if (host->GpuStep()) host->SendGPUWait(cmd, list.pc, &gstate); #endif u32 diff = op ^ gstate.cmdmem[cmd]; PreExecuteOp(op, diff); if (dumpThisFrame) { char temp[256]; u32 prev = Memory::ReadUnchecked_U32(list.pc - 4); GeDisassembleOp(list.pc, op, prev, temp); NOTICE_LOG(G3D, "%s", temp); } gstate.cmdmem[cmd] = op; ExecuteOp(op, diff); list.pc += 4; --downcount; } }
bool GPUCommon::InterpretList(DisplayList &list) { time_update(); double start = time_now_d(); currentList = &list; // Reset stackptr for safety stackptr = 0; u32 op = 0; prev = 0; finished = false; if (!Memory::IsValidAddress(list.pc)) { ERROR_LOG(G3D, "DL PC = %08x WTF!!!!", list.pc); return true; } while (!finished) { list.status = PSP_GE_LIST_DRAWING; if (list.pc == list.stall) { list.status = PSP_GE_LIST_STALL_REACHED; return false; } op = Memory::ReadUnchecked_U32(list.pc); //read from memory u32 cmd = op >> 24; u32 diff = op ^ gstate.cmdmem[cmd]; PreExecuteOp(op, diff); // TODO: Add a compiler flag to remove stuff like this at very-final build time. if (dumpThisFrame_) { char temp[256]; GeDisassembleOp(list.pc, op, prev, temp); NOTICE_LOG(G3D, "%s", temp); } gstate.cmdmem[cmd] = op; // crashes if I try to put the whole op there?? ExecuteOp(op, diff); list.pc += 4; prev = op; } time_update(); gpuStats.msProcessingDisplayLists += time_now_d() - start; return true; }
void Debugger_Disasm::FillDisplayListCmd(std::map<int,std::string>& data, u32 pc, u32 prev) { u32 curPc = pc; int debugLimit = 10000; // Anti crash if this code is bugged while(Memory::IsValidAddress(curPc) && debugLimit > 0) { if(data.find(curPc) != data.end()) return; u32 op = Memory::ReadUnchecked_U32(curPc); //read from memory u32 cmd = op >> 24; u32 diff = op ^ gstate.cmdmem[cmd]; char temp[256]; GeDisassembleOp(curPc, op, prev, temp); data[curPc] = temp; prev = op; if(cmd == GE_CMD_JUMP) { u32 target = (((gstate.base & 0x00FF0000) << 8) | (op & 0xFFFFFC)) & 0x0FFFFFFF; FillDisplayListCmd(data, target, prev); return; } else if(cmd == GE_CMD_CALL) { u32 target = gstate_c.getRelativeAddress(op & 0xFFFFFF); FillDisplayListCmd(data, target, prev); } else if(cmd == GE_CMD_RET) { return; } else if(cmd == GE_CMD_FINISH) { return; } else if(cmd == GE_CMD_END) { if(prev >> 24 == GE_CMD_FINISH) return; } curPc += 4; debugLimit--; } }
bool GPUCommon::InterpretList(DisplayList &list) { time_update(); double start = time_now_d(); currentList = &list; u32 op = 0; prev = 0; finished = false; // I don't know if this is the correct place to zero this, but something // need to do it. See Sol Trigger title screen. gstate_c.offsetAddr = 0; if (!Memory::IsValidAddress(list.pc)) { ERROR_LOG(G3D, "DL PC = %08x WTF!!!!", list.pc); return true; } #if defined(USING_QT_UI) if(host->GpuStep()) { host->SendGPUStart(); } #endif while (!finished) { list.status = PSP_GE_LIST_DRAWING; if (list.pc == list.stall) { list.status = PSP_GE_LIST_STALL_REACHED; return false; } op = Memory::ReadUnchecked_U32(list.pc); //read from memory u32 cmd = op >> 24; #if defined(USING_QT_UI) if(host->GpuStep()) { host->SendGPUWait(cmd, list.pc, &gstate); } #endif u32 diff = op ^ gstate.cmdmem[cmd]; PreExecuteOp(op, diff); // TODO: Add a compiler flag to remove stuff like this at very-final build time. if (dumpThisFrame_) { char temp[256]; GeDisassembleOp(list.pc, op, prev, temp); NOTICE_LOG(HLE, "%s", temp); } gstate.cmdmem[cmd] = op; // crashes if I try to put the whole op there?? ExecuteOp(op, diff); list.pc += 4; prev = op; } time_update(); gpuStats.msProcessingDisplayLists += time_now_d() - start; return true; }
bool GPUCommon::InterpretList(DisplayList &list) { // TODO: This has to be right... but it freezes right now? //if (list.state == PSP_GE_DL_STATE_PAUSED) // return false; time_update(); double start = time_now_d(); currentList = &list; u32 op = 0; prev = 0; gpuState = GPUSTATE_RUNNING; // I don't know if this is the correct place to zero this, but something // need to do it. See Sol Trigger title screen. gstate_c.offsetAddr = 0; if (!Memory::IsValidAddress(list.pc)) { ERROR_LOG_REPORT(G3D, "DL PC = %08x WTF!!!!", list.pc); return true; } #if defined(USING_QT_UI) if(host->GpuStep()) { host->SendGPUStart(); } #endif cycleLastPC = list.pc; list.state = PSP_GE_DL_STATE_RUNNING; list.interrupted = false; while (gpuState == GPUSTATE_RUNNING) { if (list.pc == list.stall) { gpuState = GPUSTATE_STALL; break; } op = Memory::ReadUnchecked_U32(list.pc); //read from memory u32 cmd = op >> 24; #if defined(USING_QT_UI) if(host->GpuStep()) { host->SendGPUWait(cmd, list.pc, &gstate); } #endif u32 diff = op ^ gstate.cmdmem[cmd]; PreExecuteOp(op, diff); // TODO: Add a compiler flag to remove stuff like this at very-final build time. if (dumpThisFrame_) { char temp[256]; GeDisassembleOp(list.pc, op, prev, temp); NOTICE_LOG(HLE, "%s", temp); } gstate.cmdmem[cmd] = op; ExecuteOp(op, diff); list.pc += 4; prev = op; } UpdateCycles(list.pc); time_update(); gpuStats.msProcessingDisplayLists += time_now_d() - start; return gpuState == GPUSTATE_DONE || gpuState == GPUSTATE_ERROR; }