Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1460,9 +1460,6 @@ void Config::PostLoadCleanup(bool gameSpecific) {
if (g_Config.sCustomDriver == "Default") {
g_Config.sCustomDriver = "";
}

// Convert old volume settings.

}

void Config::PreSaveCleanup(bool gameSpecific) {
Expand Down
10 changes: 9 additions & 1 deletion Core/HLE/sceDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ static void DoFrameTiming(bool throttle, bool *skipFrame, float scaledTimestep,

// Auto-frameskip automatically if speed limit is set differently than the default.
int frameSkipNum = DisplayCalculateFrameSkip();
if (g_Config.bAutoFrameSkip) {
if (g_Config.bAutoFrameSkip && !g_Config.bSkipBufferEffects) {
// autoframeskip
// Argh, we are falling behind! Let's skip a frame and see if we catch up.
if (curFrameTime > nextFrameTime && doFrameSkip) {
Expand Down Expand Up @@ -694,6 +694,14 @@ void __DisplayFlip(int cyclesLate) {
} else {
gstate_c.skipDrawReason &= ~SKIPDRAW_SKIPFRAME;
numSkippedFrames = 0;

// NOTE!! It can happen that if we just toggled frameskip (especially auto), we are still in a state
// where we don't have a framebuffer bound, from the last frame. But framebuffermanager still might think
// that we're in non-buffered mode.
if (gpu->GetFramebufferManagerCommon() && !gpu->GetFramebufferManagerCommon()->UseBufferedRendering() && !g_Config.bSkipBufferEffects) {
gpu->GetFramebufferManagerCommon()->ForceUseBufferedRendering(!g_Config.bSkipBufferEffects);
gstate_c.skipDrawReason &= ~SKIPDRAW_NON_DISPLAYED_FB;
}
}

// Returning here with coreState == CORE_NEXTFRAME causes a buffer flip to happen (next frame).
Expand Down
2 changes: 2 additions & 0 deletions GPU/Common/FramebufferManagerCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1707,6 +1707,8 @@ void FramebufferManagerCommon::CopyDisplayToOutput(bool reallyDirty) {
} else if (useBufferedRendering_) {
WARN_LOG(Log::FrameBuf, "Using buffered rendering, and current VFB lacks an FBO: %08x", vfb->fb_address);
} else {
// This is OK because here we're in "skip buffered" mode, so even if we haven't presented
// we will have a render target.
presentation_->NotifyPresent();
}

Expand Down
4 changes: 4 additions & 0 deletions GPU/Common/FramebufferManagerCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ class FramebufferManagerCommon {
return useBufferedRendering_;
}

void ForceUseBufferedRendering(bool buf) {
useBufferedRendering_ = true;
}

// TODO: Maybe just include the last depth buffer address in this, too.
bool MayIntersectFramebufferColor(u32 start) const {
// Clear the cache/kernel bits.
Expand Down
38 changes: 23 additions & 15 deletions Windows/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ namespace MainWindow
bool trapMouse = true; // Handles some special cases(alt+tab, win menu) when game is running and mouse is confined

#define MAX_LOADSTRING 100
const TCHAR *szWindowClass = TEXT("PPSSPPWnd");
const TCHAR *szDisplayClass = TEXT("PPSSPPDisplay");
const wchar_t *const szWindowClass = L"PPSSPPWnd";
const wchar_t *const szDisplayClass = L"PPSSPPDisplay";

// Forward declarations of functions included in this code module:
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
Expand All @@ -180,7 +180,7 @@ namespace MainWindow
wcex.lpfnWndProc = (WNDPROC)WndProc;
wcex.hInstance = hInstance;
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = NULL; // Always covered by display window
wcex.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
wcex.lpszMenuName = (LPCWSTR)IDR_MENU1;
wcex.lpszClassName = szWindowClass;
wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_PPSSPP);
Expand Down Expand Up @@ -544,8 +544,10 @@ namespace MainWindow

WindowsRawInput::Init();

SetFocus(hwndMain);
UpdateWindow(hwndMain);
UpdateWindow(hwndDisplay);

SetFocus(hwndMain);
return TRUE;
}

Expand Down Expand Up @@ -615,8 +617,6 @@ namespace MainWindow
}

LRESULT CALLBACK DisplayProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
static bool firstErase = true;

switch (message) {
case WM_SIZE:
break;
Expand Down Expand Up @@ -652,12 +652,7 @@ namespace MainWindow
break;

case WM_ERASEBKGND:
if (firstErase) {
firstErase = false;
// Paint black on first erase while OpenGL stuff is loading
return DefWindowProc(hWnd, message, wParam, lParam);
}
// Then never erase, let the OpenGL drawing take care of everything.
// Don't erase, let OpenGL take care of it.
return 1;

// Mouse input. We send asynchronous touch events for minimal latency.
Expand Down Expand Up @@ -852,8 +847,11 @@ namespace MainWindow
return darkResult;
}

static bool first = true;

switch (message) {
case WM_CREATE:
first = true;
if (!IsVistaOrHigher()) {
// Remove the D3D11 choice on versions below XP
RemoveMenu(GetMenu(hWnd), ID_OPTIONS_DIRECT3D11, MF_BYCOMMAND);
Expand Down Expand Up @@ -968,8 +966,18 @@ namespace MainWindow
break;

case WM_ERASEBKGND:
// This window is always covered by DisplayWindow. No reason to erase.
return 0;
{
if (first) {
// Manually clearing on first boot looks better (only a brief white flash which I can't seem
// to get rid of).
HDC hdc = (HDC)wParam;
RECT rc;
GetClientRect(hWnd, &rc);
FillRect(hdc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
first = false;
}
return 1;
}

case WM_MOVE:
SavePosition();
Expand Down Expand Up @@ -1114,7 +1122,7 @@ namespace MainWindow
// TODO: Translate? Or just not bother?
MessageBox(hwndMain, L"You can only load one file at a time", L"Error", MB_ICONINFORMATION);
} else {
TCHAR filename[1024];
wchar_t filename[1024];
if (DragQueryFile(hdrop, 0, filename, ARRAY_SIZE(filename)) != 0) {
const std::string utf8_filename = ReplaceAll(ConvertWStringToUTF8(filename), "\\", "/");
System_PostUIMessage(UIMessage::REQUEST_GAME_BOOT, utf8_filename);
Expand Down
Loading