Prev: 9C88 Up: Map Next: 9D34
9D07: Scroll Message Area
Used by the routine at PrintMessage.
Scrolls the pixels of the message area (12 characters wide and 10 pixel rows tall) up by one pixel row.
Input
A Number of lines still to scroll
ScrollMessageArea 9D07 LD HL,$A828 Point HL at the position of the message area, with an X position of 28 and a Y position of A8.
9D0A DEC A One less line has to be scrolled.
9D0B LD ($9657),A Store the new count.
9D0E CALL ScreenAddress Convert the position into a screen address using ScreenAddress.
9D11 LD C,$12 Scroll 12 columns, from left to right.
ScrollMessageArea_Column 9D13 PUSH HL Save the address of the top of the column.
9D14 LD B,$10 Each column is 10 pixels tall.
ScrollMessageArea_Row 9D16 LD E,L Copy the address into DE, as the destination.
9D17 LD D,H
9D18 LD A,H Fetch the high byte of the address.
9D19 INC H Move HL down by one pixel row.
9D1A CPL Jump if the pixel row is in the same character row.
9D1B AND $07
9D1D JR NZ,ScrollMessageArea_Copy
9D1F LD A,H Otherwise go back to the first pixel row of the character row...
9D20 SUB $08
9D22 LD H,A
9D23 LD A,L Fetch the low byte of the address.
9D24 ADD A,$20 Add 20 (this result is not used).
9D26 LD A,L ...and move down to the next character row.
9D27 ADD A,$20
9D29 LD L,A
ScrollMessageArea_Copy 9D2A LD A,(HL) Fetch the byte from the pixel row below...
9D2B LD (DE),A ...and copy it to the pixel row above.
9D2C DJNZ ScrollMessageArea_Row Loop back until the column has been scrolled.
9D2E POP HL Restore the address of the top of the column.
9D2F INC L Move on to the next column.
9D30 DEC C Count down the columns.
9D31 JR NZ,ScrollMessageArea_Column Loop back until every column has been scrolled.
9D33 RET Return.
Prev: 9C88 Up: Map Next: 9D34