From fbd9c49f8447090783de75d63e581c3d75ce0bc1 Mon Sep 17 00:00:00 2001 From: Andrew Alderwick Date: Thu, 20 Jan 2022 01:34:44 +0000 Subject: [PATCH] Fix resize when only width or height are set. --- src/devices/screen.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/devices/screen.c b/src/devices/screen.c index b028469..6d8de7f 100644 --- a/src/devices/screen.c +++ b/src/devices/screen.c @@ -133,12 +133,17 @@ screen_deo(Device *d, Uint8 port) { switch(port) { case 0x3: + if(!FIXED_SIZE) { + Uint16 w; + DEVPEEK16(w, 0x2); + screen_resize(&uxn_screen, clamp(w, 1, 1024), uxn_screen.height); + } + break; case 0x5: if(!FIXED_SIZE) { - Uint16 w, h; - DEVPEEK16(w, 0x2); + Uint16 h; DEVPEEK16(h, 0x4); - screen_resize(&uxn_screen, clamp(w, 1, 1024), clamp(h, 1, 1024)); + screen_resize(&uxn_screen, uxn_screen.width, clamp(h, 1, 1024)); } break; case 0xe: {