|  | Routines | 
| Prev: 9253 | Up: Map | Next: 92E2 | 
| 
Used by the routine at RevealDartboard.
 
 | ||||||||
| 
Handles the pixel manipulation for one line of the reveal effect, including both straight copying of already-revealed areas and masked reveal of transition areas.
 | ||||||||
| ProcessRevealLine | 92A7 | PUSH DE | Stash the reveal co-ordinate on the stack. | |||||
| 
First handle the already-revealed portion.
 | ||||||||
| 92A8 | DEC E | Decrease E by one for the check below. | ||||||
| 
Is the X coordinate within the screen boundaries?
 | ||||||||
| 92A9 | LD A,E | Jump to ProcessRevealLine_Skip if (00 <= E < 20). | ||||||
| 92AA | CP $20 | |||||||
| 92AC | JR NC,ProcessRevealLine_Skip | |||||||
| 92AE | AND A | |||||||
| 92AF | JP M,ProcessRevealLine_Skip | |||||||
| 92B2 | CALL CopyRevealLine | Call CopyRevealLine. | ||||||
| ProcessRevealLine_Skip | 92B5 | POP DE | Restore the reveal co-ordinate from the stack. | |||||
| 92B6 | LD A,E | Return if X is past the right-hand edge of the screen. | ||||||
| 92B7 | CP $20 | |||||||
| 92B9 | RET NC | |||||||
| 92BA | PUSH DE | Stash the reveal co-ordinate on the stack. | ||||||
| 
On return from CalculateDartBoardAddress HL will contain the dart board graphic destination (i.e. DartBoard onwards).
 | ||||||||
| 92BB | CALL CalculateDartBoardAddress | Call CalculateDartBoardAddress. | ||||||
| 
Set up the source and destination addresses.
 | ||||||||
| 92BE | LD D,H | Copy the dart board graphic location from HL into DE. | ||||||
| 92BF | LD E,L | |||||||
| 92C0 | LD A,H | H-=20. | ||||||
| 92C1 | SUB $20 | |||||||
| 92C3 | LD H,A | |||||||
| 
Process 08 pixel rows with the reveal mask.
 | ||||||||
| 92C4 | LD B,$08 | Set a counter in B for the number of pixels rows to process. | ||||||
| 
Mask value; altered to either- 01 at RevealDartboard_ModifyMaskForLower, or FF at RevealDartboard_ModifyMaskForUpper.
 | ||||||||
| Reveal_MaskValue | 92C6 | LD C,$FF | Set the initial mask value. | |||||
| RevealDartboard_MaskLoop | 92C8 | LD A,(DE) | Get the dartboard graphic byte. | |||||
| 92C9 | OR C | Apply the reveal mask. | ||||||
| 92CA | LD (HL),A | Write the result to the screen. | ||||||
| 92CB | INC H | Move to the next screen line. | ||||||
| 92CC | INC D | Move to the next dartboard graphic line. | ||||||
| 
Shift command. Altered to either;
 SLL Cat RevealDartboard_ModifyToShiftLeft.SRL Cat RevealDartboard_ModifyToShiftRight. | ||||||||
| Reveal_ShiftCommand | 92CD | SRL C | Shift the mask value. | |||||
| 92CF | DJNZ RevealDartboard_MaskLoop | Decrease the pixel row counter by one and loop back to RevealDartboard_MaskLoop until all 08 lines have been processed. | ||||||
| 
Work out which attribute byte to apply.
 | ||||||||
| 92D1 | POP HL | Restore the original reveal co-ordinate from the stack. | ||||||
| 92D2 | LD A,L | Is the co-ordinate in the menu or dartboard area? | ||||||
| 92D3 | CP $08 | |||||||
| 
Default with the dartboard attribute value.
 | ||||||||
| 92D5 | LD A,$70 | A=INK: BLACK, PAPER: YELLOW (BRIGHT) . | ||||||
| 92D7 | JR NC,RevealDartboard_SetAttribute | Jump to RevealDartboard_SetAttribute if the X co-ordinate is greater than or equal to 08. | ||||||
| 
The X co-ordinate was less than 08 so use the menu attribute value.
 | ||||||||
| 92D9 | LD A,$00 | A=INK: BLACK, PAPER: BLACK . | ||||||
| 
Stash the attribute byte temporarily as CalculateAttributeBuffer needs the A register.
 | ||||||||
| RevealDartboard_SetAttribute | 92DB | EX AF,AF' | Temporarily switch the attribute byte with the shadow AF register. | |||||
| 
CalculateAttributeBuffer converts given co-ordinates into an attribute buffer location (into HL).
 | ||||||||
| 92DC | CALL CalculateAttributeBuffer | Call CalculateAttributeBuffer. | ||||||
| 92DF | EX AF,AF' | Restore the attribute byte back from the shadow AF register. | ||||||
| 92E0 | LD (HL),A | Write the colour attribute byte to the attribute buffer. | ||||||
| 92E1 | RET | Return. | ||||||
| Prev: 9253 | Up: Map | Next: 92E2 |