Prev: 98CC Up: Map Next: 992A
9903: Control Code 02: Blank Screen
Preserve the current registers.
ControlCode_BlankScreen 9903 PUSH DE Stash DE and BC on the stack.
9904 PUSH BC
First blank the attribute buffer.
9905 LD HL,$5800 HL=5800 (attribute buffer location).
9908 LD DE,$5801 DE=5801.
990B LD BC,$02FF BC=02FF.
990E HALT Halt operation (suspend CPU until the next interrupt).
990F LD (HL),$00 Write INK: BLACK, PAPER: BLACK to *HL.
9911 LDIR Copy the 00 to the rest of the attribute buffer.
Next blank the screen buffer.
9913 LD B,$C0 Set a counter in B of C0; which is 24 rows x 8 pixels in each.
9915 LD HL,$4000 HL=4000 (screen buffer location).
BlankPixelLine_Loop 9918 LD C,L Save the row start in C.
9919 LD A,$20 Set a counter in A of 20 for the number of bytes in a row.
BlankByte_Loop 991B LD (HL),$00 Write 00 to *HL.
991D INC L Move to the next byte in this line.
991E DEC A Decrease the byte counter by one.
991F JR NZ,BlankByte_Loop Jump back to BlankByte_Loop until the byte clearing is done for this pixel row.
9921 LD L,C Back to the start of the line.
9922 CALL NextScreenBufferLine Call NextScreenBufferLine.
9925 DJNZ BlankPixelLine_Loop Decrease counter by one and loop back to BlankPixelLine_Loop until counter is zero.
9927 JP ControlCode_FullReturn_1 Jump to ControlCode_FullReturn_1.
Prev: 98CC Up: Map Next: 992A