diff --git a/src/fileioc/fileioc.asm b/src/fileioc/fileioc.asm index 138a2fb08..8394ca2a1 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 @@ -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 @@ -948,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)