Prev: A1B3 Up: Map Next: A1D3
A1C3: Move HL up one pixel line
Moves a screen address one pixel line up the screen: the line above within the cell, or the bottom line of the cell above, crossing into the third above when the row was the top of a third. Everything in the game draws bottom-up -- the graphics are stored bottom row first -- so this, and copies of it written inline in the sprite routines, are what step the drawing. About 47 T-states with the CALL, most of the time.
Input
HL A screen address
Output
HL The address one pixel line above
line_up_hl A1C3 DEC H Up a line; done unless that was the top line of the cell (the line number wrapped to 7)
A1C4 LD A,H
A1C5 INC A
A1C6 AND $07
A1C8 RET NZ
A1C9 LD A,L Back up a character row; done if that borrowed, which means the row is in the same third and H is right as it is
A1CA SUB $20
A1CC LD L,A
A1CD RET C
A1CE LD A,H Otherwise put H back into the third the row is in
A1CF ADD A,$08
A1D1 LD H,A
A1D2 RET
Prev: A1B3 Up: Map Next: A1D3