diff --git a/Core/CoreParameter.h b/Core/CoreParameter.h index a39385f5b5..bd9b219e62 100644 --- a/Core/CoreParameter.h +++ b/Core/CoreParameter.h @@ -49,8 +49,15 @@ struct CoreParameter bool printfEmuLog; // writes "emulator:" logging to stdout bool headLess; // Try to avoid messageboxes etc + // Internal PSP resolution int renderWidth; int renderHeight; + + // Virtual (dpi-adjusted) output resolution int outputWidth; int outputHeight; + + // Actual pixel output resolution (for use by glViewport and the like) + int pixelWidth; + int pixelHeight; }; diff --git a/GPU/GLES/DisplayListInterpreter.cpp b/GPU/GLES/DisplayListInterpreter.cpp index adcb193fd2..bb5ac7cf61 100644 --- a/GPU/GLES/DisplayListInterpreter.cpp +++ b/GPU/GLES/DisplayListInterpreter.cpp @@ -82,7 +82,7 @@ void GLES_GPU::InitClear() // glClearColor(1,0,1,1); glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); } - glViewport(0, 0, renderWidth_, renderHeight_); + glViewport(0, 0, PSP_CoreParameter().pixelWidth, PSP_CoreParameter().pixelHeight); } void GLES_GPU::BeginFrame() @@ -115,7 +115,7 @@ void GLES_GPU::CopyDisplayToOutput() VirtualFramebuffer *vfb = GetDisplayFBO(); fbo_unbind(); - glViewport(0, 0, PSP_CoreParameter().outputWidth, PSP_CoreParameter().outputHeight); + glViewport(0, 0, PSP_CoreParameter().pixelWidth, PSP_CoreParameter().pixelHeight); currentRenderVfb_ = 0; diff --git a/Windows/EmuThread.cpp b/Windows/EmuThread.cpp index 5187227481..da27fd6804 100644 --- a/Windows/EmuThread.cpp +++ b/Windows/EmuThread.cpp @@ -60,18 +60,20 @@ DWORD TheThread(LPVOID x) INFO_LOG(BOOT, "Starting up hardware."); - CoreParameter coreParameter; - coreParameter.fileToStart = fileToStart; - coreParameter.enableSound = true; - coreParameter.gpuCore = GPU_GLES; - coreParameter.cpuCore = g_Config.bJIT ? CPU_JIT : CPU_INTERPRETER; - coreParameter.enableDebugging = true; - coreParameter.printfEmuLog = false; - coreParameter.headLess = false; + CoreParameter coreParameter; + coreParameter.fileToStart = fileToStart; + coreParameter.enableSound = true; + coreParameter.gpuCore = GPU_GLES; + coreParameter.cpuCore = g_Config.bJIT ? CPU_JIT : CPU_INTERPRETER; + coreParameter.enableDebugging = true; + coreParameter.printfEmuLog = false; + coreParameter.headLess = false; coreParameter.renderWidth = 480 * g_Config.iWindowZoom; coreParameter.renderHeight = 272 * g_Config.iWindowZoom; coreParameter.outputWidth = 480 * g_Config.iWindowZoom; coreParameter.outputHeight = 272 * g_Config.iWindowZoom; + coreParameter.pixelWidth = 480 * g_Config.iWindowZoom; + coreParameter.pixelHeight = 272 * g_Config.iWindowZoom; std::string error_string; if (!PSP_Init(coreParameter, &error_string)) diff --git a/android/jni/EmuScreen.cpp b/android/jni/EmuScreen.cpp index a2c07a60b9..7b11d3c9ed 100644 --- a/android/jni/EmuScreen.cpp +++ b/android/jni/EmuScreen.cpp @@ -65,6 +65,8 @@ EmuScreen::EmuScreen(const std::string &filename) : invalid_(true) coreParam.renderHeight = 272; coreParam.outputWidth = dp_xres; coreParam.outputHeight = dp_yres; + coreParam.pixelWidth = pixel_xres; + coreParam.pixelHeight = pixel_yres; std::string error_string; if (PSP_Init(coreParam, &error_string)) { @@ -176,7 +178,7 @@ void EmuScreen::render() uiTexture->Bind(0); - glViewport(0, 0, dp_xres, dp_yres); + glViewport(0, 0, pixel_xres, pixel_yres); ui_draw2d.Begin(DBMODE_NORMAL);