foxygit / fake-08-xbox360 Log in
commit 516cfab32ea44e58b13640ea925a0c600dfb2989
Author:     Jon Bell <j.to.the.bell@gmail.com>
AuthorDate: Wed Feb 2 21:40:41 2022 -0700
Commit:     Jon Bell <j.to.the.bell@gmail.com>
CommitDate: Wed Feb 2 21:40:41 2022 -0700

    Miyoo Mini stretch options
---
 platform/SDL1_2/Makefile                    | 10 ++++++++--
 platform/miyoomini/source/MiyooMiniHost.cpp | 18 ++++++++++++------
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/platform/SDL1_2/Makefile b/platform/SDL1_2/Makefile
index 61d8344..d43a645 100644
--- a/platform/SDL1_2/Makefile
+++ b/platform/SDL1_2/Makefile
@@ -11,6 +11,7 @@ BUILD		:=	build
 SOURCES		:=	${SOURCES} source
 INCLUDES	:=	${INCLUDES}

+#which platformm to use its host file
 IMITATE		:= miyoomini
 #IMITATE		:= bittboy

@@ -37,8 +38,8 @@ LDFLAGS	:= $(LIBS)

 ifeq ($(IMITATE),miyoomini)

-SOURCES += ../miyoomini/source/MiyooMiniHost.cpp
-CXXFLAGS += -D_DESKTOP
+SOURCES += ../miyoomini/source
+CXXFLAGS += -D_DESKTOP=1

 else

@@ -65,6 +66,11 @@ export DEPSDIR	:=	$(CURDIR)/$(BUILD)
 CFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
 CPPFILES	:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))

+ifeq ($(IMITATE),miyoomini)
+#ao.c is only for building on the actual mini
+CFILES := $(filter-out ao.c,$(CFILES))
+endif
+
 #---------------------------------------------------------------------------------
 # use CXX for linking C++ projects, CC for standard C
 #---------------------------------------------------------------------------------
diff --git a/platform/miyoomini/source/MiyooMiniHost.cpp b/platform/miyoomini/source/MiyooMiniHost.cpp
index b89a563..08a9c8c 100644
--- a/platform/miyoomini/source/MiyooMiniHost.cpp
+++ b/platform/miyoomini/source/MiyooMiniHost.cpp
@@ -283,23 +283,29 @@ void Host::setTargetFps(int targetFps){

 void Host::changeStretch(){
     if (stretchKeyPressed) {
+        printf("stretch pressed. stretch: %d\n", stretch);
         StretchOption newStretch = stretch;

-        if (stretch == StretchAndOverflow) {
+        if (stretch == PixelPerfectStretch) {
             newStretch = StretchToFit;
         }
-        if (stretch == StretchToFit) {
-            newStretch = PixelPerfectStretch;
+        else if (stretch == StretchToFit) {
+            newStretch = StretchToFill;
         }
-        else if (stretch == PixelPerfectStretch) {
+        else if (stretch == StretchToFill) {
             newStretch = StretchAndOverflow;
         }
-        else{
-            newStretch = StretchAndOverflow;
+        else if (stretch == StretchAndOverflow) {
+            newStretch = PixelPerfectStretch;
+        }
+        else {
+            newStretch = PixelPerfectStretch;
         }

         _changeStretch(newStretch);

+        printf("new stretch: %d\n", newStretch);
+
         stretch = newStretch;
         scaleX = _screenWidth / (float)PicoScreenWidth;
         scaleY = _screenHeight / (float)PicoScreenHeight;