Prev: 27171 Up: Map Next: 27471
27441: Fill Screen With UDG
Used by the routine at 29385.
Loop Index Screen Output
1 fill-1
2 fill-2
3 fill-3
Input
DE Pointer to UDG graphic data
FillScreenWithUDG 27441 LD HL,16384 Point HL to the start of the screen buffer (16384).
27444 LD B,L B=L.
Draw one character block.
FillScreenWithUDG_Loop 27445 PUSH BC Stash the position counter, screen address and graphic pointer on the stack.
27446 PUSH HL
27447 PUSH DE
27448 LD B,8 Set a line counter in B (8 lines in a UDG).
FillScreenWithUDG_LineLoop 27450 LD A,(DE) Copy the UDG data to the screen buffer.
27451 LD (HL),A
27452 INC H Move down one pixel line in the screen buffer.
27453 INC DE Move to the next UDG graphic data byte.
27454 DJNZ FillScreenWithUDG_LineLoop Decrease the line counter by one and loop back to FillScreenWithUDG_LineLoop until all 8 lines of the UDG character have been drawn.
Move to the next character position in the row.
27456 POP DE Restore the graphic pointer and original screen address from the stack.
27457 POP HL
27458 INC HL Move right one character block.
27459 POP BC Restore the position counter from the stack.
27460 DJNZ FillScreenWithUDG_Loop Decrease the position counter by one and loop back to FillScreenWithUDG_Loop until the current screen third is filled with the sprite.
Move to the next screen third.
27462 LD A,H Add 7 to H to move down to the next screen third.
27463 ADD A,7
27465 LD H,A
27466 CP 88 Jump back to FillScreenWithUDG_Loop until HL reaches the attribute buffer at 22528.
27468 JR NZ,FillScreenWithUDG_Loop
27470 RET Return.
Prev: 27171 Up: Map Next: 27471