Prev: 81B3 Up: Map Next: 823B
81D4: Handler: Ticker
Used by the routine at 8055.
Example messaging (note, this is two frames at a time - the game is smoother - plus, in the game the message starts off-screen).
ticker-animation
Handler_Ticker 81D4 LD HL,$EFFB Return if the ticker is not currently enabled.
81D7 BIT 0,(HL)
81D9 RET Z
81DA LD HL,$7815 HL=Ticker_SpeedCounter.
81DD DEC (HL) Decrease *Ticker_SpeedCounter by one.
81DE JR NZ,Handler_Ticker_2 Jump to Handler_Ticker_2 if *Ticker_SpeedCounter is not zero.
81E0 LD (HL),$07 Reset *Ticker_SpeedCounter to 07.
81E2 LD HL,$7812 HL=Ticker_CharacterCounter.
81E5 DEC (HL) Decrease *Ticker_CharacterCounter by one.
81E6 JR NZ,Handler_Ticker_1 Jump to Handler_Ticker_1 if *Ticker_CharacterCounter is not zero.
81E8 LD HL,$EFFB Jump to Handler_Ticker_0 if bit 1 ("Flightpath In-Progress") of *GameState_2 is set.
81EB BIT 1,(HL)
81ED JR NZ,Handler_Ticker_0
81EF LD A,($EFFA) Jump to TickerAnimation_Complete if the ticker animation has completed.
81F2 CP $00
81F4 JR Z,TickerAnimation_Complete
81F6 CALL Messaging_GenerateTicker Call Messaging_GenerateTicker.
81F9 JR Handler_Ticker Jump to Handler_Ticker.
The ticker animation is complete, so reset the state flag.
TickerAnimation_Complete 81FB RES 0,(HL) Set the ticker bit in *GameState_2 to "ticker OFF".
81FD RET Return.
Handler_Ticker_0 81FE LD A,($781E) A=*781E.
8201 CALL DoneFillingTickerBuffer Call DoneFillingTickerBuffer.
8204 JP Handler_Ticker Jump to Handler_Ticker.
Handler_Ticker_1 8207 LD HL,($7813) HL=*TickerCharacter_Pointer.
820A INC HL Increment *TickerCharacter_Pointer by one.
820B LD ($7813),HL
820E LD L,(HL) L=*HL.
820F LD H,$00 H=00.
8211 ADD HL,HL HL*=08.
8212 ADD HL,HL
8213 ADD HL,HL
8214 LD DE,$F740 HL+=F740.
8217 ADD HL,DE
8218 LD DE,$7816 Copy 0008 bytes from *HL to Buffer_TickerCharacter.
821B LD BC,$0008
821E LDIR
Rotate the messaging left across the screen.
Handler_Ticker_2 8220 LD C,$08 Set a counter in C for the lines (bytes) in a character (08).
8222 LD HL,$7816 HL=Buffer_TickerCharacter.
8225 LD DE,$50DF Set DE to the screen buffer location 50DF.
TickerRotate_Loop 8228 RLC (HL) Rotate *HL left (with carry).
822A PUSH DE Stash DE on the stack.
822B EX DE,HL Exchange the DE and HL registers.
Rotate the current line.
822C LD B,$20 Set a counter in B for the number of characters in a line (20).
TickerRotateLine_Loop 822E RL (HL) Rotate *HL left.
8230 DEC HL Decrease HL by one.
8231 DJNZ TickerRotateLine_Loop Decrease counter by one and loop back to TickerRotateLine_Loop until counter is zero.
8233 POP HL Restore HL from the stack.
8234 INC H Increment H by one.
8235 EX DE,HL Exchange the DE and HL registers.
8236 INC HL Increment HL by one.
8237 DEC C Decrease the line counter by one.
8238 JR NZ,TickerRotate_Loop Jump to TickerRotate_Loop until the line counter is zero.
823A RET Return.
Prev: 81B3 Up: Map Next: 823B