Prev: 35749 Up: Map Next: 35841
35771: Draw HUD Panel
Print the dashboard graphic as a 30 by 3 font block, then write its attributes.
Print the dashboard graphic as a 30 by 3 font.
DrawHUDPanel 35771 LD HL,(24068) Stash the current font pointer.
35774 PUSH HL
35775 LD HL,56727 Write UDG_Tiles to FontPointer.
35778 LD (24068),HL
The panel is printed like a font.
35781 LD BC,7683 Set the size to 30 columns and 3 rows.
35784 LD DE,56927 Set the pixel-data pointer to HUDPanelLayoutData.
35787 LD HL,16449 Set the screen position to 16449.
DrawHUDPanel_Pixel_Row 35790 PUSH BC Stash the counters and screen address.
35791 PUSH HL
DrawHUDPanel_Pixel_Column 35792 LD A,(DE) Print the next panel character and loop back to DrawHUDPanel_Pixel_Column until the row is done.
35793 INC DE
35794 ADD A,32
35796 CALL PrintScreen
35799 DJNZ DrawHUDPanel_Pixel_Column
35801 POP HL Restore this row, step down one character row and loop back to DrawHUDPanel_Pixel_Row until every row is printed.
35802 LD BC,32
35805 ADD HL,BC
35806 POP BC
35807 DEC C
35808 JR NZ,DrawHUDPanel_Pixel_Row
Now write the attribute bytes.
35810 LD DE,57017 Set the attribute-data pointer to HUDPanelAttributes.
35813 LD HL,22593 Set the attribute position to 22593.
35816 LD BC,7683 Set the size to 30 columns and 3 rows.
DrawHUDPanel_Attribute_Row 35819 PUSH BC Stash the counters and attribute address.
35820 PUSH HL
DrawHUDPanel_Attribute_Column 35821 LD A,(DE) Write the next attribute byte and loop back to DrawHUDPanel_Attribute_Column until the row is done.
35822 INC DE
35823 LD (HL),A
35824 INC L
35825 DJNZ DrawHUDPanel_Attribute_Column
35827 POP HL Restore this row, step down one attribute row and loop back to DrawHUDPanel_Attribute_Row until every row is painted.
35828 LD BC,32
35831 ADD HL,BC
35832 POP BC
35833 DEC C
35834 JR NZ,DrawHUDPanel_Attribute_Row
Restore the old font pointer.
35836 POP HL Restore the previous font pointer to FontPointer.
35837 LD (24068),HL
35840 RET Return.
View the equivalent code in;
Prev: 35749 Up: Map Next: 35841