![]() |
Routines |
Prev: 33203 | Up: Map | Next: 33339 |
Used by the routine at 32853.
|
|||||
Example messaging (note, this is two frames at a time - the game is smoother - plus, in the game the message starts off-screen).
|
|||||
Handler_Ticker | 33236 | LD HL,61435 | Return if the ticker is not currently enabled. | ||
33239 | BIT 0,(HL) | ||||
33241 | RET Z | ||||
33242 | LD HL,30741 | HL=Ticker_SpeedCounter. | |||
33245 | DEC (HL) | Decrease *Ticker_SpeedCounter by one. | |||
33246 | JR NZ,Handler_Ticker_2 | Jump to Handler_Ticker_2 if *Ticker_SpeedCounter is not zero. | |||
33248 | LD (HL),7 | Reset *Ticker_SpeedCounter to 7. | |||
33250 | LD HL,30738 | HL=Ticker_CharacterCounter. | |||
33253 | DEC (HL) | Decrease *Ticker_CharacterCounter by one. | |||
33254 | JR NZ,Handler_Ticker_1 | Jump to Handler_Ticker_1 if *Ticker_CharacterCounter is not zero. | |||
33256 | LD HL,61435 | Jump to Handler_Ticker_0 if bit 1 ("Flightpath In-Progress") of *GameState_2 is set. | |||
33259 | BIT 1,(HL) | ||||
33261 | JR NZ,Handler_Ticker_0 | ||||
33263 | LD A,(61434) | Jump to TickerAnimation_Complete if the ticker animation has completed. | |||
33266 | CP 0 | ||||
33268 | JR Z,TickerAnimation_Complete | ||||
33270 | CALL Messaging_GenerateTicker | Call Messaging_GenerateTicker. | |||
33273 | JR Handler_Ticker | Jump to Handler_Ticker. | |||
The ticker animation is complete, so reset the state flag.
|
|||||
TickerAnimation_Complete | 33275 | RES 0,(HL) | Set the ticker bit in *GameState_2 to "ticker OFF". | ||
33277 | RET | Return. | |||
Handler_Ticker_0 | 33278 | LD A,(30750) | A=*30750. | ||
33281 | CALL DoneFillingTickerBuffer | Call DoneFillingTickerBuffer. | |||
33284 | JP Handler_Ticker | Jump to Handler_Ticker. | |||
Handler_Ticker_1 | 33287 | LD HL,(30739) | HL=*TickerCharacter_Pointer. | ||
33290 | INC HL | Increment *TickerCharacter_Pointer by one. | |||
33291 | LD (30739),HL | ||||
33294 | LD L,(HL) | L=*HL. | |||
33295 | LD H,0 | H=0. | |||
33297 | ADD HL,HL | HL*=8. | |||
33298 | ADD HL,HL | ||||
33299 | ADD HL,HL | ||||
33300 | LD DE,63296 | HL+=63296. | |||
33303 | ADD HL,DE | ||||
33304 | LD DE,30742 | Copy 0008 bytes from *HL to Buffer_TickerCharacter. | |||
33307 | LD BC,8 | ||||
33310 | LDIR | ||||
Rotate the messaging left across the screen.
|
|||||
Handler_Ticker_2 | 33312 | LD C,8 | Set a counter in C for the lines (bytes) in a character (8). | ||
33314 | LD HL,30742 | HL=Buffer_TickerCharacter. | |||
33317 | LD DE,20703 | Set DE to the screen buffer location 20703. | |||
TickerRotate_Loop | 33320 | RLC (HL) | Rotate *HL left (with carry). | ||
33322 | PUSH DE | Stash DE on the stack. | |||
33323 | EX DE,HL | Exchange the DE and HL registers. | |||
Rotate the current line.
|
|||||
33324 | LD B,32 | Set a counter in B for the number of characters in a line (32). | |||
TickerRotateLine_Loop | 33326 | RL (HL) | Rotate *HL left. | ||
33328 | DEC HL | Decrease HL by one. | |||
33329 | DJNZ TickerRotateLine_Loop | Decrease counter by one and loop back to TickerRotateLine_Loop until counter is zero. | |||
33331 | POP HL | Restore HL from the stack. | |||
33332 | INC H | Increment H by one. | |||
33333 | EX DE,HL | Exchange the DE and HL registers. | |||
33334 | INC HL | Increment HL by one. | |||
33335 | DEC C | Decrease the line counter by one. | |||
33336 | JR NZ,TickerRotate_Loop | Jump to TickerRotate_Loop until the line counter is zero. | |||
33338 | RET | Return. |
Prev: 33203 | Up: Map | Next: 33339 |