commit c0d4565dcd3687f55ccbe6054053828389477766
Author: Jon Bell <j.to.the.bell@gmail.com>
AuthorDate: Wed Jun 1 19:30:40 2022 -0600
Commit: Jon Bell <j.to.the.bell@gmail.com>
CommitDate: Wed Jun 1 20:11:17 2022 -0600
Fix screen scaling on miyoo mini
---
platform/miyoomini/source/MiyooMiniHost.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/platform/miyoomini/source/MiyooMiniHost.cpp b/platform/miyoomini/source/MiyooMiniHost.cpp
index 47005a6..4558a1c 100644
--- a/platform/miyoomini/source/MiyooMiniHost.cpp
+++ b/platform/miyoomini/source/MiyooMiniHost.cpp
@@ -144,8 +144,13 @@ void audioSetup(){
}
void _setSourceRect(int xoffset, int yoffset) {
- SrcR.x = xoffset;
- SrcR.y = yoffset;
+ //miyoo mini has an upside down screen, so the texture is flipped and we need to offset these values
+ int scalexoffset = drawModeScaleX == 2 ? 64 : 0;
+ int scaleyoffset = drawModeScaleY == 2 ? 64 : 0;
+
+ SrcR.x = xoffset + scalexoffset;
+ SrcR.y = yoffset + scaleyoffset;
+
SrcR.w = PicoScreenWidth / drawModeScaleX - (xoffset * 2);
SrcR.h = PicoScreenHeight / drawModeScaleY - (yoffset * 2);
}