Prev: 43611 Up: Map Next: 43746
43716: Draw Picture
Draws a picture on the screen. A picture starts with its width in bytes and its height in pixel lines, and is followed by the bytes of each line with the bottom line first.
draw-picture
Input
DE The address of the picture
HL The pixel position of the bottom left (H is y, L is x)
DrawPicture 43716 PUSH HL Save the position.
43717 CALL GetScreenAddress Convert the position into a screen address.
43720 LD A,(DE) Fetch the width of the picture.
43721 LD (43730),A Store it in the operand of the instruction at 43729.
43724 INC DE Move onto the height.
43725 LD A,(DE) Fetch it.
43726 INC DE Move onto the first byte of the picture.
43727 LD C,A Keep the height in C.
DrawPicture_Line 43728 PUSH HL Save the screen address of the start of the line.
43729 LD B,0 Set the width in bytes (this is patched at 43730).
DrawPicture_Byte 43731 LD A,(DE) Fetch a byte of the picture.
43732 LD (HL),A Write it to the screen.
43733 INC DE Move onto the next byte of the picture.
43734 INC L Move onto the next byte of the screen.
43735 DJNZ DrawPicture_Byte Jump back until the line has been drawn.
43737 POP HL Restore the screen address of the start of the line.
43738 CALL MoveUpALine Move up a pixel line.
43741 DEC C Decrease the height by one.
43742 JR NZ,DrawPicture_Line Jump back until all of the lines have been drawn.
43744 POP HL Restore the position.
43745 RET Return.
Prev: 43611 Up: Map Next: 43746