Prev: E597 Up: Map Next: E5E8
E5BA: Clear the screen
Used by the routine at DRAW_ROOM_RECORD.
Krumlinde's RTN_Clear_Room_Screen. The attributes are filled with the byte at IY+$68 (always 0: DRAW_ROOM_RECORD sets it just before) and the pixels with zeros, by pushing: SP is pointed at the end of each area in turn, the value pushed eight bytes at a time, and SP put back. The second area is filled by falling into the loop the first was filled by with a CALL.
CLEAR_ROOM_SCREEN E5BA LD HL,SPRITE5B00 The attributes: 96 turns, down from their end.
E5BD LD A,(WORK_SPRITE)
E5C0 LD E,A
E5C1 LD D,A
E5C2 LD BC,$0060
E5C5 CALL CLEAR_ROOM_SCREEN_0
E5C8 LD DE,$0000 Then the pixels, below them: 768 turns of zeros.
E5CB LD BC,$0300
CLEAR_ROOM_SCREEN_0 E5CE LD (FOUND_RECORD),SP Keep SP; SP at the top of the area.
E5D2 LD SP,HL
CLEAR_ROOM_SCREEN_1 E5D3 PUSH DE Eight bytes a turn.
E5D4 PUSH DE
E5D5 PUSH DE
E5D6 PUSH DE
E5D7 DEC BC
E5D8 LD A,B
E5D9 OR C
E5DA JR NZ,CLEAR_ROOM_SCREEN_1
E5DC LD (CLEAR_END),SP HL: where the fill stopped, the top of the next area; SP back.
E5E0 LD HL,(CLEAR_END)
E5E3 LD SP,(FOUND_RECORD)
E5E7 RET
Prev: E597 Up: Map Next: E5E8