Routines
| Prev: D5FB | Up: Map | Next: D671 |
D60B: Describe the ways out through things: 'TO THE NORTH THERE IS THE FRONT DOOR'
|
For each exit that passes through a thing (a door) that has been revealed (+5 bit 7). 'To the north there is the front door.' on Baker Street.
|
||||||||
| D60B | PUSH BC | Save BC on the stack - Save the registers | ||||||
| D60C | PUSH DE | Save DE on the stack | ||||||
| D60D | PUSH IY | Save IY on the stack | ||||||
| D60F | PUSH IX | Save IX on the stack | ||||||
| D611 | CALL $D5EF | IX = this room's exit list, BC = 3 bytes an exit (D5EF) | ||||||
| D614 | PUSH IX | Save IX on the stack - IY = the first exit (direction, thing, destination) | ||||||
| D616 | POP IY | Restore IY from the stack | ||||||
| D618 | JR $D660 | Go to the end test | ||||||
| D61A | LD A,(IY+$01) | Read the holder byte (+1) of the thing record at IY into A - Does the exit pass through a thing (+1 non-zero)? | ||||||
| D61D | AND A | Test A for zero (this leaves A as it was and clears carry) | ||||||
| D61E | JR Z,$D660 | If A is zero, jump on to D660 | ||||||
| D620 | LD A,(IY+$00) | Read the number byte (+0) of the thing record at IY into A - Direction above 10: skip | ||||||
| D623 | CP $0B | Compare A with $0B | ||||||
| D625 | JR NC,$D660 | If A is $0B or more, jump on to D660 | ||||||
| D627 | LD A,(IY+$01) | Read the holder byte (+1) of the thing record at IY into A - Find the thing's record (D237) | ||||||
| D62A | CALL $D237 | Call the routine "Resolve an id (in A) to its full entity record" (D237) | ||||||
| D62D | BIT 7,(IX+$05) | Test bit 7 of the flags byte (+5) of the thing record at IX (revealed) - Not revealed yet (+5 bit 7 clear): skip | ||||||
| D631 | JR Z,$D660 | If bit 7 of the flags byte (+5) of the thing record at IX is clear, jump on to D660 | ||||||
| D633 | LD A,(IY+$00) | Read the number byte (+0) of the thing record at IY into A - The direction's word (D5FB) in DE | ||||||
| D636 | CALL $D5FB | Call the routine "DE = the word for direction A (NORTH ... DOWN)" (D5FB) | ||||||
| D639 | CP $09 | Compare A with $09 - Directions 1-8 (compass) | ||||||
| D63B | JR C,$D647 | If A is below $09, skip ahead to D647 | ||||||
| D63D | LD DE,$000A | Load DE with $000A - 9: the word $000A | ||||||
| D640 | JR Z,$D64D | If A equals $09, skip ahead to D64D | ||||||
| D642 | LD DE,$00E7 | Load DE with $00E7 - 10: the word $00E7 | ||||||
| D645 | JR $D64D | Skip ahead to D64D | ||||||
| D647 | LD HL,$68BC | Point HL at the message "TO THE" (68BC) - Print the lead-in 68BC ('TO THE') | ||||||
| D64A | CALL $A59F | Call the routine "Print the message at HL" (A59F) | ||||||
| D64D | CALL $A887 | Print the direction word (A887) | ||||||
| D650 | LD HL,$68E9 | Point HL at the message "THERE IS" (68E9) - Print 68E9 ('THERE IS') | ||||||
| D653 | CALL $A59F | Call the routine "Print the message at HL" (A59F) | ||||||
| D656 | PUSH IY | Save IY on the stack - Print the door's name (D3D5) and end the sentence (A414) | ||||||
| D658 | CALL $D3D5 | Call the routine "Print thing IX's name" (D3D5) | ||||||
| D65B | CALL $A414 | Call A414 (inside "Print the rest of a narrated command: verb...") | ||||||
| D65E | POP IY | Restore IY from the stack | ||||||
| D660 | ADD IY,BC | Add BC to IY - Next exit | ||||||
| D662 | LD A,$FF | Load A with $FF | ||||||
| D664 | CP (IY+$00) | Compare A with the number byte (+0) of the thing record at IY - $FF ends the list | ||||||
| D667 | JP NZ,$D61A | If A differs from the number byte (+0) of the thing record at IY, go back to D61A | ||||||
| D66A | POP IX | Restore IX from the stack - Restore the registers and return | ||||||
| D66C | POP IY | Restore IY from the stack | ||||||
| D66E | POP DE | Restore DE from the stack | ||||||
| D66F | POP BC | Restore BC from the stack | ||||||
| D670 | RET | Return to the caller | ||||||
| Prev: D5FB | Up: Map | Next: D671 |