53 ; expects X -> c, Y -> b, returns in de
57 sla b ; change from blocks to pixels
59 ; construct low address byte -> e
60 ld a, b ; start with Y
63 and $e0 ; keep top 3 bits
66 and $1f ; keep low 5 bits
67 or e ; combine with Y bits
68 ld e, a ; move the result back to e
69 ; construct high address byte -> d
70 ld a, b ; start with Y again
74 and $18 ; keep bits 3 and 4
75 ld d, a ; keep it in d
76 ld a, b ; grap Y one more time
77 and $7 ; keep low 3 bits of Y in a
78 or d ; combine with Y6-Y7
80 or b ; combine with high byte of fb address
81 ld d, a ; move result back to d