I guess you all know the code, but it has a bug. Find it!
Also present the solution (smallest size)
Code: Select all
getpixel:
ld h, 0
ld d, h
ld e, l
add hl, hl
add hl, de
add hl, hl
add hl, hl
ld de, gbuf
add hl, de
ld e, a
srl e
srl e
srl e
add hl, de
and 7
ld b, a
ld a, %10000000
ret z
-
rrca
djnz -
ret