Prev: 7F10 Up: Map Next: 7F60
7F1A: Inglish: Save The Clause And Act
Used by the routines at Turn_GateTheMessage and Event_ARandomHalf.
Saves the clause and scores the action for this character. When it is not the player's turn the saved registers are returned.
Inglish_SaveTheClauseAndAct 7F1A PUSH IX Save IX, IY, BC, DE and HL, and keep A in C.
7F1C PUSH IY
7F1E PUSH BC
7F1F PUSH DE
7F20 PUSH HL
7F21 LD C,A
7F22 CALL Inglish_FindThisCharacterSlot Call Inglish_FindThisCharacterSlot to find this character's slot.
7F25 LD (HL),$00 Clear it.
7F27 INC HL Jump to Inglish_SaveTheClauseAndAct_PointAtTheSlot if the character whose turn it is is not zero.
7F28 XOR A
7F29 CP C
7F2A JR NZ,Inglish_SaveTheClauseAndAct_PointAtTheSlot
7F2C OR $01 Clear the zero flag.
7F2E EX (SP),HL Swap HL with the address on the stack.
Inglish_SaveTheClauseAndAct_RestoreAndReturn 7F2F POP HL Restore HL, DE, BC, IY and IX from the stack.
7F30 POP DE
7F31 POP BC
7F32 POP IY
7F34 POP IX
7F36 RET Return.
Inglish_SaveTheClauseAndAct_PointAtTheSlot 7F37 PUSH HL Point IY at byte 01 of this character's slot.
7F38 POP IY
7F3A LD A,$01 Write 01 to *B71B.
7F3C LD ($B71B),A
7F3F LD A,($B71C) Read *B71C.
7F42 PUSH AF Call Inglish_ScoreTheCurrentAction to score the current action.
7F43 CALL Inglish_ScoreTheCurrentAction
7F46 EX AF,AF' Switch AF with its shadow.
7F47 XOR A Clear *B71B.
7F48 LD ($B71B),A
7F4B POP AF Update *B71C.
7F4C LD ($B71C),A
7F4F EX AF,AF' Switch AF with its shadow.
7F50 JR Z,Inglish_SaveTheClauseAndAct_ClearThisCharacter Jump to Inglish_SaveTheClauseAndAct_ClearThisCharacter if Inglish_ScoreTheCurrentAction found no match.
7F52 CALL Inglish_AskWhetherToSuppress Call Inglish_AskWhetherToSuppress to run the action and see whether its message was held back.
7F55 JR NZ,Inglish_SaveTheClauseAndAct_RestoreAndReturn Jump back to Inglish_SaveTheClauseAndAct_RestoreAndReturn if Inglish_AskWhetherToSuppress held the message back.
Inglish_SaveTheClauseAndAct_ClearThisCharacter 7F57 LD A,($B6EA) Read *CurrentCharacter.
7F5A CALL Inglish_WalkTheCharacterSlots Call Inglish_WalkTheCharacterSlots to walk the character slots.
7F5D XOR A Take the zero path back into the clause save.
7F5E JR Inglish_SaveTheClauseAndAct_RestoreAndReturn Jump back to Inglish_SaveTheClauseAndAct_RestoreAndReturn to return.
Prev: 7F10 Up: Map Next: 7F60