Prev: $0A57 Up: Map Next: $0B3A
$0A58: Make a teacher conduct a class with ERIC
This corresponds to $F300 in the ZX Spectrum version.
Used by the routine at $09E9.
$0A58 JSR $0B3B Wait for EINSTEIN to sit down and ERIC to show up.
This entry point is used by the routine at $0B3B.
$0A5B LDA #$01 Event $01: ERIC should be in class now.
$0A5D JSR $31B6 Raise the signal for this event.
$0A60 LDA #$02 Event $02: ERIC's lesson has started.
$0A62 JSR $31B6 Raise the signal for this event.
$0A65 JSR $0B3B Check whether ERIC is in class.
$0A68 LDA $D41B Generate a random value in A.
$0A6B CMP #$E3 Should EINSTEIN tell the teacher that ERIC hit him?
$0A6D BCC $0A80 Branch if not.
$0A6F LDX #$F9 Set YX to $5AF9: Please Sir I cannot tell a lie . . ERIC hit me.
$0A71 LDY #$5A
$0A73 JSR $1EE3 Make EINSTEIN tell the teacher that ERIC hit him.
$0A76 LDA #$14 Character number $14 is ERIC.
$0A78 LDY #$08 Lines reprimand $08: NOW DON'T DO IT AGAIN.
$0A7A JSR $2552 Make the teacher give lines to EINSTEIN or ERIC.
$0A7D JSR $0B3B Check whether ERIC is in class.
$0A80 LDA $FB Pick up the teacher's y-coordinate from $FB.
$0A82 CMP #$03 Is the teacher on the top floor?
$0A84 BNE $0A8F Branch if not.
$0A86 LDA $FC Pick up the teacher's x-coordinate from $FC.
$0A88 CMP #$3B Is the teacher in the Map Room?
$0A8A BCC $0A8F Branch if not.
$0A8C JMP $0B1C Jump forward (there's no blackboard in the Map Room).
$0A8F JSR $1468 Get the identifier and coordinates of the blackboard next to the teacher.
$0A92 LDA $1A Pick up the second byte of the blackboard's buffer from $1A.
$0A94 CMP #$14 Was ERIC the last person to write on this blackboard?
$0A96 BEQ $0AAB Branch if so.
$0A98 CMP #$10 Was BOY WONDER the last person to write on this blackboard?
$0A9A BEQ $0A9F Branch if so.
$0A9C JMP $0AD6 Jump forward.
$0A9F LDA $D41B Generate a random value in A.
$0AA2 CMP #$C9 Is this random value $C9 or more?
$0AA4 BCS $0AAB Branch if so.
$0AA6 LDA #$10 Character number $10 is BOY WONDER.
$0AA8 JMP $0AAD Jump forward.
$0AAB LDA #$14 Character number $14 is ERIC.
$0AAD PHA Save the character number temporarily.
$0AAE LDA #$5B Store $5B12 (Please Sir I cannot tell a lie . . ERIC wrote on the blackboard) at $86.
$0AB0 STA $87
$0AB2 LDA #$12
$0AB4 STA $86
$0AB6 LDY #$01 Y will point at the character name identifier in this message.
$0AB8 PLA Restore the character number of the boy that EINSTEIN will blame for writing on the blackboard and store it at $C0.
$0AB9 STA $C0
$0ABB CMP #$10 Is EINSTEIN going to blame BOY WONDER?
$0ABD BEQ $0AC4 Branch if so.
$0ABF LDA #$10 Character name identifier $10: ERIC.
$0AC1 JMP $0AC6 Jump forward.
$0AC4 LDA #$11 Character name identifier $11: BOY WONDER.
$0AC6 STA ($86),Y Place the character name identifier of the boy that EINSTEIN will blame into the message at $5B12.
$0AC8 LDX $86 YX=$5B12: Please Sir I cannot tell a lie . . ERIC/BOY WONDER wrote on the blackboard.
$0ACA LDY $87
$0ACC JSR $1EE3 Make EINSTEIN tell the teacher that ERIC or BOY WONDER wrote on the blackboard.
$0ACF LDA $C0 Pick up the character number of the boy that EINSTEIN blamed for writing on the blackboard.
$0AD1 LDY #$0C Lines reprimand $0C: DON'T TOUCH BLACKBOARDS.
$0AD3 JSR $2552 Make the teacher give lines to ERIC, BOY WONDER or EINSTEIN.
$0AD6 JSR $1F77 Place the address of the interruptible subcommand routine at $16E9 into the teacher's buffer and jump to it. This makes the teacher wipe the blackboard and return here when he's done.
$0AD9 .WORD $16E9
$0ADB LDA $FC Pick up the teacher's x-coordinate from $FC.
$0ADD CLC Add 3 to this x-coordinate and store the result in the the teacher's buffer at $AC and $AD.
$0ADE ADC #$03
$0AE0 STA $AC
$0AE2 STA $AD
$0AE4 JSR $1F77 Place the address of the interruptible subcommand routine at $136F into the teacher's buffer and jump to it. This makes the teacher walk to the middle of the blackboard before returning here.
$0AE7 .WORD $136F
$0AE9 LDA $D41B Generate a random value in A.
$0AEC CMP #$B5 Should the teacher write on the blackboard?
$0AEE BCC $0B1C Branch if not.
$0AF0 JSR $1F77 Place the address of the interruptible subcommand routine at $1129 into the teacher's buffer and jump to it. This makes him write on the blackboard and return here when he's done.
$0AF3 .WORD $1129
$0AF5 LDA $D41B Generate a random value in A.
$0AF8 CMP #$A1 Should the teacher tell the kids to write an essay?
$0AFA BCC $0B1C Branch if not.
$0AFC LDA #$D6 Store $5CD6 (WRITE AN ESSAY WITH THIS TITLE) at $AC.
$0AFE STA $AC
$0B00 LDA #$5C
$0B02 STA $AD
$0B04 JSR $1F77 Place the address of the interruptible subcommand routine at $2387 into the teacher's buffer and jump to it. This makes him tell the kids to write an essay or read their books, and then return here.
$0B07 .WORD $2387
$0B09 JSR $0B3B Check whether ERIC is in class.
$0B0C LDA $FC Pick up the teacher's x-coordinate from $FC.
$0B0E EOR #$03 Flip bits 0 and 1 of this x-coordinate and store the result in the teacher's buffer at $AC and $AD.
$0B10 STA $AC
$0B12 STA $AD
$0B14 JSR $1F77 Place the address of the interruptible subcommand routine at $136F into the teacher's buffer and jump to it. This makes him turn round, walk a few paces and then return here.
$0B17 .WORD $136F
$0B19 JMP $0B09 Jump back to make the teacher turn round and walk another few paces.
$0B1C LDA $D41B Generate a random value in A.
$0B1F CMP #$E1 Is this going to be a questions-and-answers lesson?
$0B21 BCC $0B29 Branch if so.
$0B23 JSR $2500 Prepare a message telling the kids to go to a certain page in their books.
$0B26 JMP $0B04 Jump back to make the teacher deliver this message.
This will be a questions-and-answers lesson.
$0B29 JSR $0B3B Check whether ERIC is in class.
$0B2C JSR $2241 Prepare a question and answer.
$0B2F JSR $1F77 Place the address of the interruptible subcommand routine at $2387 into the teacher's buffer and jump to it. This makes the teacher ask a question and then return here.
$0B32 .WORD $2387
$0B34 JSR $1F05 Wait until EINSTEIN has answered the question.
$0B37 JMP $0B29 Jump back for another question and answer.
Prev: $0A57 Up: Map Next: $0B3A