Prev: 6338 Up: Map Next: 63E9
63BB: Print HUD Header
Used by the routine at Draw_Room_Rows_Loop.
Prints the heads-up display header showing Energy, Lives and Score, then applies random colours to the bottom two rows of the screen attributes to create a colourful ground strip.
Print_HUD_Header 63BB LD A,$01 Write 01 to *Screen_Initialised_Flag.
63BD LD ($5FA1),A
Print the HUD string to the upper screen.
63C0 CALL $1601 Call CHAN_OPEN to open channel 02 (upper screen).
63C3 LD HL,$63E9 Point HL at Messaging_Header.
63C6 LD B,$4F Set a counter in B for the length of the string (4F characters).
63C8 CALL PrintString Call PrintString.
This entry point is used by the routine at Draw_Room_Rows_Loop.
Apply pseudo-random colours to the bottom two rows of screen attributes to create a colourful ground strip. Uses the Memory Refresh Register as a seed to pick unpredictable colour values.
Colour_Ground_Strip 63CB LD A,R Load the Memory Refresh Register into E as a pointer offset.
63CD LD E,A
63CE LD D,$00 Set D to 00 so DE is an offset into low memory.
63D0 LD B,$20 Set a counter in B for 20 attribute cells.
63D2 LD HL,$5AC0 Point HL at 5AC0 (start of the bottom two attribute rows).
Colour_Ground_Loop 63D5 LD A,(DE) Fetch a pseudo-random byte from *DE.
63D6 AND %00000111 Keep only bits 0-2 (INK colour).
63D8 INC DE Advance the source pointer.
63D9 CP $03 Jump back to Colour_Ground_Loop if the colour is less than 03 (reject dark colours to keep the ground strip bright).
63DB JR C,Colour_Ground_Loop
63DD PUSH DE Stash the source pointer on the stack.
63DE LD E,A Copy the chosen colour into E.
63DF LD A,(HL) Fetch the current attribute byte from *HL.
63E0 AND %11110111 Mask off the existing INK bits (keep PAPER, BRIGHT, FLASH).
63E2 OR E OR in the new INK colour from E.
63E3 LD (HL),E Write the updated attribute byte to *HL.
63E4 POP DE Restore the source pointer from the stack.
63E5 INC HL Advance to the next attribute cell.
63E6 DJNZ Colour_Ground_Loop Decrease the counter and loop back to Colour_Ground_Loop until all 20 cells are coloured.
63E8 RET Return.
Prev: 6338 Up: Map Next: 63E9