Prev: 32890 Up: Map Next: 32938
32915: Clear Play Area
Used by the routines at GameOver, EnterRoom and FallThroughTrapdoor.
Clears the pixels of the play area, which is the left-hand 24 bytes of each of the 192 rows of the screen buffer. The attributes are left alone.
Before After
clear-play-area-before clear-play-area-after
ClearPlayArea 32915 LD HL,16384 HL=16384 (the start of the screen buffer).
32918 LD BC,6336 B=24 (the number of bytes to clear in each row) and C=192 (the number of rows).
32921 XOR A A=0 (the value to write).
This entry point is used by the routines at DrawRoomFrame and DrawSidePanelAttrs.
Each pass of this loop clears one row.
ClearPlayArea_Row 32922 PUSH BC Stash the counters on the stack.
32923 PUSH HL Stash the row address on the stack.
32924 LD DE,32 DE=0032 (the size of a row).
ClearPlayArea_Byte 32927 LD (HL),A Write A to *HL.
32928 INC HL Move HL on to the next byte.
32929 DJNZ ClearPlayArea_Byte Decrease the byte counter by one and loop back to ClearPlayArea_Byte until the whole row has been cleared.
32931 POP HL Restore the row address from the stack.
32932 ADD HL,DE Move HL on to the next row.
32933 POP BC Restore the counters from the stack.
32934 DEC C Decrease the row counter by one and loop back to ClearPlayArea_Row until all 192 rows have been cleared.
32935 JR NZ,ClearPlayArea_Row
32937 RET Return.
Prev: 32890 Up: Map Next: 32938