![]() |
Routines |
| Prev: 25918 | Up: Map | Next: 25992 |
|
Used by the routines at HandlerExplosion and HandlerPlayer.
Shows the player's position on the map in the sidebar as a pixel which flashes on and off every 8 frames. When the marker moves, the screen byte it was covering is put back, using the copy saved in PlayerMarker_Byte. The address of that byte is held in PlayerMarker_Address.
|
||||||||
| FlashPlayerMarker | 25943 | CALL LocatePlayerMarker | Work out the pixel co-ordinates of the marker using LocatePlayerMarker. | |||||
|
Has the marker moved? The saved value is a screen address, whereas HL holds pixel co-ordinates, so these are only equal by coincidence.
|
||||||||
| 25946 | PUSH HL | Stash the pixel co-ordinates on the stack. | ||||||
| 25947 | LD DE,(24118) | Fetch the screen address saved for the marker (PlayerMarker_Address). | ||||||
| 25951 | AND A | Reset the carry flag. | ||||||
| 25952 | SBC HL,DE | Compare the pixel co-ordinates with the saved screen address. | ||||||
| 25954 | POP HL | Restore the pixel co-ordinates from the stack. | ||||||
| 25955 | JR Z,FlashPlayerMarker_Flash | Jump to FlashPlayerMarker_Flash if the result was zero. | ||||||
|
Put back the screen byte that was covered by the marker.
|
||||||||
| 25957 | PUSH HL | Stash the pixel co-ordinates on the stack. | ||||||
| 25958 | LD HL,(24118) | Fetch the screen address of the byte the marker covered (PlayerMarker_Address). | ||||||
| 25961 | LD A,(24120) | Fetch the screen byte that the marker covered (PlayerMarker_Byte). | ||||||
| 25964 | LD (HL),A | Put the screen byte back. | ||||||
| 25965 | POP HL | Restore the pixel co-ordinates from the stack. | ||||||
|
This entry point is used by the routine at NewGame.
Save the screen byte at the position of the marker.
|
||||||||
| FlashPlayerMarker_SaveByte | 25966 | PUSH HL | Stash the pixel co-ordinates on the stack. | |||||
| 25967 | CALL ScreenAddress | Convert the pixel co-ordinates to a screen address using ScreenAddress. | ||||||
| 25970 | LD (24118),HL | Save the screen address of the marker at PlayerMarker_Address. | ||||||
| 25973 | LD A,(HL) | Fetch the screen byte at the marker. | ||||||
| 25974 | LD (24120),A | Save the screen byte at PlayerMarker_Byte. | ||||||
| 25977 | POP HL | Restore the pixel co-ordinates from the stack. | ||||||
|
Flash the marker, setting the pixel on one phase and clearing it on the other.
|
||||||||
| FlashPlayerMarker_Flash | 25978 | LD BC,257 | Set the size of the marker, a single pixel (0257). | |||||
| 25981 | LD A,(24105) | Fetch the game timer from GameTimer. | ||||||
| 25984 | AND %00001000 | Keep only bit 3, which changes every 8 frames. | ||||||
| 25986 | JP NZ,SetPixels | If the bit is set then jump to SetPixels to draw the marker. | ||||||
| 25989 | JP ClearPixels | Else jump to ClearPixels to remove the marker. | ||||||
| Prev: 25918 | Up: Map | Next: 25992 |