Prev: C201 Up: Map Next: C24F
C213: Parser: Resolve Phrase
Used by the routine at Parser_MatchVocabulary.
Turn a matched word into an object name, or say it cannot be seen.
Parser_ResolvePhrase C213 INC BC Scan the phrase list for the end marker.
C214 LD A,($BAFA)
C217 SUB C
C218 LD B,A
C219 LD E,A
C21A LD A,$FE
C21C LD HL,($BAEA)
C21F INC B
C220 JR Parser_ResolvePhrase_Next
Parser_ResolvePhrase_Loop C222 INC HL Step to the next byte of the phrase.
Parser_ResolvePhrase_SkipMarker C223 INC HL Keep skipping while this byte is the marker being sought.
C224 CP (HL)
C225 JR Z,Parser_ResolvePhrase_Loop
Parser_ResolvePhrase_Next C227 DJNZ Parser_ResolvePhrase_SkipMarker Repeat from Parser_ResolvePhrase_SkipMarker until the phrase list is finished.
C229 JR Parser_ResolvePhrase_TestObject Jump to Parser_ResolvePhrase_TestObject to test the first object.
Parser_ResolvePhrase_NextObject C22B INC HL Step to the next object in the phrase.
Parser_ResolvePhrase_TestObject C22C LD A,(HL) Return when this object is in this room.
C22D CALL IsObjectInCurrentRoom
C230 RET Z
C231 INC HL Jump back to Parser_ResolvePhrase_NextObject when the end of a phrase matches.
C232 LD A,(HL)
C233 CP $FE
C235 JR Z,Parser_ResolvePhrase_NextObject
C237 LD HL,$BBED Print "I can't see ".
C23A CALL PrintString
C23D LD IX,($BAEC) Call GetTableEntry to look up the object's name.
C241 CALL GetTableEntry
C244 CALL PrintString Call PrintString to print the name.
C247 LD HL,$BBFA Print " here.".
C24A CALL PrintStringAndANewline
C24D SCF Set the carry flag to reject the command.
C24E RET Return.
Prev: C201 Up: Map Next: C24F