.DrawFence LDA #0 \ Set playerMoving = 0 to denote that the player's car STA playerMoving \ is not moving STA T \ Set T = 0, to use as a counter as we work our way \ through the 40 dash data blocks that contain the track \ view STA P \ Set (Q P) to point to the first dash data block at LDA #HI(dashData) \ dashData (this works because the low byte of dashData STA Q \ is zero) .fenc1 LDX T \ If X = 40 then we have drawn the fence across all the CPX #40 \ dash data blocks, so return from the subroutine (as BEQ DrawFence-1 \ DrawFence-1 contains an RTS) LDA dashDataOffset,X \ Set U to the dashDataOffset for the current dash data STA U \ block LDY #70 \ Set Y = 70, to use as a loop counter that works \ through all 70 bytes in the dash data block JMP fenc2 \ We now jump to part 2 to work our way through the 70 \ bytes in the dash data block, each of which represents \ a four-pixel line, with 70 lines stacked one on top of \ the other, in a four-pixel-wide vertical stripName: DrawFence (Part 1 of 2) [Show more] Type: Subroutine Category: Screen buffer Summary: Draw the fence that we crash into when running off the trackContext: See this subroutine in context in the source code References: This subroutine is called as follows: * CheckForCrash calls DrawFence
Other entry points: DrawFence-1 Contains an RTS
[X]
Entry point DrawFence-1 in subroutine DrawFence (Part 1 of 2) (category: Screen buffer)
Contains an RTS
[X]
Configuration variable dashData = &3000
The address of the first code block that gets swapped in and out of screen memory, along with parts of the dashboard image
[X]
Variable dashDataOffset (category: Screen buffer)
Offset of the dash data within each dash data block
[X]
Label fenc2 in subroutine DrawFence (Part 2 of 2)
[X]
Variable playerMoving in workspace Zero page
Flag to denote whether the player's car is moving