Routines

62815: Make WACKER find and expel ERIC


The address of this routine is found in the table of A&P at 62768, the address of which is placed in MR WACKER's buffer by the routine at 62770

H 200 (MR WACKER)

62815 2E1D LD L,29
62817 CBFE SET 7,(HL) Signal: walk fast
62819 3EFF LD A,255 Set MSB of lesson time counter to 255 (this lesson will not end until ERIC's expelled)
62821 32E47F LD (32740),A
62824 CD5865 CALL 25944 Make WACKER track down ERIC
62827 2100C8 LD HL,51200 HL points to byte 0 of MR WACKER's buffer
62830 CB46 BIT 0,(HL) Is MR WACKER midstride?
62832 C0 RET NZ Return if so
62833 2C INC L
62834 ED5B01D2 LD DE,(53761) E=ERIC's x-coordinate, D=ERIC's y-coordinate
62838 7E LD A,(HL) A=MR WACKER's x-coordinate
62839 93 SUB E
62840 C603 ADD A,3
62842 FE07 CP 7
62844 D0 RET NC Return if WACKER isn't close enough to ERIC
62845 2C INC L
62846 7E LD A,(HL) A=MR WACKER's y-coordinate
62847 92 SUB D
62848 C603 ADD A,3
62850 FE07 CP 7
62852 D0 RET NC Return if WACKER isn't close enough to ERIC
62853 21FB7F LD HL,32763
62856 3640 LD (HL),64 Set bit 6: MR WACKER is expelling ERIC (who is paralysed)
62858 2EED LD L,237 HL=32749
62860 CB6E BIT 5,(HL) Bit 5 is set if ERIC jumped out of the top floor window
62862 26C8 LD H,200 200=MR WACKER
62864 1E63 LD E,99 Message no. 99: YOU HAVE 10000 LINES...
62866 2801 JR Z,62869 Jump if ERIC didn't jump out of the top-floor window (i.e. he has 10000 lines)
62868 1C INC E E=100: YOU ARE NOT A BIRD...
62869 01086A LD BC,27144 Routine at 27144: make character speak
62872 CD9F63 CALL 25503 Hand control temporarily to that routine, then return to 62875
62875 ED5BE57F LD DE,(32741) DE=score
62879 2AE97F LD HL,(32745) HL=current hi-score
62882 A7 AND A
62883 ED52 SBC HL,DE Do we have a new hi-score?
62885 3004 JR NC,62891 Jump if not
62887 ED53E97F LD (32745),DE Insert the new hi-score
62891 210000 LD HL,0
62894 22E57F LD (32741),HL Reset score
62897 22E77F LD (32743),HL Reset lines
62900 C3D5F6 JP 63189 Restart game