Prev: 9ECE Up: Map Next: 9F13
9F03: Screen Address One Pixel Above
Moves a screen address up by one pixel row, allowing for the layout of the screen. The XOR sprite row routines continue here so that they finish with the screen address of the row above the one just drawn.
Input
HL The screen address
Output
HL The screen address one pixel row above
ScreenPosition1PixelAbove 9F03 DEC H Decrease H by one to move up one pixel row within the character cell.
9F04 LD A,H A=H.
9F05 CPL Flip the bits.
9F06 AND %00000111 Keep only bits 0-2.
9F08 RET NZ Return if still inside the same character cell.
9F09 LD A,L A=L.
9F0A SUB $20 Subtract 20 to move up a character row.
9F0C LD L,A L=A.
9F0D RET C Return if that moved into the previous third of the screen (the address is then already correct).
9F0E LD A,H A=H.
9F0F ADD A,$08 Add 08.
9F11 LD H,A H=A.
9F12 RET Return.
View the equivalent code in;
Prev: 9ECE Up: Map Next: 9F13