Prev: 8BA5 Up: Map Next: 8C01
8BBB: Draw HUD Panel
Print the dashboard graphic as a 1E by 03 font block, then write its attributes.
Print the dashboard graphic as a 1E by 03 font.
DrawHUDPanel 8BBB LD HL,($5E04) Stash the current font pointer.
8BBE PUSH HL
8BBF LD HL,$DD97 Write UDG_Tiles to FontPointer.
8BC2 LD ($5E04),HL
The panel is printed like a font.
8BC5 LD BC,$1E03 Set the size to 1E columns and 03 rows.
8BC8 LD DE,$DE5F Set the pixel-data pointer to HUDPanelLayoutData.
8BCB LD HL,$4041 Set the screen position to 4041.
DrawHUDPanel_Pixel_Row 8BCE PUSH BC Stash the counters and screen address.
8BCF PUSH HL
DrawHUDPanel_Pixel_Column 8BD0 LD A,(DE) Print the next panel character and loop back to DrawHUDPanel_Pixel_Column until the row is done.
8BD1 INC DE
8BD2 ADD A,$20
8BD4 CALL PrintScreen
8BD7 DJNZ DrawHUDPanel_Pixel_Column
8BD9 POP HL Restore this row, step down one character row and loop back to DrawHUDPanel_Pixel_Row until every row is printed.
8BDA LD BC,$0020
8BDD ADD HL,BC
8BDE POP BC
8BDF DEC C
8BE0 JR NZ,DrawHUDPanel_Pixel_Row
Now write the attribute bytes.
8BE2 LD DE,$DEB9 Set the attribute-data pointer to HUDPanelAttributes.
8BE5 LD HL,$5841 Set the attribute position to 5841.
8BE8 LD BC,$1E03 Set the size to 1E columns and 03 rows.
DrawHUDPanel_Attribute_Row 8BEB PUSH BC Stash the counters and attribute address.
8BEC PUSH HL
DrawHUDPanel_Attribute_Column 8BED LD A,(DE) Write the next attribute byte and loop back to DrawHUDPanel_Attribute_Column until the row is done.
8BEE INC DE
8BEF LD (HL),A
8BF0 INC L
8BF1 DJNZ DrawHUDPanel_Attribute_Column
8BF3 POP HL Restore this row, step down one attribute row and loop back to DrawHUDPanel_Attribute_Row until every row is painted.
8BF4 LD BC,$0020
8BF7 ADD HL,BC
8BF8 POP BC
8BF9 DEC C
8BFA JR NZ,DrawHUDPanel_Attribute_Row
Restore the old font pointer.
8BFC POP HL Restore the previous font pointer to FontPointer.
8BFD LD ($5E04),HL
8C00 RET Return.
View the equivalent code in;
Prev: 8BA5 Up: Map Next: 8C01