Prev: 39325 Up: Map Next: 39378
39339: Clear Play Area
Used by the routine at Draw_Room.
Clears the pixels of the 176 lines of the play area and then sets the attributes of its 22 rows to white. The entry at Clear_Play_Area_Attributes only sets the attributes.
Before After Clear_Play_Area
clear-play-area-before clear-play-area-after
Clear_Play_Area 39339 LD HL,48896 Set the x position to 0 and the y position to 191 (48896).
39342 CALL ScreenAddress Convert the position into a screen address.
39345 LD C,176 Set the number of lines to clear to 176.
Clear_Play_Area_Line_Loop 39347 PUSH HL Stash the screen address on the stack.
39348 LD B,32 Set the number of bytes in a line to 32.
Clear_Play_Area_Byte_Loop 39350 LD (HL),0 Clear a byte of the line.
39352 INC L Move on to the next byte.
39353 DJNZ Clear_Play_Area_Byte_Loop Decrease the byte counter and loop back until the line is clear.
39355 POP HL Restore the screen address from the stack.
39356 CALL ScreenPosition1PixelAbove Move up one pixel line.
39359 DEC C Decrease the line counter and loop back until all of the lines are clear.
39360 JR NZ,Clear_Play_Area_Line_Loop
This entry point is used by the routine at Clear_Screen.
Clear_Play_Area_Attributes 39362 LD HL,22592 Point at the second row of the attribute buffer (22592).
39365 LD C,22 Set the number of rows to 22.
Clear_Play_Area_Row_Loop 39367 LD B,32 Set the number of cells in a row to 32.
Clear_Play_Area_Cell_Loop 39369 LD (HL),71 Set the attribute of the cell to white ink on black paper (bright).
39371 INC HL Move on to the next cell.
39372 DJNZ Clear_Play_Area_Cell_Loop Decrease the cell counter and loop back until the row is done.
39374 DEC C Decrease the row counter and loop back until all of the rows are done.
39375 JR NZ,Clear_Play_Area_Row_Loop
39377 RET Return.
Prev: 39325 Up: Map Next: 39378