mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-02 02:33:43 +01:00
sceDisplay, GPUState cleanup and comments
This commit is contained in:
1 parent
828c740fd5
commit
0726912f09
2 files changed
+17
-20
No files matched your search
+12
-17
@@ -60,16 +60,14 @@ struct FrameBufferState {
|
||||
int pspFramebufLinesize;
|
||||
};
|
||||
|
||||
struct WaitVBlankInfo
|
||||
{
|
||||
struct WaitVBlankInfo {
|
||||
WaitVBlankInfo(u32 tid) : threadID(tid), vcountUnblock(1) {}
|
||||
WaitVBlankInfo(u32 tid, int vcount) : threadID(tid), vcountUnblock(vcount) {}
|
||||
SceUID threadID;
|
||||
// Number of vcounts to block for.
|
||||
int vcountUnblock;
|
||||
|
||||
void DoState(PointerWrap &p)
|
||||
{
|
||||
void DoState(PointerWrap &p) {
|
||||
auto s = p.Section("WaitVBlankInfo", 1);
|
||||
if (!s)
|
||||
return;
|
||||
@@ -326,16 +324,14 @@ void __DisplayVblankBeginCallback(SceUID threadID, SceUID prevCallbackId) {
|
||||
WaitVBlankInfo waitData(0);
|
||||
for (size_t i = 0; i < vblankWaitingThreads.size(); i++) {
|
||||
WaitVBlankInfo *t = &vblankWaitingThreads[i];
|
||||
if (t->threadID == threadID)
|
||||
{
|
||||
if (t->threadID == threadID) {
|
||||
waitData = *t;
|
||||
vblankWaitingThreads.erase(vblankWaitingThreads.begin() + i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (waitData.threadID != threadID)
|
||||
{
|
||||
if (waitData.threadID != threadID) {
|
||||
WARN_LOG_REPORT(SCEDISPLAY, "sceDisplayWaitVblankCB: could not find waiting thread info.");
|
||||
return;
|
||||
}
|
||||
@@ -498,19 +494,19 @@ static void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) {
|
||||
// Check if the frameskipping code should be enabled. If neither throttling or frameskipping is on,
|
||||
// we have nothing to do here.
|
||||
bool doFrameSkip = g_Config.iFrameSkip != 0;
|
||||
|
||||
|
||||
if (!throttle && g_Config.bFrameSkipUnthrottle) {
|
||||
doFrameSkip = true;
|
||||
skipFrame = true;
|
||||
if (numSkippedFrames >= 7) {
|
||||
skipFrame = false;
|
||||
}
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!throttle && !doFrameSkip)
|
||||
return;
|
||||
|
||||
|
||||
time_update();
|
||||
|
||||
float scaledTimestep = timestep;
|
||||
@@ -530,7 +526,7 @@ static void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) {
|
||||
nextFrameTime = std::max(lastFrameTime + scaledTimestep, time_now_d() - maxFallBehindFrames * scaledTimestep);
|
||||
}
|
||||
curFrameTime = time_now_d();
|
||||
|
||||
|
||||
// Auto-frameskip automatically if speed limit is set differently than the default.
|
||||
bool useAutoFrameskip = g_Config.bAutoFrameSkip && g_Config.iRenderingMode != FB_NON_BUFFERED_MODE;
|
||||
if (g_Config.bAutoFrameSkip || (g_Config.iFrameSkip == 0 && fpsLimiter == FPS_LIMIT_CUSTOM && g_Config.iFpsLimit > 60)) {
|
||||
@@ -707,8 +703,7 @@ void hleEnterVblank(u64 userdata, int cyclesLate) {
|
||||
}
|
||||
}
|
||||
|
||||
void hleAfterFlip(u64 userdata, int cyclesLate)
|
||||
{
|
||||
void hleAfterFlip(u64 userdata, int cyclesLate) {
|
||||
gpu->BeginFrame(); // doesn't really matter if begin or end of frame.
|
||||
|
||||
// This seems like as good a time as any to check if the config changed.
|
||||
@@ -769,7 +764,7 @@ static u32 sceDisplaySetMode(int displayMode, int displayWidth, int displayHeigh
|
||||
WARN_LOG(SCEDISPLAY, "sceDisplaySetMode INVALID SIZE (%i, %i, %i)", displayMode, displayWidth, displayHeight);
|
||||
return SCE_KERNEL_ERROR_INVALID_SIZE;
|
||||
}
|
||||
|
||||
|
||||
if (displayMode != PSP_DISPLAY_MODE_LCD) {
|
||||
WARN_LOG(SCEDISPLAY, "sceDisplaySetMode INVALID MODE(%i, %i, %i)", displayMode, displayWidth, displayHeight);
|
||||
return SCE_KERNEL_ERROR_INVALID_MODE;
|
||||
@@ -1017,11 +1012,11 @@ static float sceDisplayGetFramePerSec() {
|
||||
}
|
||||
|
||||
static u32 sceDisplayIsForeground() {
|
||||
DEBUG_LOG(SCEDISPLAY,"IMPL sceDisplayIsForeground()");
|
||||
DEBUG_LOG(SCEDISPLAY,"IMPL sceDisplayIsForeground()");
|
||||
if (!hasSetMode || framebuf.topaddr == 0)
|
||||
return 0;
|
||||
else
|
||||
return 1; // return value according to JPCSP comment
|
||||
return 1; // return value according to JPCSP comment
|
||||
}
|
||||
|
||||
static u32 sceDisplayGetMode(u32 modeAddr, u32 widthAddr, u32 heightAddr) {
|
||||
|
||||
Reference in new issue
Block a user