Prev: 45878 Up: Map Next: 45946
45910: Erase Rows
Used by the routine at DrawShot.
Erases rows from the screen, going up from the row that HL is at, using the same layout as DrawRows but with the number of rows in 41431. The alternate registers are used.
Input
B' Number of bytes in a row
DE' Address of the buffer
HL' Screen address
EraseRows 45910 EXX Switch to the alternate registers.
45911 LD A,B A=B.
45912 AND A Jump to EraseRows_Finish if A is zero.
45913 JR Z,EraseRows_Finish
45915 LD C,B C=B.
45916 LD A,(41431) The rows to erase.
EraseRows_Row 45919 EX AF,AF' Switch to the alternate accumulator and flags.
45920 LD B,C B=C.
45921 PUSH DE Stash DE on the stack.
45922 PUSH HL Stash HL on the stack.
EraseRows_Byte 45923 LD A,(DE) Read DE.
45924 CPL Invert A.
45925 AND (HL) Keep the bits of A that are set in the byte at HL.
45926 LD (HL),A Write A where HL points.
45927 INC L Advance L.
45928 INC DE Advance DE.
45929 DJNZ EraseRows_Byte Decrease B and jump to EraseRows_Byte until none remain.
45931 POP HL Bring HL back off the stack.
45932 CALL MoveUpARow Call MoveUpARow.
45935 POP DE Bring DE back off the stack.
45936 LD A,8 A=8.
45938 ADD A,E A gains E.
45939 LD E,A E=A.
45940 EX AF,AF' Switch to the alternate accumulator and flags.
45941 DEC A Step A back.
45942 JR NZ,EraseRows_Row Jump to EraseRows_Row if the zero flag is clear.
EraseRows_Finish 45944 EXX Switch to the alternate registers.
45945 RET Return.
Prev: 45878 Up: Map Next: 45946