Routines |
Prev: DA56 | Up: Map | Next: DADC |
Used by the routines at D609, D8CA, D939, D989, D9F0, DA56, DAE7, Print_HelperPreviewImage, DC74, Draw_Cursor, E81F, E83A and StaticAnimation.
|
||||||||||||||
Calculate_ScreenBlockAddress | DACD | LD A,B | Load the X position into A. | |||||||||||
DACE | AND %11111000 | Divide X by 08 to extract only the column number. | ||||||||||||
DAD0 | ADD A,$40 | Add 40 to get the high byte of screen address and store the result in H. | ||||||||||||
DAD2 | LD H,A | |||||||||||||
DAD3 | LD A,B | Load the X position into A again. | ||||||||||||
DAD4 | AND %00000111 | Extract only the pixel offset within the character block. | ||||||||||||
DAD6 | RRCA | Multiply A by 20. | ||||||||||||
DAD7 | RRCA | |||||||||||||
DAD8 | RRCA | |||||||||||||
DAD9 | ADD A,C | Add the Y co-ordinate store the result in L. | ||||||||||||
DADA | LD L,A | |||||||||||||
DADB | RET | Return. |
Prev: DA56 | Up: Map | Next: DADC |