Prev: 39952 Up: Map Next: 39996
39979: Screen Address One Pixel Below
Moves a screen address down by one pixel line.
Input
HL Screen address
Output
HL Screen address of the next line down
ScreenPosition1PixelBelow 39979 INC H Move down a line within the character.
39980 LD A,H Fetch the high byte of the screen address.
39981 AND 7 Keep only the line number.
39983 RET NZ Return unless the character boundary has been crossed.
39984 LD A,L Fetch the low byte of the screen address.
39985 ADD A,32 Move on to the next character row.
39987 LD L,A Store the low byte of the screen address.
39988 AND 224 Keep only the row bits.
39990 RET Z Return if the third of the screen has not been crossed.
39991 LD A,H Copy H to A.
39992 SUB 8 Go back up to the first line of the character.
39994 LD H,A Store the high byte of the screen address.
39995 RET Return.
View the equivalent code in;
Prev: 39952 Up: Map Next: 39996