diff --git a/src/core.cpp b/src/core.cpp index 1cf595ed..ad43eb86 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -2205,7 +2205,7 @@ extern "C" RETRO_API bool retro_load_game(const struct retro_game_info *info) { }; hw_render.context_destroy = nullptr; hw_render.cache_context = true; - hw_render.bottom_left_origin = true; + hw_render.bottom_left_origin = false; if (hw_render.context_type = RETRO_HW_CONTEXT_OPENGL_CORE, hw_render.version_major = 4, hw_render.version_minor = 6, environment(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render)) { log_printf(RETRO_LOG_INFO, "Using OpenGL 4.6 graphics driver\n"); } else if (hw_render.context_type = RETRO_HW_CONTEXT_OPENGL_CORE, hw_render.version_major = 4, hw_render.version_minor = 5, environment(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render)) { diff --git a/src/display/graphics.cpp b/src/display/graphics.cpp index 9edd600b..d74c8ce7 100644 --- a/src/display/graphics.cpp +++ b/src/display/graphics.cpp @@ -1272,16 +1272,26 @@ struct GraphicsPrivate { metaBlitBufferFlippedScaled(scRes, scaleIsSpecial); GLMeta::blitRectangle( IntRect(0, 0, scRes.x, scRes.y), +#ifdef MKXPZ_RETRO + // Don't need to vertically flip the screen in libretro builds because the libretro frontend will do it for us + IntRect(scOffset.x, scOffset.y, scSize.x, scSize.y), +#else IntRect(scOffset.x, (scSize.y + scOffset.y), scSize.x, -scSize.y), +#endif // MKXPZ_RETRO GLMeta::smoothScalingMethod(scaleIsSpecial) == Bilinear); } void metaBlitBufferFlippedScaled(const Vec2i &sourceSize, int scaleIsSpecial, bool forceNearestNeighbor=false) { GLMeta::blitRectangle(IntRect(0, 0, sourceSize.x, sourceSize.y), +#ifdef MKXPZ_RETRO + // Don't need to vertically flip the screen in libretro builds because the libretro frontend will do it for us + IntRect(scOffset.x, scOffset.y, scSize.x, scSize.y), +#else IntRect(scOffset.x, scSize.y+scOffset.y, scSize.x, -scSize.y), +#endif // MKXPZ_RETRO !forceNearestNeighbor && GLMeta::smoothScalingMethod(scaleIsSpecial) == Bilinear); }