Skip to navigation


Dashboard: GetTyreDashEdges

Name: GetTyreDashEdges [Show more] Type: Subroutine Category: Dashboard Summary: Fetch the pixel bytes from along the edge of the dashboard or tyre and fill the block to the right of the edge appropriately
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * CopyTyreDashEdges calls GetTyreDashEdges

Arguments: X The number of the leftmost dash data block to copy A The number of the dash data block after the last block to copy (so the last block to draw is A - 1) Y Start at this byte in the dash data, so we work down the screen from track line Y (S R) The address of the table into which we copy the pixel bytes from the specified edge
.GetTyreDashEdges STA blockCounter \ Set a loop counter in blockCounter, so the following, \ X loops from blockNumber to blockCounter - 1 \ (i.e. A - 1) .gedg1 STX blockNumber \ Store the loop counter in blockNumber STY topTrackLine \ Set topTrackLine to the offset of the start byte LDA dashDataOffset,X \ Set blockOffset = the dash data offset for block X STA blockOffset LDX #LO(R) \ Set X so the call to GetTyreDashEdge modifies the \ FillAfterObject routine to draw to (S R) instead of \ (Q P) IF _ACORNSOFT OR _4TRACKS LDY #&DF \ Set Y = &DF so the call to GetTyreDashEdge modifies \ the FillAfterObject routine at edge11 to BNE edge1, \ so the routine copies into (S R) instead of filling \ the screen buffer LDA #0 \ Set A = 0, so the call to GetTyreDashEdge modifies the \ FillAfterObject routine to store 0 as the value for \ colour 0 (instead of the &55 that the screen buffer \ uses to represent black) JSR GetTyreDashEdge \ Modify the FillAfterObject routine and run it to copy \ the edge bytes into the table at (S R) LDX #LO(P) \ Set X so the call to GetTyreDashEdge modifies the \ FillAfterObject routine back to drawing to (Q P) LDY #&E7 \ Set Y = &E7 so the call to GetTyreDashEdge modifies \ the FillAfterObject routine at edge11 back to BNE \ edge3 LDA #&55 \ Set A = &55, so the call to GetTyreDashEdge modifies \ the FillAfterObject routine back to storing &55 as the \ value for colour 0 INC blockNumber \ Increment the block number JSR GetTyreDashEdge \ Modify the FillAfterObject routine back to its default \ code and run it, which fills the block to the right of \ the dashboard or tyre edge with the appropriate \ content ELIF _SUPERIOR OR _REVSPLUS LDY #&EF \ Set Y = &DF so the call to GetTyreDashEdgeSup modifies \ the FillAfterObjectSup routine at sedg5 to BNE sedg1, \ so the routine copies into (S R) instead of filling \ the screen buffer LDA #0 \ Set A = 0, so the call to GetTyreDashEdgeSup modifies \ the FillObject routine to store 0 as the value for \ colour 0 (instead of the &55 that the screen buffer \ uses to represent black) JSR GetTyreDashEdgeSup \ Modify the FillAfterObjectSup routine and run it to \ copy the edge bytes into the table at (S R) LDX #LO(P) \ Set X so the call to GetTyreDashEdgeSup modifies the \ FillAfterObjectSup routine at back to drawing to (Q P) LDY #&09 \ Set Y = &09 so the call to GetTyreDashEdgeSup modifies \ the FillAfterObjectSup routine at sedg5 back to BNE \ sedg8 LDA #&55 \ Set A = &55, so the call to GetTyreDashEdgeSup \ modifies the FillAfterObjectSup routine back to \ storing &55 as the value for colour 0 INC blockNumber \ Increment the block number JSR GetTyreDashEdgeSup \ Modify the FillAfterObjectSup routine back to its \ default code and run it, which fills the block to the \ right of the dashboard or tyre edge with the \ appropriate content ENDIF LDX blockNumber \ Fetch the loop counter from blockNumber into X CPX blockCounter \ If X <> blockCounter, loop back until we have copied BNE gedg1 \ from block blockNumber to block blockCounter - 1 RTS \ Return from the subroutine