Prev: 31469 Up: Map Next: 31587
31477: 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 31477 PUSH HL Save HL, IY, IX, DE and BC, then read the object pointer at 31054.
31478 PUSH IY
31480 PUSH IX
31482 PUSH DE
31483 PUSH BC
31484 LD HL,(31054)
31487 PUSH HL Read *CurrentAction.
31488 LD A,(46823)
31491 CALL IndexAction Call IndexAction to index action.
31494 PUSH HL Point IX at the action entry IndexAction returned.
31495 POP IX
31497 CALL Inglish_ClearTheMatchBuffer Call Inglish_ClearTheMatchBuffer to clear the match buffer.
31500 CALL ClausePackTheActionScores Call ClausePackTheActionScores to pack this action entry's token classes into the clause.
31503 CALL Inglish_SplitTheClauseFlags Call Inglish_SplitTheClauseFlags to split the clause flags.
31506 LD A,(46824) Read *CurrentObject.
31509 LD B,A Copy the result into B.
31510 LD A,(46846) Read *46846.
31513 LD DE,31042 Point DE at the first copy window.
31516 CALL Inglish_CopyANameIntoTheClause Call Inglish_CopyANameIntoTheClause to copy a name into the clause.
31519 LD A,(46825) Read *46825.
31522 LD B,A Copy the result into B.
31523 LD A,(46847) Read *46847.
31526 LD DE,31048 Point DE at the second copy window.
31529 CALL Inglish_CopyANameIntoTheClause Call Inglish_CopyANameIntoTheClause to copy a name into the clause.
31532 CALL Inglish_NoteTheFirstNoun_0 Call Inglish_NoteTheFirstNoun_0 to note the first noun.
31535 XOR A Clear *46842.
31536 LD (46842),A
31539 LD A,(46877) Read *46877.
31542 AND 12 Jump to Inglish_BuildTheActionSentence_SetThePhraseFlag if either bit 2 or bit 3 of the phrase scratch is set.
31544 JR NZ,Inglish_BuildTheActionSentence_SetThePhraseFlag
31546 CALL Turn_RunTheHandlerIfPresent Call Turn_RunTheHandlerIfPresent to run the handler when one is present.
31549 LD A,(46843) Read the message-suppressed flag.
31552 AND A See whether the message-suppressed flag is zero.
31553 JR Inglish_BuildTheActionSentence_ShutTheMessageGate Jump to Inglish_BuildTheActionSentence_ShutTheMessageGate to update the message gate.
Inglish_BuildTheActionSentence_SetThePhraseFlag 31555 LD A,1 Set the phrase flag at 31059.
31557 LD (31059),A
31560 CALL Inglish_ResolveTheFirstNoun Call Inglish_ResolveTheFirstNoun to resolve the first noun.
31563 JR Z,Inglish_BuildTheActionSentence_ClearTheZeroFlag Jump to Inglish_BuildTheActionSentence_ClearTheZeroFlag if Inglish_ResolveTheFirstNoun returned with the zero flag set.
31565 XOR A Take the zero path, which still opens the message gate.
31566 JR Inglish_BuildTheActionSentence_ShutTheMessageGate Jump to Inglish_BuildTheActionSentence_ShutTheMessageGate to update the message gate.
Inglish_BuildTheActionSentence_ClearTheZeroFlag 31568 OR 1 Clear the zero flag.
Inglish_BuildTheActionSentence_ShutTheMessageGate 31570 LD A,1 Write 1 (the gate shut) to *46842.
31572 LD (46842),A
31575 POP HL Remember the pointer in the saved object pointer.
31576 LD (31054),HL
31579 POP BC Restore BC, DE, IX, IY and HL from the stack.
31580 POP DE
31581 POP IX
31583 POP IY
31585 POP HL
31586 RET Return.
Prev: 31469 Up: Map Next: 31587