From 167ef3bc4bd166764fa97735d38b354c22dd1b6c Mon Sep 17 00:00:00 2001 From: zerico <71151164+ZERICO2005@users.noreply.github.com> Date: Wed, 4 Feb 2026 12:44:26 -0700 Subject: [PATCH 1/3] conditional call optimization --- src/fileioc/fileioc.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fileioc/fileioc.asm b/src/fileioc/fileioc.asm index 138a2fb08..960e6c429 100644 --- a/src/fileioc/fileioc.asm +++ b/src/fileioc/fileioc.asm @@ -462,8 +462,8 @@ ti_SetArchiveStatus: call ti.ChkFindSym jp c, util_ret_neg_one call ti.ChkInRam - jr z, .save_ptrs - call util_skip_archive_header + ; jr z, .save_ptrs + call nz, util_skip_archive_header .save_ptrs: push hl call util_get_vat_ptr From 218e992f800245dc17336e2016725f0da1b18f1f Mon Sep 17 00:00:00 2001 From: zerico <71151164+ZERICO2005@users.noreply.github.com> Date: Wed, 11 Feb 2026 13:55:45 -0700 Subject: [PATCH 2/3] optimized ti_DeleteVar stack load --- src/fileioc/fileioc.asm | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/fileioc/fileioc.asm b/src/fileioc/fileioc.asm index 960e6c429..c79a3322a 100644 --- a/src/fileioc/fileioc.asm +++ b/src/fileioc/fileioc.asm @@ -783,13 +783,9 @@ ti_DeleteVar: ; sp + 6 : variable type ; return: ; hl = 0 if failure - pop hl - pop de - pop bc - push bc - push de - push hl - ld a, c + ld hl, 6 + add hl, sp + ld a, (hl) ; jr ti_Delete.start ; emulated by dummifying next instruction: db $fe ; ld a, ti.AppVarObj -> cp a, $3E \ dec d assert ti.AppVarObj = $15 From ce11f13b7a559dbf2e4801646e149f12e2597e73 Mon Sep 17 00:00:00 2001 From: zerico <71151164+ZERICO2005@users.noreply.github.com> Date: Mon, 2 Mar 2026 12:52:11 -0700 Subject: [PATCH 3/3] optimize ti_Detect cmp zero testing --- src/fileioc/fileioc.asm | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/fileioc/fileioc.asm b/src/fileioc/fileioc.asm index c79a3322a..8394ca2a1 100644 --- a/src/fileioc/fileioc.asm +++ b/src/fileioc/fileioc.asm @@ -944,24 +944,19 @@ ti_Detect: ld (.smc_flag), a push ix ld ix, 0 + lea bc, ix + 0 add ix, sp ld hl, (ix + 9) - add hl, bc - or a, a - sbc hl, bc + adc hl, bc jr nz, .detectall ; if null, then detect everything ld hl, .fdetectall ld (ix + 9), hl .detectall: ld hl, (ix + 6) - add hl, bc - or a, a - sbc hl, bc + adc hl, bc jr z, .fstart ld hl, (hl) - add hl, bc - or a, a - sbc hl, bc + adc hl, bc jr nz, .fdetect .fstart: ld hl, (ti.progPtr)