![]() |
Routines |
| Prev: 40072 | Up: Map | Next: 40244 |
|
Used by the routine at PrintMessage.
Scrolls the pixels of the message area (18 characters wide and 16 pixel rows tall) up by one pixel row.
|
||||||||
| ScrollMessageArea | 40199 | LD HL,43048 | Point HL at the position of the message area, with an X position of 40 and a Y position of 168. | |||||
| 40202 | DEC A | One less line has to be scrolled. | ||||||
| 40203 | LD (38487),A | Store the new count. | ||||||
| 40206 | CALL ScreenAddress | Convert the position into a screen address using ScreenAddress. | ||||||
| 40209 | LD C,18 | Scroll 18 columns, from left to right. | ||||||
| ScrollMessageArea_Column | 40211 | PUSH HL | Save the address of the top of the column. | |||||
| 40212 | LD B,16 | Each column is 16 pixels tall. | ||||||
| ScrollMessageArea_Row | 40214 | LD E,L | Copy the address into DE, as the destination. | |||||
| 40215 | LD D,H | |||||||
| 40216 | LD A,H | Fetch the high byte of the address. | ||||||
| 40217 | INC H | Move HL down by one pixel row. | ||||||
| 40218 | CPL | Jump if the pixel row is in the same character row. | ||||||
| 40219 | AND 7 | |||||||
| 40221 | JR NZ,ScrollMessageArea_Copy | |||||||
| 40223 | LD A,H | Otherwise go back to the first pixel row of the character row... | ||||||
| 40224 | SUB 8 | |||||||
| 40226 | LD H,A | |||||||
| 40227 | LD A,L | Fetch the low byte of the address. | ||||||
| 40228 | ADD A,32 | Add 32 (this result is not used). | ||||||
| 40230 | LD A,L | ...and move down to the next character row. | ||||||
| 40231 | ADD A,32 | |||||||
| 40233 | LD L,A | |||||||
| ScrollMessageArea_Copy | 40234 | LD A,(HL) | Fetch the byte from the pixel row below... | |||||
| 40235 | LD (DE),A | ...and copy it to the pixel row above. | ||||||
| 40236 | DJNZ ScrollMessageArea_Row | Loop back until the column has been scrolled. | ||||||
| 40238 | POP HL | Restore the address of the top of the column. | ||||||
| 40239 | INC L | Move on to the next column. | ||||||
| 40240 | DEC C | Count down the columns. | ||||||
| 40241 | JR NZ,ScrollMessageArea_Column | Loop back until every column has been scrolled. | ||||||
| 40243 | RET | Return. | ||||||
| Prev: 40072 | Up: Map | Next: 40244 |