Prev: 38468 Up: Map Next: 38540
38480: Update states of ape-beasts (level 2) and store current positions in script data
Used by the routine at 38009.
38480 LD IX,44162 Load IX with address of complex state data for ape-beast 1 (level 2)
38484 LD IY,38424 Point IY at table of current positions in ape-beasts' script data
38488 LD A,(IX+1) If depth of ape-beast is zero (i.e. ape-beast killed by Bubo)...
38491 OR A ...
38492 JR Z,38523 ...then skip ahead to 38523 (i.e. move onto next ape-beast)
38494 LD L,(IY+0) Load HL with current position in script data for current ape-beast...
38497 LD H,(IY+1) ...
38500 LD (34277),HL ...and store at 34277 as position in script currently running
38503 PUSH IX Store IX
38505 PUSH IY Store IY
38507 CALL 38540 Update the state of the current ape-beast
38510 POP IY Restore IY
38512 POP IX Restore IX
38514 LD HL,(34277) Store address (current position in script data for current ape-beast) stored at 34277...
38517 LD (IY+0),L ...in table at 38424 as current position in this ape-beast's script data...
38520 LD (IY+1),H ...
38523 INC IY Advance IY to next entry in table (i.e. position in next ape-beast's script data)...
38525 INC IY ...
38527 LD DE,13 Advance IX by 13 bytes (i.e. to entry for next ape-beast)...
38530 ADD IX,DE ...
38532 LD A,(IX+8) If class of this next entry is 25 (i.e. ape-beast)...
38535 CP 25 ...
38537 JR Z,38488 ...then loop back to 38488
38539 RET Return
Prev: 38468 Up: Map Next: 38540