diff --git a/sim/fakes/_sim.py b/sim/fakes/_sim.py index b367feb54293d130bca1f53c3eb1bf6ef35b21c8..95f801b930dc7339d7fcf1fb094fa868aa8185d4 100644 --- a/sim/fakes/_sim.py +++ b/sim/fakes/_sim.py @@ -24,6 +24,7 @@ bgpath = os.path.join(simpath, "background.png") background = pygame.image.load(bgpath) OLED_SIZE = int(os.environ["SIM_OLED_SIZE"]) +OLED_ASPECT = float(os.environ["SIM_OLED_ASPECT"]) class Input: @@ -414,9 +415,11 @@ class Simulation: center_x = screen_w // 2 center_y = screen_h // 2 if FULL_SCREEN: - off_x = center_x - (screen_h // 2) + off_x = center_x - (screen_h * OLED_ASPECT // 2) off_y = center_y - (screen_h // 2) - new = pygame.transform.scale(self._oled_surface, (screen_h, screen_h)) + new = pygame.transform.scale( + self._oled_surface, (screen_h * OLED_ASPECT, screen_h) + ) full.blit(new, (off_x, off_y)) else: off_x = center_x - (OLED_SIZE // 2) diff --git a/sim/run.py b/sim/run.py index c76ee31fb08d3cf552a9569ef264d2c01cea5857..4bbff6f351a34ad6dbbb44217afa999d29cde674 100644 --- a/sim/run.py +++ b/sim/run.py @@ -116,11 +116,13 @@ def sim_main(): "--full-screen", dest="full_screen", action="store_true", default=False ) parser.add_argument("--oled-size", dest="oled_size", default=240) + parser.add_argument("--oled-aspect", dest="oled_aspect", default=1) parser.add_argument("override_app", nargs="?") args = parser.parse_args() os.environ["SIM_FULL_SCREEN"] = "1" if args.full_screen else "0" os.environ["SIM_OLED_SIZE"] = str(args.oled_size) + os.environ["SIM_OLED_ASPECT"] = str(args.oled_aspect) import _sim _sim.SCREENSHOT = args.screenshot