Prev: 757A Up: Map Next: 759A
7585: Screen Address One Pixel Above
Used by the routine at MaskSprite.
Moves a screen address up by one pixel row, allowing for the layout of the screen buffer.
Input
HL Screen address
Output
HL Screen address one pixel row above
ScreenPosition1PixelAbove 7585 DEC H Decrease H by one to move up one pixel row within the character cell.
7586 LD A,H Store the result in A.
7587 AND %00000111 Keep only bits 0-2.
7589 CP $07 Return if the top of the character cell has not been crossed.
758B RET NZ
758C LD A,L Subtract 20 from L to move up one character row.
758D SUB $20
758F LD L,A
7590 AND %11100000 Keep only bits 5-7.
7592 CP $E0 Return if the move crossed into the previous third of the screen (the address is then already correct).
7594 RET Z
7595 LD A,H Add 08 to H to move to the bottom pixel row of the character row above, then return.
7596 ADD A,$08
7598 LD H,A
7599 RET
View the equivalent code in;
Prev: 757A Up: Map Next: 759A