Back to Skool Routines
Prev: 27903 Up: Map Next: 27953
27904: Control kid during assembly
Used by command lists 20, 40 and 88.
H Character number of kid
27904 LD A,H Determine the x-coordinate at which this boy will sit during assembly based on his character number (H) and his current x-coordinate (in byte 1 of the character buffer)
27905 AND 3
27907 CPL
27908 LD L,1
27910 ADD A,(HL)
27911 LD L,11 Store this x-coordinate in byte 11 of the kid's character buffer
27913 LD (HL),A
Having determined where the kid will sit, send him there.
27914 LD BC,25581 Redirect control to the routine at 25581 (walk to location) and then return to 27920
27917 CALL 25503
This entry point is used after the kid has reached the point where he will sit.
27920 LD L,0 Byte 0 of the character buffer holds the kid's animatory state
27922 BIT 7,(HL) Is he facing left?
27924 JP Z,25648 Make him turn round to face the stage if so
27927 LD L,4 Remove the address of this routine's entry point (27920) from bytes 3 and 4 of the character buffer
27929 LD (HL),0
27931 CALL 25012 Update SRB for the character's current animatory state and location
27934 AND 240 A=animatory state of character sitting on the floor
27936 ADD A,5
27938 CALL 30534 Update SRB for character's new animatory state, and place the address of the entry point at 27941 (below) into bytes 17 and 18 of the character buffer
This entry point is used after the kid has sat down facing the stage.
27941 LD A,(32640) Check bit 7 of 32640 (set by 61658, reset by 62032): has assembly finished yet?
27944 RLCA
27945 RET C Return if not
27946 LD L,18 Remove the address of this routine's entry point (27941) from bytes 17 and 18 of the character's buffer, triggering a move to the next instruction in the command list
27948 LD (HL),0
27950 JP 26818 Stand up before continuing, though
Prev: 27903 Up: Map Next: 27953