Prev: 72ab Up: Map Next: 72d0
72b6: Calculate screen address one pixel above current position.
Calculates the new address for writing a sprite pixel, in an upward direction, taking into consideration the screen memory layout.
Used by the routine at 7705.
Input
HL Current position.
Output
HL Address for new position.
72b6 dec h Decrement H to move up one pixel on screen
72b7 ld a,h
72b8 and $07
72ba cp $07 Has a character line been crossed?
72bc ret nz If not, return
72bd ld a,l else subtract 32 from L
72be sub $20
72c0 ld l,a
72c1 and $e0
72c3 cp $e0 Has a new section of the screen been crossed?
72c5 ret z Return if not
72c6 ld a,h
72c7 add a,$08
72c9 ld h,a
72ca ret
Prev: 72ab Up: Map Next: 72d0