Prev: 7B78 Up: Map Next: 7C23
7B9E: Inglish: Save The Clause Window
Used by the routine at Inglish_ScoreTheCurrentAction.
Saves the clause window: the object's id and location, then copies the clause pairs into the match buffers.
Inglish_SaveTheClauseWindow 7B9E PUSH IY Read the low byte of the pointer in the clause.
7BA0 LD L,(IY+$00)
7BA3 LD H,(IY+$01) Read the high byte of the pointer in the clause.
7BA6 LD A,H Use the clause byte at offset 1 again.
7BA7 AND $80 Keep only bit 7.
7BA9 LD ($7952),A Update the saved phrase byte.
7BAC RES 7,H Clear bit 7 of the pointer's high byte.
7BAE LD ($7958),HL Remember the pointer in the saved text pointer.
7BB1 LD HL,$795A Point HL at the swapped text pointer.
7BB4 PUSH HL Count 04 passes.
7BB5 LD B,$04
Fill the buffer at HL.
7BB7 CALL Blanker Call Blanker to fill a run of bytes.
7BBA POP HL Count 02 passes.
7BBB LD B,$02
7BBD LD E,$04 Save the clause bytes at offset 04.
7BBF CALL Inglish_CopyOneClausePair Call Inglish_CopyOneClausePair to copy one clause pair.
7BC2 LD E,$0E Save the clause bytes at offset 0E.
7BC4 CALL Inglish_CopyOneClausePair Call Inglish_CopyOneClausePair to copy one clause pair.
7BC7 LD E,$06 Save the clause bytes at offset 06.
7BC9 CALL Inglish_CopyOneClausePair Call Inglish_CopyOneClausePair to copy one clause pair.
7BCC LD E,$10 Save the clause bytes at offset 10.
7BCE CALL Inglish_CopyOneClausePair Call Inglish_CopyOneClausePair to copy one clause pair.
7BD1 XOR A Clear *B6DF.
7BD2 LD ($B6DF),A
7BD5 LD HL,$7958 Point HL at the saved text pointer.
7BD8 LD DE,$0008 Each action record is 08 bytes.
7BDB LD IX,$AB53 Point IX at the action table.
Inglish_SaveTheClauseWindow_UseTheActionTable 7BDF PUSH IX Use the action table as the parser pointer.
7BE1 POP IY
7BE3 CALL Inglish_MatchClausePairs Call Inglish_MatchClausePairs to match clause pairs.
7BE6 JR Z,Inglish_SaveTheClauseWindow_ScoreTheSwappedClause Jump to Inglish_SaveTheClauseWindow_ScoreTheSwappedClause if Inglish_MatchClausePairs returned zero.
7BE8 ADD IX,DE Add 0008 onto the action table.
7BEA LD A,(IX+$01) Read the high byte of this action's token.
7BED OR (IX+$00) Jump back to Inglish_SaveTheClauseWindow_UseTheActionTable if this action's token is not zero.
7BF0 JR NZ,Inglish_SaveTheClauseWindow_UseTheActionTable
7BF2 POP IY Restore the clause pointer from the stack.
Test the low half of the class being matched.
7BF4 LD A,($B6DF) Jump to Inglish_PlantJumpRelativeIfNonZero_ReadThePointers if *B6DF is not zero.
7BF7 AND A
7BF8 JP NZ,Inglish_PlantJumpRelativeIfNonZero_ReadThePointers
7BFB LD HL,($7958) Read the pointer stored in the saved text pointer.
7BFE PUSH HL Point HL at "[0x0d] You[0x01].[0x0d] Time passes.".
7BFF LD HL,$ADA3
7C02 XOR A Clear *WaitCountdown.
7C03 LD ($B701),A
7C06 LD ($B71C),A Update *B71C.
7C09 LD A,$01 Write 01 (the gate shut) to *B6FA.
7C0B LD ($B6FA),A
7C0E CALL MessageOpenTheGateForAConjunction Call MessageOpenTheGateForAConjunction to open the message gate for a conjunction.
7C11 LD A,($B71B) Read *B71B.
7C14 DEC A Return if the conjunction count reached zero.
7C15 RET Z
7C16 POP HL Jump back to InglishApplyAMatch_GiveEveryOtherCharacterATurn to advance the other characters.
7C17 POP HL
7C18 JP InglishApplyAMatch_GiveEveryOtherCharacterATurn
Inglish_SaveTheClauseWindow_ScoreTheSwappedClause 7C1B POP IY Restore the clause pointer from the stack and call Inglish_ScoreTheSwappedClause to score the swapped clause.
7C1D CALL Inglish_ScoreTheSwappedClause
7C20 OR $01 Clear the zero flag.
7C22 RET Return.
View the equivalent code in;
Prev: 7B78 Up: Map Next: 7C23