![]() |
Routines |
| H | Character number (183-214) |
| 31915 | LD L,6 | Pick up the time/event identifier in A |
| 31917 | LD A,(HL) | |
| 31918 | DEC L | L=5 |
| 31919 | CALL 31887 | Has the time come or event happened? |
| 31922 | JR Z,31942 | Jump if not |
| 31924 | LD A,(HL) | A=x-coordinate of the location relative to which the character is performing his walkabout (the "walkabout origin"), stored in byte 5 |
| 31925 | LD L,1 | Byte 1 of the character's buffer holds his x-coordinate |
| 31927 | CP (HL) | Is the character at the walkabout origin (and therefore ready to respond to the arrival/occurrence of the time/event)? |
| 31928 | JR NZ,31934 | Return him to the walkabout origin if not |
| 31930 | DEC L | Point HL at byte 0 of the character's buffer |
| 31931 | BIT 0,(HL) | Is the character midstride? |
| 31933 | RET Z | Return with the carry flag reset if not |
| 31934 | SCF | Signal: Not ready to advance in command list yet |
| 31935 | LD L,11 | Fill in the new walkabout destination (either the origin or some new location within 7 spaces to the left of the origin) |
| 31937 | LD (HL),A | |
| 31938 | LD BC,25581 | Return with BC holding the address of the routine at 25581 |
| 31941 | RET |
| 31942 | CALL 25233 | A=random number |
| 31945 | AND 7 | 0<=A<=7 |
| 31947 | SUB 7 | -7<=A<=0 |
| 31949 | ADD A,(HL) | Add the x-coordinate of the walkabout origin to give the new walkabout destination |
| 31950 | JR 31934 |