|  | Routines | 
| Prev: A8AF | Up: Map | Next: A900 | 
| 
Used by the routine at DrawRoom.
 | ||||
| 
First off, blank the screen.
 | ||||
| ClearRoomBuffer | A8D8 | LD B,$18 | Clear the bottom 18 lines using CL_LINE. | |
| A8DA | CALL $0E44 | |||
| 
Clear the room buffer.
 | ||||
| A8DD | LD BC,$0320 | Set a counter in BC with the length of the room buffer (0320 bytes). | ||
| A8E0 | LD HL,$A1C4 | HL=BufferRoom. | ||
| ClearRoomBuffer_Loop | A8E3 | LD A,$00 | Write 00 to *HL. | |
| A8E5 | LD (HL),A | |||
| A8E6 | INC HL | Increment the room buffer pointer by one. | ||
| A8E7 | DEC BC | Decrease the room buffer counter by one. | ||
| A8E8 | LD A,B | Jump to ClearRoomBuffer_Loop until the room buffer counter is zero. | ||
| A8E9 | OR C | |||
| A8EA | JR NZ,ClearRoomBuffer_Loop | |||
| 
Clear the room attribute buffer. Setting each value to the INK value of the PAPER colour (?)
 | ||||
| A8EC | LD BC,$0320 | BC=Counter; the length of the room attribute buffer (0320). | ||
| ClearRoomAttributeBuffer_Loop | A8EF | LD A,($5BD1) | A=*ActiveRoom_PaperColour. | |
| A8F2 | SLA A | Convert a PAPER value (using bits 3, 4 and 5) to an INK value (shifted left to bits 0, 1 and 2). | ||
| A8F4 | SLA A | |||
| A8F6 | SLA A | |||
| A8F8 | LD (HL),A | Write A to *HL. | ||
| A8F9 | INC HL | Increment the room attribute buffer pointer by one. | ||
| A8FA | DEC BC | Decrease the room attribute buffer counter by one. | ||
| A8FB | LD A,B | Jump to ClearRoomAttributeBuffer_Loop until the room attribute buffer counter is zero. | ||
| A8FC | OR C | |||
| A8FD | JR NZ,ClearRoomAttributeBuffer_Loop | |||
| A8FF | RET | Return. | ||
| Prev: A8AF | Up: Map | Next: A900 |