Prev: F112 Up: Map Next: F1FF
F1BD: Colour Ship
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 896F is running (changing back to the normal colour every eight frames during the last 20 frames). If the colour has changed it makes the sound at PlayChangeSound.
ColourShip F1BD LD B,$47 B=47.
F1BF LD A,($C905) The stack height.
F1C2 CP $12 Jump to ColourShip_Timer if A is not 12.
F1C4 JR NZ,ColourShip_Timer
F1C6 LD B,$46 B=46.
ColourShip_Timer F1C8 LD C,B C=B.
F1C9 LD A,($896F) The falling timer.
F1CC AND A Jump to ColourShip_Fill if A is zero.
F1CD JR Z,ColourShip_Fill
F1CF LD B,$45 B=45.
F1D1 CP $20 Jump to ColourShip_Fill if A is 20 or more.
F1D3 JR NC,ColourShip_Fill
F1D5 LD A,($9A64) The frame counter.
F1D8 AND %00001000 Keep the bits of A that are set in 08.
F1DA JR Z,ColourShip_Fill Jump to ColourShip_Fill if the zero flag is set.
F1DC LD B,C B=C.
ColourShip_Fill F1DD LD A,($F201) The colour the ship was drawn in.
F1E0 CP B Compare A with B.
F1E1 PUSH BC Stash BC on the stack.
F1E2 CALL NZ,PlayChangeSound Call PlayChangeSound if the zero flag is clear.
F1E5 POP BC Bring BC back off the stack.
F1E6 LD HL,($C902) Fetch the word at C902 into HL.
F1E9 LD A,($C1A9) The height of the ship.
F1EC ADD A,$07 Add 07 to A.
F1EE SRL A Shift A right.
F1F0 SRL A Shift A right.
F1F2 SRL A Shift A right.
F1F4 LD C,A C=A.
F1F5 LD ($F200),BC The size and the new colour of the ship.
F1F9 LD DE,$F1FF The ship attribute area.
F1FC JP FillAttributes Jump to FillAttributes.
Prev: F112 Up: Map Next: F1FF