Prev: 30074 Up: Map Next: 30106
30085: 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 30085 DEC H Decrease H by one to move up one pixel row within the character cell.
30086 LD A,H Store the result in A.
30087 AND %00000111 Keep only bits 0-2.
30089 CP 7 Return if the top of the character cell has not been crossed.
30091 RET NZ
30092 LD A,L Subtract 32 from L to move up one character row.
30093 SUB 32
30095 LD L,A
30096 AND %11100000 Keep only bits 5-7.
30098 CP 224 Return if the move crossed into the previous third of the screen (the address is then already correct).
30100 RET Z
30101 LD A,H Add 8 to H to move to the bottom pixel row of the character row above, then return.
30102 ADD A,8
30104 LD H,A
30105 RET
View the equivalent code in;
Prev: 30074 Up: Map Next: 30106