04-08-2012, 12:48 AM
boriel Wrote:I'm also wondering which one is faster!
I think they have to be....similar. Given they are byte for byte identical:
Code:
;
; enter: HL = valid screen address
; exit : Carry = moved off screen ;; Given an HL screen position, calculates
; HL = moves one pixel up ;; the above position
; used : AF, HL ;; Also updates BC coords
__INCY:
SPPixelUp: inc b
ld a,h ld a, h
dec h dec h
and $07 and 7
ret nz ret nz
ex af, af' ; Sets carry on F'
scf ; which flags ATTR must be updated
ex af, af'
ld a,$08 ld a, 8
add a,h add a, h
ld h,a ld h, a
ld a,l ld a, l
sub $20 sub 32
ld l,a ld l, a
ret nc ret nc
ld a,h ld a, h
sub $08 sub 8
ld h,a ld h, a
cp $40
ret ret