Prev: 37543 Up: Map Next: 37637
37602: Copy Reveal Line
Used by the routine at ProcessRevealLine.
Input
DE Screen position
CopyRevealLine 37602 PUSH DE Stash the screen position on the stack.
On return from CalculateDartBoardAddress HL will contain the dart board graphic destination (i.e. DartBoard onwards).
37603 CALL CalculateDartBoardAddress Call CalculateDartBoardAddress.
Set up the source and destination addresses.
37606 LD D,H Copy the dart board graphic location from HL into DE.
37607 LD E,L
37608 LD A,H H-=32.
37609 SUB 32
37611 LD H,A
Copy 8 pixel rows that make up one character cell of the dartboard.
37612 LD B,8 Set a counter in B for the number of pixels rows to process.
CopyRevealLine_Loop 37614 LD A,(DE) Copy a byte of the dartboard graphic to the screen buffer.
37615 LD (HL),A
37616 INC H Move to the next screen line.
37617 INC D Move to the next dartboard graphic line.
37618 DJNZ CopyRevealLine_Loop Decrease counter by one and loop back to CopyRevealLine_Loop until counter is zero.
Work out which attribute byte to apply.
37620 POP HL Restore the screen position from the stack.
37621 LD A,L Is the co-ordinate in the menu or dartboard area?
37622 CP 8
Default with the dartboard attribute value.
37624 LD A,112 A=INK: BLACK, PAPER: YELLOW (BRIGHT) .
37626 JR NC,RevealLine_SetAttribute Jump to RevealLine_SetAttribute if the X co-ordinate is greater than or equal to 8.
The X co-ordinate was less than 8 so use the menu attribute value.
37628 LD A,71 A=INK: WHITE, PAPER: BLACK (BRIGHT) .
RevealLine_SetAttribute 37630 EX AF,AF' Temporarily switch the AF register with the shadow AF register.
On return from CalculateAttributeBuffer HL will contain the attribute buffer location.
37631 CALL CalculateAttributeBuffer Call CalculateAttributeBuffer.
37634 EX AF,AF' Restore the AF register from the shadow AF register.
37635 LD (HL),A Write the colour attribute byte to *HL.
37636 RET Return.
Prev: 37543 Up: Map Next: 37637