Prev: 40702 Up: Map Next: 40772
40748: Clear Playfield
Clears the pixels of the playfield, which is 28 bytes wide and 160 rows high.
Before After ClearPlayfield
playfield-before playfield-after
ClearPlayfield 40748 LD HL,46856 Use the bottom left of the playfield.
40751 CALL GetScreenAddress Find the screen address.
40754 LD C,160 Set the number of rows to 160.
ClearPlayfield_Row 40756 LD B,28 Set the number of bytes in a row to 28.
40758 PUSH HL Save the address of the start of the row.
ClearPlayfield_Byte 40759 LD (HL),0 Clear a byte.
40761 INC HL Move on to the next byte.
40762 DJNZ ClearPlayfield_Byte Loop back to ClearPlayfield_Byte for each byte of the row.
40764 POP HL Restore the address of the start of the row.
40765 CALL MoveUpARow Move up to the next row.
40768 DEC C Decrease the number of rows.
40769 JR NZ,ClearPlayfield_Row Loop back to ClearPlayfield_Row for each row.
40771 RET Return.
Prev: 40702 Up: Map Next: 40772