Prev: 30795 Up: Map Next: 31025
30999: Write Attribute Data
Used by the routine at DisplayTitleScreen.
Input
DE Attribute data
HL Attribute buffer location
B Width
C Length
Convert length into number of character blocks.
WriteAttributeData 30999 SRA C Divide the length by 8 and store the result in C.
31001 SRA C
31003 SRA C
WriteAttributeData_Loop 31005 PUSH HL Stash HL and BC on the stack.
31006 PUSH BC
WriteAttributeData_CopyLoop 31007 LD A,(DE) Copy a byte from the source address to the destination address in the attribute buffer.
31008 LD (HL),A
31009 INC HL Increment both the source and destination addresses.
31010 INC DE
31011 DJNZ WriteAttributeData_CopyLoop Decrease the width counter by one and loop back to WriteAttributeData_CopyLoop until the counter is zero.
31013 POP BC Restore BC and HL from the stack.
31014 POP HL
31015 PUSH DE Stash DE on the stack.
31016 LD DE,32 HL+=0032.
31019 ADD HL,DE
31020 POP DE Restore DE from the stack.
31021 DEC C Decrease the height counter by one and jump back to WriteAttributeData_Loop until the counter is zero.
31022 JR NZ,WriteAttributeData_Loop
31024 RET Return.
Prev: 30795 Up: Map Next: 31025