Prev: 26337 Up: Map Next: 26546
26524: Drop Worm
Used by the routines at MainGameLoop, Position_Worm_In_Beak and Handler_RedBird.
Drops the worm Percy is carrying.
Scans the room data for the collected worm marker (30) and clears it back to 0 so the worm will reappear when the room is next redrawn.
DropWorm 26524 LD BC,352 Set the search counter to 352 in BC.
26527 LD HL,56990 Point HL at Room_Object_Data.
DropWorm_SearchLoop 26530 LD A,30 Jump to DropWorm_Found if *HL equals 30 (found the collected worm marker).
26532 CP (HL)
26533 JR Z,DropWorm_Found
26535 INC HL Advance to the next byte.
26536 DEC BC Decrement BC and loop back to DropWorm_SearchLoop until all 352 bytes are searched.
26537 LD A,C
26538 OR B
26539 JR NZ,DropWorm_SearchLoop
26541 RET Return (no collected worm marker found).
DropWorm_Found 26542 LD (HL),0 Write 0 to *HL to clear the collected marker.
26544 JR Reset_Worm_State Jump to Reset_Worm_State.
Prev: 26337 Up: Map Next: 26546