05-30-2012, 10:08 PM
I'm puzzled.
The __DECY routine and the one in our code *differ*
hock:
I now remember where did I took these routines from this Speccy Tutorial
The dec b, and ex af, af' sequence on the left (marked with an asterisk *) can be ignored. But the SP routine on the right does an extra ADD a, 08 mine does not do :?:
Accoding to Speccy.org seems to be an optimization. Any ideas?
The __DECY routine and the one in our code *differ*

I now remember where did I took these routines from this Speccy Tutorial
Code:
__DECY: SPPixelDown:
* dec b inc h
inc h ld a,h
ld a, h and $07
and 7 ret nz
ret nz ld a,h
* ex af, af' sub $08
* scf ld h,a
* ex af, af' ld a,l
ld a, l add a,$20
add a, 32 ld l,a
ld l, a ret nc
ret c ld a,h
ld a, h add a,$08
sub 8 ld h,a
ld h, a cp $58
ret ccf
ret
Accoding to Speccy.org seems to be an optimization. Any ideas?