From 340bb4f99fd6bab90caf438ee896c203fa50ac36 Mon Sep 17 00:00:00 2001 From: calc84maniac Date: Mon, 29 Jan 2024 20:04:23 -0500 Subject: [PATCH] Fix extraneous pop, optimize early exit --- src/ce/getstringinput.src | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/ce/getstringinput.src b/src/ce/getstringinput.src index f8614c83f..407cb3165 100644 --- a/src/ce/getstringinput.src +++ b/src/ce/getstringinput.src @@ -45,14 +45,14 @@ _os_GetStringInput: sbc hl,de ld iy,flags call nz,_PutS - ld hl,(curRow) + ld de,(curRow) .start: - push hl ; save initial row/column ld hl,(ix+12) ; buffer size add hl,de xor a,a sbc hl,de - jp z,.empty + ret z + push de ; save initial row/column push ix push hl ; save remaining size ld de,(ix+9) @@ -131,8 +131,7 @@ _os_GetStringInput: sbc hl,bc ; decrement and compare to buf start add hl,bc jr nz,.clear_loop - ex de,hl - ld (curRow),hl + ld (curRow),de jp .start .done: call _ClrTxtShd @@ -148,7 +147,5 @@ _os_GetStringInput: pop hl ; remaining size pop hl ; saved IX pop hl ; initial row/column -.empty: - pop hl pop ix ret