Skip to content

Commit 79f9145

Browse files
committed
optimize ti_Detect cmp zero testing
1 parent f9f8c85 commit 79f9145

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

src/fileioc/fileioc.asm

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -944,24 +944,19 @@ ti_Detect:
944944
ld (.smc_flag), a
945945
push ix
946946
ld ix, 0
947+
lea bc, ix + 0
947948
add ix, sp
948949
ld hl, (ix + 9)
949-
add hl, bc
950-
or a, a
951-
sbc hl, bc
950+
adc hl, bc
952951
jr nz, .detectall ; if null, then detect everything
953952
ld hl, .fdetectall
954953
ld (ix + 9), hl
955954
.detectall:
956955
ld hl, (ix + 6)
957-
add hl, bc
958-
or a, a
959-
sbc hl, bc
956+
adc hl, bc
960957
jr z, .fstart
961958
ld hl, (hl)
962-
add hl, bc
963-
or a, a
964-
sbc hl, bc
959+
adc hl, bc
965960
jr nz, .fdetect
966961
.fstart:
967962
ld hl, (ti.progPtr)

0 commit comments

Comments
 (0)