Routines

27904: Control kid during assembly


Used by tables of A&P numbers 20, 40 and 88

H Character number of kid

27904 7C LD A,H
27905 E603 AND 3
27907 2F CPL
27908 2E01 LD L,1
27910 86 ADD A,(HL) A=x-coordinate at which this boy will sit
27911 2E0B LD L,11 Store this x-coordinate in byte 11 of the kid's buffer
27913 77 LD (HL),A
27914 01ED63 LD BC,25581 Redirect control to the routine at 25581 (walk to location) and then return to 27920
27917 CD9F63 CALL 25503
27920 2E00 LD L,0
27922 CB7E BIT 7,(HL) Is the character facing left?
27924 CA3064 JP Z,25648 Turn round to face the stage if so
27927 2E04 LD L,4
27929 3600 LD (HL),0
27931 CDB461 CALL 25012 Update SRB for character's current animatory state and location
27934 E6F0 AND 240
27936 C605 ADD A,5 A=animatory state of character sitting on the floor
27938 CD4677 CALL 30534 Update SRB and redirect control to 27941 (below)
27941 3A807F LD A,(32640)
27944 07 RLCA Has MR WACKER finished yet?
27945 D8 RET C Return if not
27946 2E12 LD L,18 Remove the address of this routine (27941) from bytes 17 and 18 of the character's buffer
27948 3600 LD (HL),0
27950 C3C268 JP 26818 Stand up