Prev: E820 Up: Map Next: E87A
E84E: Draw a UDG
Used by the routines at 62A3, CDD3, CE76, DCC1, DCF6, ED00, EF7C and F3EC.
Input
HL Pointer to data containing information about what to draw and where.
DE Co-ordinates to print the graphic.
E84E LD B,(HL) Get the height.
E84F INC HL
E850 LD C,(HL) Get the width.
E851 INC HL
E852 PUSH BC Remember BC and DE.
E853 PUSH DE
E854 CALL $E87A Copy the graphic data.
Put the pixel data on screen.
E857 POP DE Restore BC and DE.
E858 POP BC
E859 LD A,(HL) Is this a "fill" command?
E85A AND A
E85B JR NZ,$E862 Jump forward if it isn't.
There is a "fill" command here.
E85D INC HL Put the attribute in A.
E85E LD A,(HL)
E85F JP $E8BA Move forward to do the fill.
Print the attribute for the graphic.
E862 CALL $E8E3 Convert the screen address to an attribute address.
E865 EX DE,HL Put the attribute address in HL.
E866 PUSH BC Remember BC and HL.
E867 PUSH HL
E868 LD A,(DE) Get the attribute data.
E869 LD (HL),A Put it on screen.
E86A INC L Move to the next column.
E86B INC DE Move to the next data cell.
E86C DJNZ $E868 Loop while there are more columns.
E86E POP HL Restore HL.
E86F LD BC,$0020 Move to the next row.
E872 AND A
E873 SBC HL,BC
E875 POP BC Restore BC.
E876 DEC C Loop back if there are more rows to draw.
E877 JR NZ,$E866
E879 RET Otherwise return.
Prev: E820 Up: Map Next: E87A