Skip to navigation

Revs on the BBC Micro

Car geometry: HideAllCars

Name: HideAllCars [Show more] Type: Subroutine Category: Car geometry Summary: Set all the cars to hidden
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * FinishRace calls HideAllCars * MoveAndDrawCars calls HideAllCars
.HideAllCars LDX #22 \ We are about to process the car status bytes for \ drivers 0 to 19, plus the three extra car objects in \ 20 to 22 that make up the four-object car, so set a \ loop counter in X .hide1 LDA objectStatus,X \ Set bit 7 in the X-th byte of objectStatus to set the ORA #%10000000 \ car for driver X to be hidden STA objectStatus,X DEX \ Decrement the loop counter BPL hide1 \ Loop back until we have hidden all 23 cars RTS \ Return from the subroutine