Routines
 Prev: \$1D49 Up: Map Next: \$1DB6
\$1D4A: Add to ERIC's lines total and print it
Used by the routines at \$1DB7 and \$277D.
Input
A Number of lines to add (divided by 10)
\$1D4A STA \$57 Store the number of lines to add at \$57.
\$1D4C LDA \$7F Pick up the MSB of the lines total from \$7F.
\$1D4E CMP #\$04 Is it 4 or more?
\$1D50 BCS \$1DA2 Branch if so (the lines total is at least 10240).
\$1D52 CMP #\$03 Is the MSB of the lines total equal to 3?
\$1D54 BNE \$1D5C Branch if not (the lines total is less than 7680).
\$1D56 LDA \$7E Pick up the LSB of the lines total from \$7E.
\$1D58 CMP #\$E8 Is the lines total 10000 or more?
\$1D5A BCS \$1DA2 Branch if so.
\$1D5C LDA \$7E Increase the lines total at \$7E by the value stored at \$57.
\$1D5E CLC
\$1D61 BCC \$1D65
\$1D63 INC \$7F
\$1D65 STA \$7E
\$1D67 LDA \$7F Pick up the MSB of the lines total from \$7F.
\$1D69 CMP #\$03 Compare the MSB of the lines total with 3.
\$1D6B BCC \$1DAD Branch if it's less than 3 (the lines total is less than 7680).
\$1D6D BNE \$1D75 Branch if it's 4 or more (the lines total is at least 10240).
\$1D6F LDA \$7E Pick up the LSB of the lines total from \$7E.
\$1D71 CMP #\$E8 Is the lines total 10000 or more?
\$1D73 BCC \$1DAD Branch if not.
ERIC now has 10000 or more lines.
\$1D75 LDA #\$43 Place the address of the command list at \$43A2 into MR WACKER's character buffer.
\$1D77 STA \$8378
\$1D7A LDA #\$A2
\$1D7C STA \$8377
\$1D7F LDA \$837A Set bit 7 of byte \$7A of MR WACKER's character buffer, triggering a command list restart at the next available opportunity.
\$1D82 ORA #\$80
\$1D84 STA \$837A
\$1D87 LDA \$60 Pick up the current character number from \$60.
\$1D89 CMP #\$0B Is it \$0B (MR WACKER)?
\$1D8B BNE \$1D9B Branch if not.
\$1D8D LDA #\$43 Place the address of the command list at \$43A2 into the copy of MR WACKER's character buffer in page 0.
\$1D8F STA \$3E
\$1D91 LDA #\$A2
\$1D93 STA \$3D
\$1D95 LDA \$3F Set bit 7 of the flags byte at \$3F in the copy of MR WACKER's character buffer in page 0, triggering a command list restart at the next available opportunity.
\$1D97 ORA #\$80
\$1D99 STA \$3F
\$1D9B LDA #\$FF Set the MSB of the lesson clock at \$40 to \$FF, giving MR WACKER time to find ERIC before the bell rings.
\$1D9D STA \$40