![]() |
Routines |
| Prev: 61714 | Up: Map | Next: 61951 |
|
Used by the routine at RunFrame.
Fills the attributes that the ship covers with its colour, which is white normally, yellow while the stack of units is full and cyan while the timer at 35183 is running (changing back to the normal colour every eight frames during the last 32 frames). If the colour has changed it makes the sound at PlayChangeSound.
|
||||
| ColourShip | 61885 | LD B,71 | B=71. | |
| 61887 | LD A,(51461) | The stack height. | ||
| 61890 | CP 18 | Jump to ColourShip_Timer if A is not 18. | ||
| 61892 | JR NZ,ColourShip_Timer | |||
| 61894 | LD B,70 | B=70. | ||
| ColourShip_Timer | 61896 | LD C,B | C=B. | |
| 61897 | LD A,(35183) | The falling timer. | ||
| 61900 | AND A | Jump to ColourShip_Fill if A is zero. | ||
| 61901 | JR Z,ColourShip_Fill | |||
| 61903 | LD B,69 | B=69. | ||
| 61905 | CP 32 | Jump to ColourShip_Fill if A is 32 or more. | ||
| 61907 | JR NC,ColourShip_Fill | |||
| 61909 | LD A,(39524) | The frame counter. | ||
| 61912 | AND %00001000 | Keep the bits of A that are set in 8. | ||
| 61914 | JR Z,ColourShip_Fill | Jump to ColourShip_Fill if the zero flag is set. | ||
| 61916 | LD B,C | B=C. | ||
| ColourShip_Fill | 61917 | LD A,(61953) | The colour the ship was drawn in. | |
| 61920 | CP B | Compare A with B. | ||
| 61921 | PUSH BC | Stash BC on the stack. | ||
| 61922 | CALL NZ,PlayChangeSound | Call PlayChangeSound if the zero flag is clear. | ||
| 61925 | POP BC | Bring BC back off the stack. | ||
| 61926 | LD HL,(51458) | Fetch the word at 51458 into HL. | ||
| 61929 | LD A,(49577) | The height of the ship. | ||
| 61932 | ADD A,7 | Add 7 to A. | ||
| 61934 | SRL A | Shift A right. | ||
| 61936 | SRL A | Shift A right. | ||
| 61938 | SRL A | Shift A right. | ||
| 61940 | LD C,A | C=A. | ||
| 61941 | LD (61952),BC | The size and the new colour of the ship. | ||
| 61945 | LD DE,61951 | The ship attribute area. | ||
| 61948 | JP FillAttributes | Jump to FillAttributes. | ||
| Prev: 61714 | Up: Map | Next: 61951 |