Prev: 40654 Up: Map Next: 40723
40707: 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 40707 DEC H Decrease H by one to move up one pixel row within the character cell.
40708 LD A,H A=H.
40709 CPL Flip the bits.
40710 AND %00000111 Keep only bits 0-2.
40712 RET NZ Return if still inside the same character cell.
40713 LD A,L A=L.
40714 SUB 32 Subtract 32 to move up a character row.
40716 LD L,A L=A.
40717 RET C Return if that moved into the previous third of the screen (the address is then already correct).
40718 LD A,H A=H.
40719 ADD A,8 Add 8.
40721 LD H,A H=A.
40722 RET Return.
View the equivalent code in;
Prev: 40654 Up: Map Next: 40723