![]() |
Routines |
| Prev: A6EA | Up: Map | Next: A770 |
|
Used by the routine at DrawGameScreen.
Prints the whole telegram panel in town. It converts the bullet price, the horse price and the fine into digits, prints the first four lines of the telegram and, in a game for two players, the line which shows the score of the player who is not currently playing.
|
|||||
| PrintTelegram | A6FC | LD A,($A267) | Fetch the town flag. | ||
| A6FF | AND A | Return if the game is not in town. | |||
| A700 | RET Z | ||||
| A701 | LD HL,$A83D | Point HL at TelegramLines_BulletDigits. | |||
| A704 | LD DE,$A25E | Point DE at BulletPrice. | |||
| A707 | CALL ConvertPriceToDigits | Convert the price to digits. | |||
| A70A | LD HL,$A84F | Point HL at TelegramLines_HorseDigits. | |||
| A70D | LD DE,$A25C | Point DE at HorsePrice. | |||
| A710 | CALL ConvertPriceToDigits | Convert the price to digits. | |||
| A713 | LD HL,$A861 | Point HL at TelegramLines_FineDigits. | |||
| A716 | LD DE,$A25A | Point DE at Fine. | |||
| A719 | CALL ConvertPriceToDigits | Convert the amount to digits. | |||
| A71C | LD DE,$A830 | Point DE at TelegramLines. | |||
| A71F | LD B,$04 | Set the number of lines to four. | |||
| A721 | CALL PrintTelegram_Lines | Print the four lines. | |||
| A724 | LD A,($A21C) | Fetch the option flags. | |||
| A727 | BIT 0,A | Return if the game has only one player. | |||
| A729 | RET Z | ||||
| A72A | LD A,($A23F) | Fetch the number of the current player. | |||
| A72D | AND %00000001 | Keep bit 0. | |||
| A72F | JR NZ,PrintTelegram_FirstPlayerLine | Jump to PrintTelegram_FirstPlayerLine if the second player is playing. | |||
| A731 | LD DE,$A88A | Point DE at TelegramLines_SecondPlayerScore. | |||
| PrintTelegram_ScoreLine | A734 | PUSH DE | Stash the address of the line on the stack. | ||
| A735 | LD HL,$A26A | Point HL at OtherPlayerState. | |||
| A738 | EX DE,HL | Swap the two addresses. | |||
| A739 | LD A,$0C | Set the offset to the digits within the line. | |||
| A73B | CALL AddAToHL | Point HL at the digits. | |||
| A73E | CALL ConvertDigits | Convert the score to digits. | |||
| A741 | POP DE | Retrieve the address of the line. | |||
| A742 | LD B,$01 | Set the number of lines to print to one. | |||
|
This entry point prints B lines of the telegram, starting with the line at DE.
|
|||||
| PrintTelegram_Lines | A744 | LD C,$0E | Set the number of characters in a line to fourteen. | ||
| A746 | INC DE | Skip the counter of the line. | |||
| A747 | LD A,(DE) | Fetch the low byte of the screen address of the line. | |||
| A748 | INC DE | Move on to the high byte. | |||
| A749 | ADD A,$04 | Add four to move past the left edge of the panel. | |||
| A74B | LD L,A | Keep the low byte of the screen address in L. | |||
| A74C | LD A,(DE) | Fetch the high byte of the screen address of the line. | |||
| A74D | INC DE | Move on to the attribute. | |||
| A74E | LD H,A | Keep the high byte of the screen address in H. | |||
| A74F | LD A,(DE) | Fetch the attribute of the line. | |||
| A750 | INC DE | Move on to the first character. | |||
| A751 | EX AF,AF' | Keep the attribute in the alternate accumulator. | |||
| PrintTelegram_LinesLoop | A752 | LD A,(DE) | Fetch a character. | ||
| A753 | INC DE | Move on to the next character. | |||
| A754 | PUSH BC | Stash the counters on the stack. | |||
| A755 | CALL ConvertCharacter | Convert the character to the number of its tile. | |||
| A758 | LD BC,$8EA8 | Point BC at Font. | |||
| A75B | CALL DrawTile | Draw the character on the screen. | |||
| A75E | INC L | Move to the next screen position. | |||
| A75F | POP BC | Retrieve the counters. | |||
| A760 | DEC C | Decrease the character counter. | |||
| A761 | JR NZ,PrintTelegram_LinesLoop | Loop back until the whole line has been printed. | |||
| A763 | DJNZ PrintTelegram_Lines | Loop back until every line has been printed. | |||
| A765 | RET | Return. | |||
| PrintTelegram_FirstPlayerLine | A766 | LD DE,$A878 | Point DE at the score line for the first player. | ||
| A769 | JR PrintTelegram_ScoreLine | Jump to PrintTelegram_ScoreLine. | |||
| A76B | DEFB $C9,$AF,$32,$30,$A8 | Unused. | |||
| Prev: A6EA | Up: Map | Next: A770 |