Prev: 27770 Up: Map Next: 28217
28154: Clear Illustration
Used by the routine at DrawIfPictures.
Blanks the illustration from pixel row 175 down to 80, lets the picture bytecode paint the saved attributes, then copies that buffer onto the screen.
Blank the illustration pixels, row by row, from row 175 down to row 80.
ClearIllustration 28154 LD BC,44800 Pixel row 175, column 0.
Blank one pixel row of 32 bytes.
ClearIllustration_Row 28157 PUSH BC Stash the row counter on the stack.
28158 CALL 8874 Call PIXEL_ADD for this row's screen address.
28161 PUSH HL Copy the screen address to DE (using the stack).
28162 POP DE
28163 INC DE Advance to the next byte.
28164 LD BC,31 Count the remaining 0031 bytes of this row.
28167 LD (HL),0 Write 0 across the rest of the row.
28169 LDIR
28171 POP BC Restore the row counter from the stack.
28172 DEC B Count down one row.
28173 LD A,79 Jump to ClearIllustration_Row until row 80 has been cleared.
28175 CP B
28176 JR NZ,ClearIllustration_Row
Clear the matching attribute rows, then copy them into the illustration buffer.
28178 LD HL,22528 Point HL at 22528 (attribute buffer).
28181 LD DE,22529 Point DE at the next byte.
28184 LD BC,383 Count the remaining 383 bytes of the top twelve rows.
28187 LD (HL),0 Write 0 across the block.
28189 LDIR
28191 LD HL,22528 Copy 384 bytes from 22528 (attribute buffer) to AttributeBuffer.
28194 LD DE,27770
28197 LD BC,384
28200 LDIR
Paint the picture into the buffer.
28202 CALL DrawRoomPicture Call DrawRoomPicture.
Copy the painted attributes back onto the screen.
28205 LD DE,22528 Copy 384 bytes from AttributeBuffer to 22528 (attribute buffer).
28208 LD HL,27770
28211 LD BC,384
28214 LDIR
28216 RET Return.
Prev: 27770 Up: Map Next: 28217