Prev: 6A87 Up: Map Next: 6AE4
6A9B: Handler: Player
Handles the player's car while it is being driven (entity state 01). Draws the objects and the car, then updates the radar, the terrain dots, the sidebar and the sounds.
Input
IX The player entity (Entity_Player)
HandlerPlayer 6A9B PUSH IX Stash IX on the stack.
Reset the current place so that it can be set again if a place is in view.
6A9D LD A,$FF Write FF to CurrentPlaceID.
6A9F LD ($5E39),A
6AA2 CALL DrawObjects Call DrawObjects to draw the objects that are in view.
6AA5 CALL HandlerObjects Call HandlerObjects to remove the objects that are no longer in view.
6AA8 CALL UpdatePlayerCar Call UpdatePlayerCar to update the miles, the speed, the position, the steering and the fuel.
6AAB CALL FlashPlayerMarker Call FlashPlayerMarker to flash the player marker on the map.
6AAE CALL UpdateRadar Call UpdateRadar to update the radar.
6AB1 CALL UpdateTerrainDots Call UpdateTerrainDots to update the terrain dots.
6AB4 CALL SoundsCupRefuel Call SoundsCupRefuel to make the cup and refuel sounds.
6AB7 POP IX Restore IX from the stack.
Draw and colourise the player sprite.
6AB9 CALL DrawPlayer Call DrawPlayer.
6ABC LD HL,$5993 Point HL at the attribute buffer location of the player (5993).
6ABF LD BC,$0202 BC=0202 (height * width in bytes).
Merge the player sprite colour in with the current background colour.
6AC2 LD A,($5E44) Fetch the background attribute (Background_Attribute).
6AC5 OR %00000010 Set bit 1 (RED).
6AC7 LD D,A Keep the attribute to colour the car with in D.
6AC8 CALL ColouriseSprite_Block Colour the car using ColouriseSprite_Block.
Handles updating the dashboard values.
6ACB CALL HandlerTime Call HandlerTime to update the time.
6ACE CALL DisplayMiles Call DisplayMiles to display the miles and the time.
Remove the place name from the screen when no place is in view any more.
6AD1 LD A,($5E39) Fetch the place name flag (CurrentPlaceID).
6AD4 AND A Return if CurrentPlaceID is zero (the name has already been removed).
6AD5 RET Z
6AD6 INC A Add one, so that FF becomes 00.
6AD7 RET NZ Return if A is not zero (a place is in view; it is only zero here when the value was FF see 6A9D).
6AD8 LD ($5E39),A Clear the place name flag (CurrentPlaceID) so that this is only done once.
6ADB LD HL,$B868 HL=B868 (pixel co-ordinates).
6ADE LD DE,$6AE4 Point DE at the blank text (Blank_Text_Attribute).
6AE1 JP PrintStringColour Jump to PrintStringColour to overwrite the place name with spaces.
Prev: 6A87 Up: Map Next: 6AE4