Prev: 34265 Up: Map Next: 34310
34294: Screen Address One Pixel Above
Used by the routines at 34190, 34310, 34745, 35749 and 43411.
Input
HL Current position
Output
HL Address for new position
Calculates the new address for writing a sprite pixel, in an upward direction, taking into consideration the screen memory layout.
ScreenPos1PixelAbove 34294 DEC H Decrement H by one to move up one pixel on screen.
34295 LD A,H Store the inverted result in A.
34296 CPL
34297 AND %00000111 Keep only bits 0-2.
34299 RET NZ If a screen bank boundary has not been crossed then return.
34300 LD A,L Else subtract 32 from L.
34301 SUB 32
34303 LD L,A
34304 RET C If there is any carry then return.
34305 LD A,H Else add 8 to H and return.
34306 ADD A,8
34308 LD H,A
34309 RET Return.
Prev: 34265 Up: Map Next: 34310