shithub: zelda3

Download patch

ref: 121acf31ed534827f23d85772344557be391ddaa
parent: 7c2244c512ad90f2592291d331a4708689a258f1
author: Snesrev <snesrev@protonmail.com>
date: Wed Sep 7 20:39:17 EDT 2022

Option to ignore aspect ratio (#56)

--- a/config.c
+++ b/config.c
@@ -209,6 +209,9 @@
     } else if (StringEqualsNoCase(key, "NewRenderer")) {
       g_config.new_renderer = atoi(value);
       return true;
+    } else if (StringEqualsNoCase(key, "IgnoreAspectRatio")) {
+      g_config.ignore_aspect_ratio = atoi(value);
+      return true;
     }
 
   }
--- a/config.h
+++ b/config.h
@@ -34,6 +34,7 @@
 typedef struct Config {
   bool enhanced_mode7;
   bool new_renderer;
+  bool ignore_aspect_ratio;
 } Config;
 
 extern Config g_config;
--- a/main.c
+++ b/main.c
@@ -170,7 +170,8 @@
     return 1;
   }
   g_renderer = renderer;
-  SDL_RenderSetLogicalSize(renderer, 512, 480); 
+  if (!g_config.ignore_aspect_ratio)
+    SDL_RenderSetLogicalSize(renderer, 512, 480); 
   SDL_Texture* texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBX8888, SDL_TEXTUREACCESS_STREAMING, kRenderWidth * 2, kRenderHeight * 2);
   if(texture == NULL) {
     printf("Failed to create texture: %s\n", SDL_GetError());
--- a/zelda3.ini
+++ b/zelda3.ini
@@ -1,6 +1,7 @@
 [Graphics]
 NewRenderer = 1
 EnhancedMode7 = 1
+IgnoreAspectRatio = 1
 
 
 [KeyMap]