Routines

29716: Make teacher give lines

Used by routines at 30102, 32062 and 61487

A Number of character to receive lines (206-210)
B Reprimand message number
H Character number of teacher giving lines (200-204)

29716 F5 PUSH AF A=number of character to receive lines (206-210)
29717 CD0074 CALL 29696 Collect in DE the coordinates of the point above the teacher's head
29720 F1 POP AF
29721 C64D ADD A,77 27≤A≤31 (message number for kid's name)
29723 328A7F LD (32650),A
29726 D616 SUB 22
29728 1F RRA
29729 87 ADD A,A
29730 87 ADD A,A
29731 87 ADD A,A
29732 3D DEC A A: from {206,207,208,209,210} to {15,23,23,31,31}
29733 4F LD C,A C=attribute byte to be used for lines message
29734 00 NOP
29735 00 NOP
29736 00 NOP
29737 C5 PUSH BC
29738 CD8C6A CALL 27276 Save area of screen that will be overwritten by lines message
29741 C1 POP BC
29742 D8 RET C Return if teacher giving lines is off-screen
29743 CD9162 CALL 25233 A=random number
29746 E60E AND 14 A in {0,2,4,6,8,10,12,14}
29748 C602 ADD A,2 A in {2,4,6,8,10,12,14,16}
29750 6F LD L,A L in {2,4,6,8,10,12,14,16}
29751 87 ADD A,A A in {4,8,12,16,20,24,28,32}
29752 87 ADD A,A A in {8,16,24,32,40,48,56,64}
29753 85 ADD A,L A in {10,20,30,40,50,60,70,80}
29754 6F LD L,A L in {10,20,30,40,50,60,70,80} (number of lines/10)
29755 79 LD A,C A=attribute byte to be used for lines message
29756 C5 PUSH BC
29757 FE0F CP 15 Is teacher giving lines to BOY WANDER?
29759 280D JR Z,29774 Jump if so
29761 FE1F CP 31
29763 7D LD A,L A=number of lines/10
29764 2805 JR Z,29771 Jump if giving lines to ERIC or HAYLEY
29766 CDB573 CALL 29621 Add EINSTEIN's or ANGELFACE's lines to the score and print score
29769 1803 JR 29774
29771 CDCB73 CALL 29643 Add lines and print them
29774 D5 PUSH DE
29775 EB EX DE,HL
29776 1600 LD D,0 DE=number of lines/10
29778 CDB46B CALL 27572 Generate character codes of digits
29781 D1 POP DE
29782 C1 POP BC
29783 C5 PUSH BC
29784 D5 PUSH DE
29785 3E0D LD A,13 Message number 13: "[12]0 LINES^[5]"
29787 CD466B CALL 27462 Print the lines message
29790 3A28E4 LD A,(58408) A=attribute byte of lines message
29793 110028 LD DE,10240 Parameter for beep
29796 0F RRCA Put PAPER colour
in bits 0-2 ready
for beeper routine
29797 0F RRCA
29798 0F RRCA
29799 E607 AND 7
29801 F5 PUSH AF
29802 011014 LD BC,5136 Parameter for beep
29805 CD8C74 CALL 29836 Beep
29808 F1 POP AF A=PAPER colour of lines message
29809 D1 POP DE
29810 C1 POP BC

This entry point is used by the routines at 29896 and 62668.
29811 D5 PUSH DE
29812 F5 PUSH AF
29813 78 LD A,B A=reprimand message number
29814 CD466B CALL 27462 Print the reprimand message
29817 F1 POP AF
29818 110014 LD DE,5120 Another beep
29821 011032 LD BC,12816
29824 CD8C74 CALL 29836
29827 D1 POP DE Retrieve start address of overwritten part of screen
29828 2128E3 LD HL,58152 Point to where overwritten part of screen was stored temporarily
29831 C3E46A JP 27364 Jump to restore area of screen overwritten by lines message