Prev: A503 Up: Map Next: A55E
A535: Computes address into attribute file based of (x,y)-pixel-position on screen
Used by the routine at CF9B.
Input
$A0AF x-pixel-position
$A0B0 y-pixel-position
Output
HL Address into attribute file
A535 LD A,($A0B0) Computes into HL the address offset for the y-position
A538 LD L,A
A539 LD H,$00
A53B SRL H
A53D RR L
A53F SRL H
A541 RR L
A543 SRL H
A545 RR L
A547 ADD HL,HL
A548 ADD HL,HL
A549 ADD HL,HL
A54A ADD HL,HL
A54B ADD HL,HL
A54C LD A,($A0AF) Computes into DE the address offset for the x-position
A54F SRL A
A551 SRL A
A553 SRL A
A555 LD E,A
A556 LD D,$00
A558 ADD HL,DE Set HL to the address into attribute file
A559 LD DE,$5800
A55C ADD HL,DE
A55D RET
Prev: A503 Up: Map Next: A55E