Prev: 32311 Up: Map Next: 32360
32343: Attribute address finder, cx,cy to attr address
Find attribute address from cx,cy
Input
B cy
C cx
Output
HL aaddr of cx,cy
cxy2aaddr 32343 LD A,B
32344 OR 192 Input B with top 2 bits now set
32346 LD L,A
32347 LD H,2 HL is now 0x02Cx, where x came from B
32349 ADD HL,HL x2
32350 ADD HL,HL x4
32351 ADD HL,HL x8
32352 ADD HL,HL x16
32353 ADD HL,HL x32 - HL now at start of row cy
32354 LD A,C Pick up cx from input parameter
32355 ADD A,L Add as offset
32356 LD L,A
32357 RET NC If cx was greater than 32 move to next row
32358 INC H
32359 RET Result address in HL
Prev: 32311 Up: Map Next: 32360