![]() |
Routines |
A | Number of character to receive lines (206-210) |
B | Reprimand message number |
H | Character number of teacher giving lines (200-204) |
29716 | PUSH AF | Save the lines recipient's character number briefly |
29717 | CALL 29696 | Collect in DE the coordinates of the teacher's head |
29720 | POP AF | Restore the lines recipient's character number to A |
29721 | ADD A,77 | 27<=A<=31 (lines message number for kid's name) |
29723 | LD (32650),A | Place it in 32650 (the first byte of message number 5, which is used as a submessage of message number 13: "[12]0 LINES^[5]") |
29726 | SUB 22 | Compute the attribute byte to be used for the lines message: 15 (blue background) for BOY WANDER; 23 (red background) for ANGELFACE or EINSTEIN; 31 (magenta background) for HAYLEY or ERIC |
29728 | RRA | |
29729 | ADD A,A | |
29730 | ADD A,A | |
29731 | ADD A,A | |
29732 | DEC A | |
29733 | LD C,A | Copy the lines message attribute byte to C |
29734 | NOP | |
29735 | NOP | |
29736 | NOP | |
29737 | PUSH BC | |
29738 | CALL 27276 | Save the area of screen that will be overwritten by the lines message |
29741 | POP BC | |
29742 | RET C | Return if the teacher giving lines is off-screen |
29743 | CALL 25233 | A=random number |
29746 | AND 14 | Set L=10, 20, 30, 40, 50, 60, 70 or 80 (number of lines/10) |
29748 | ADD A,2 | |
29750 | LD L,A | |
29751 | ADD A,A | |
29752 | ADD A,A | |
29753 | ADD A,L | |
29754 | LD L,A | |
29755 | LD A,C | A=attribute byte for lines message |
29756 | PUSH BC | |
29757 | CP 15 | Is the teacher giving lines to BOY WANDER? |
29759 | JR Z,29774 | Jump if so |
29761 | CP 31 | |
29763 | LD A,L | A=number of lines/10 |
29764 | JR Z,29771 | Jump if the teacher is giving lines to ERIC or HAYLEY |
29766 | CALL 29621 | Add EINSTEIN's or ANGELFACE's lines to the score and print the score |
29769 | JR 29774 | |
29771 | CALL 29643 | Add lines and print the new lines total |
29774 | PUSH DE | |
29775 | EX DE,HL | |
29776 | LD D,0 | DE=number of lines/10 |
29778 | CALL 27572 | Generate the character codes of the decimal digits for the number in DE |
29781 | POP DE | Restore the attribute file address for the top left corner of the lines message box to DE |
29782 | POP BC | Restore the attribute byte for the lines message to C |
29783 | PUSH BC | |
29784 | PUSH DE | |
29785 | LD A,13 | Message number 13: "[12]0 LINES^[5]" |
29787 | CALL 27462 | Print the lines message |
29790 | LD A,(58408) | A=attribute byte for the lines message |
29793 | LD DE,10240 | Set the duration parameter for the beep |
29796 | RRCA | The PAPER colour of the lines message box will be the border colour for the beep |
29797 | RRCA | |
29798 | RRCA | |
29799 | AND 7 | |
29801 | PUSH AF | |
29802 | LD BC,5136 | B=20 (pitch), C=16 |
29805 | CALL 29836 | Beep |
29808 | POP AF | A=PAPER colour of the lines message |
29809 | POP DE | Restore the attribute file address for the top left corner of the lines message box to DE |
29810 | POP BC | Restore the attribute byte for the lines message to C |
29811 | PUSH DE | |
29812 | PUSH AF | |
29813 | LD A,B | A=message number (13, 14 or 98) |
29814 | CALL 27462 | Print the message |
29817 | POP AF | A=border colour to use during the beep |
29818 | LD DE,5120 | Beep |
29821 | LD BC,12816 | |
29824 | CALL 29836 | |
29827 | POP DE | Restore the attribute file address for the top left corner of the message box to DE |
29828 | LD HL,58152 | Point HL to where the overwritten part of the screen was stored temporarily |
29831 | JP 27364 | Restore the area of the screen overwritten by the message box |