Skip to navigation

Drawing the landscape: DrawFlatTile

Name: DrawFlatTile [Show more] Type: Subroutine Category: Drawing the landscape Summary: Draw a flat tile in the correct colour for the chess board effect that we use to draw the landscape
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * DrawLandscapeView (Part 3 of 3) calls DrawFlatTile * DrawTileAndObjects calls DrawFlatTile
.DrawFlatTile LDX #0 \ If bit 0 of xTileToDraw and zTile are the same, then LDA xTileToDraw \ the tile's x-coordinate and z-coordinate are either EOR zTile \ both odd or both even, so jump to DrawOneFaceTile AND #1 \ with X set to 0 to draw this tile in colour 3 (white, BEQ DrawOneFaceTile \ yellow, cyan or red) LDX #8 \ Otherwise the tile's x-coordinate and z-coordinate are \ different (i.e. one is odd and one is even), so set \ X to 8 to draw this tile in colour 0 (blue) \ We now have a very short interlude to set the value of \ stashOffset as part of the game's anti-cracker code, \ and we pick up the tile-drawing process again in the \ DrawOneFaceTile routine