![]() |
Routines |
| Prev: 66E1 | Up: Map | Next: 67B2 |
|
Drops the worm Percy is carrying.
Scans the room data for the collected worm marker (1E) and clears it back to 00 so the worm will reappear when the room is next redrawn.
|
||||
| DropWorm | 679C | LD BC,$0160 | Set the search counter to 0160 in BC. | |
| 679F | LD HL,$DE9E | Point HL at Room_Object_Data. | ||
| DropWorm_SearchLoop | 67A2 | LD A,$1E | Jump to DropWorm_Found if *HL equals 1E (found the collected worm marker). | |
| 67A4 | CP (HL) | |||
| 67A5 | JR Z,DropWorm_Found | |||
| 67A7 | INC HL | Advance to the next byte. | ||
| 67A8 | DEC BC | Decrement BC and loop back to DropWorm_SearchLoop until all 0160 bytes are searched. | ||
| 67A9 | LD A,C | |||
| 67AA | OR B | |||
| 67AB | JR NZ,DropWorm_SearchLoop | |||
| 67AD | RET | Return (no collected worm marker found). | ||
| DropWorm_Found | 67AE | LD (HL),$00 | Write 00 to *HL to clear the collected marker. | |
| 67B0 | JR Reset_Worm_State | Jump to Reset_Worm_State. | ||
| Prev: 66E1 | Up: Map | Next: 67B2 |