Prev: 63E9 Up: Map Next: 6456
6438: Draw Room Rows
Used by the routine at Draw_Room_Tile.
Draws multiple character rows from the room buffer to the screen buffer. After all rows are drawn, prints the HUD header if it hasn't been drawn yet, and applies random colours to the bottom ground strip.
Input
B Number of rows to draw
HL Pointer to the room buffer
Draw_Room_Rows_Loop 6438 PUSH BC Stash the row counter and room buffer pointer on the stack.
6439 PUSH HL
643A CALL Draw_Room_Row Call Draw_Room_Row to draw a single character row.
643D POP HL Restore the room buffer pointer and row counter from the stack.
643E POP BC
Advance the room buffer pointer to the next character row. Each row is 20 bytes wide; if adding 20 to L overflows, advance H by 08 to move into the next screen third.
643F LD A,$20 Add 20 to L.
6441 ADD A,L
6442 LD L,A
6443 OR A Jump to Draw_Room_Rows_Next if there was no overflow.
6444 JR NZ,Draw_Room_Rows_Next
6446 LD A,$08 Add 08 to H.
6448 ADD A,H
6449 LD H,A
Draw_Room_Rows_Next 644A DJNZ Draw_Room_Rows_Loop Decrease the row counter by one and loop back to Draw_Room_Rows_Loop until all rows have been drawn.
Print the HUD header if the screen hasn't been fully initialised yet.
644C LD A,($5FA1) Call Print_HUD_Header if *Screen_Initialised_Flag is unset (HUD header not yet drawn).
644F OR A
6450 CALL Z,Print_HUD_Header
6453 JP Colour_Ground_Strip Jump to Colour_Ground_Strip.
Prev: 63E9 Up: Map Next: 6456