Prev: 7AED Up: Map Next: 7B63
7AF5: Inglish: Build The Action Sentence
Used by the routine at Turn_ApplyTheSavedMatch.
Builds the action sentence from the saved object pointer, the current action and both nouns, copying each name into the clause.
Inglish_BuildTheActionSentence 7AF5 PUSH HL Save HL, IY, IX, DE and BC, then read the object pointer at 794E.
7AF6 PUSH IY
7AF8 PUSH IX
7AFA PUSH DE
7AFB PUSH BC
7AFC LD HL,($794E)
7AFF PUSH HL Read *CurrentAction.
7B00 LD A,($B6E7)
7B03 CALL IndexAction Call IndexAction to index action.
7B06 PUSH HL Point IX at the action entry IndexAction returned.
7B07 POP IX
7B09 CALL Inglish_ClearTheMatchBuffer Call Inglish_ClearTheMatchBuffer to clear the match buffer.
7B0C CALL ClausePackTheActionScores Call ClausePackTheActionScores to pack this action entry's token classes into the clause.
7B0F CALL Inglish_SplitTheClauseFlags Call Inglish_SplitTheClauseFlags to split the clause flags.
7B12 LD A,($B6E8) Read *CurrentObject.
7B15 LD B,A Copy the result into B.
7B16 LD A,($B6FE) Read *B6FE.
7B19 LD DE,$7942 Point DE at the first copy window.
7B1C CALL Inglish_CopyANameIntoTheClause Call Inglish_CopyANameIntoTheClause to copy a name into the clause.
7B1F LD A,($B6E9) Read *B6E9.
7B22 LD B,A Copy the result into B.
7B23 LD A,($B6FF) Read *B6FF.
7B26 LD DE,$7948 Point DE at the second copy window.
7B29 CALL Inglish_CopyANameIntoTheClause Call Inglish_CopyANameIntoTheClause to copy a name into the clause.
7B2C CALL Inglish_NoteTheFirstNoun_0 Call Inglish_NoteTheFirstNoun_0 to note the first noun.
7B2F XOR A Clear *B6FA.
7B30 LD ($B6FA),A
7B33 LD A,($B71D) Read *B71D.
7B36 AND $0C Jump to Inglish_BuildTheActionSentence_SetThePhraseFlag if either bit 2 or bit 3 of the phrase scratch is set.
7B38 JR NZ,Inglish_BuildTheActionSentence_SetThePhraseFlag
7B3A CALL Turn_RunTheHandlerIfPresent Call Turn_RunTheHandlerIfPresent to run the handler when one is present.
7B3D LD A,($B6FB) Read the message-suppressed flag.
7B40 AND A See whether the message-suppressed flag is zero.
7B41 JR Inglish_BuildTheActionSentence_ShutTheMessageGate Jump to Inglish_BuildTheActionSentence_ShutTheMessageGate to update the message gate.
Inglish_BuildTheActionSentence_SetThePhraseFlag 7B43 LD A,$01 Set the phrase flag at 7953.
7B45 LD ($7953),A
7B48 CALL Inglish_ResolveTheFirstNoun Call Inglish_ResolveTheFirstNoun to resolve the first noun.
7B4B JR Z,Inglish_BuildTheActionSentence_ClearTheZeroFlag Jump to Inglish_BuildTheActionSentence_ClearTheZeroFlag if Inglish_ResolveTheFirstNoun returned with the zero flag set.
7B4D XOR A Take the zero path, which still opens the message gate.
7B4E JR Inglish_BuildTheActionSentence_ShutTheMessageGate Jump to Inglish_BuildTheActionSentence_ShutTheMessageGate to update the message gate.
Inglish_BuildTheActionSentence_ClearTheZeroFlag 7B50 OR $01 Clear the zero flag.
Inglish_BuildTheActionSentence_ShutTheMessageGate 7B52 LD A,$01 Write 01 (the gate shut) to *B6FA.
7B54 LD ($B6FA),A
7B57 POP HL Remember the pointer in the saved object pointer.
7B58 LD ($794E),HL
7B5B POP BC Restore BC, DE, IX, IY and HL from the stack.
7B5C POP DE
7B5D POP IX
7B5F POP IY
7B61 POP HL
7B62 RET Return.
Prev: 7AED Up: Map Next: 7B63