.HookBackground \ If we get here then the edge we are drawing is \ partially off-screen and the track line in Y has been \ decremented LDA backgroundColour+1,Y \ Set A to the contents of the background colour table \ for the track line we are drawing (i.e. track line \ Y + 1, as we just decremented Y) CMP #%10001011 \ If A = 10001011, then this represents: BEQ back1 \ \ * Set by UpdateBackground to the value in \ backgroundLeft \ \ * Verge type = leftTrackStart \ \ * Not set by SetVergeBackground \ \ * Colour = logical colour 3 (green) \ \ In this case, jump to back1 to return to the main \ UpdateBackground routine without updating the \ background colour \ If we get here then we just implement the same code as \ in the original LDA backgroundColour,Y \ Set A to the contents of the background colour table \ for track line Y RTS \ Return from the subroutine .back1 LSR A \ Shift A to the right, so A = 01000101 \ \ This is a non-zero value, so when we return back into \ the main code, we will take the BNE upba4 branch to \ return from the subroutine without updating the \ background \ \ This LSR is therefore just a quick way of setting the \ Z flag so the BNE upba4 branch is taken on our return RTS \ Return from the subroutineName: HookBackground [Show more] Type: Subroutine Category: Extra tracks Summary: Do not update the background colour when the track line above is showing green for the leftTrackStart verge Deep dive: Secrets of the extra tracks Code hooks in the extra tracksContext: See this subroutine in context in the source code References: This subroutine is called as follows: * newContentHi calls HookBackground * newContentLo calls HookBackground
This routine is called from UpdateBackground to skip updating the background colour table when the track line above is showing green for the leftTrackStart verge.
Label back1 is local to this routine
Configuration variable: backgroundColour = &5F60