Prev: 51549 Up: Map Next: 51601
51567: Draw Bitmap
Draws a bitmap on the screen. The bitmap starts with its width in bytes and its height in rows, followed by the bytes for each row. The position is that of the bottom row, and the rows are drawn going up the screen.
Input
DE Address of the bitmap
HL Position (H is the pixel row and L is the pixel column)
Output
DE Address after the bitmap
DrawBitmap 51567 PUSH HL Stash HL on the stack.
51568 LD A,(DE) Read DE.
51569 LD B,A B=A.
51570 INC DE Advance DE.
51571 LD A,(DE) Read DE.
51572 LD C,A C=A.
51573 INC DE Advance DE.
51574 CALL GetScreenAddress Call GetScreenAddress.
51577 LD A,B A=B.
51578 LD (23580),A The width of the bitmap.
DrawBitmap_Row 51581 PUSH HL Stash HL on the stack.
51582 LD A,(23580) The width of the bitmap.
51585 LD B,A B=A.
DrawBitmap_Loop 51586 LD A,(DE) Read DE.
51587 LD (HL),A Write A where HL points.
51588 INC DE Advance DE.
51589 INC HL Advance HL.
51590 DJNZ DrawBitmap_Loop Decrease B and jump to DrawBitmap_Loop until none remain.
51592 POP HL Bring HL back off the stack.
51593 CALL MoveUpARow Call MoveUpARow.
51596 DEC C Step C back.
51597 JR NZ,DrawBitmap_Row Jump to DrawBitmap_Row if the zero flag is clear.
51599 POP HL Bring HL back off the stack.
51600 RET Return.
Prev: 51549 Up: Map Next: 51601