Prev: BB46 Up: Map Next: BBE5
BB5C: Read The Action Flags
Used by the routine at RecordResultCharacterScript.
Reads the saved character record and dispatches through its action handler.
ReadActionFlags BB5C LD IX,($BA65) Read the saved character record and the handler stored in it.
BB60 LD L,(IX+$03)
BB63 LD H,(IX+$04)
BB66 JP (HL) Jump to the handler address in HL.
BB67 LD ($BA1D),A Store A in the flag at BA13+0A and the count at BA13+09.
BB6A LD ($BA1C),A
A following display value is not FF.
ReadActionFlags_CalculateObjectPointer BB6D CALL CalculateObjectPointerOffset Call CalculateObjectPointerOffset and jump to ReadActionFlags_MessagePointer if a following display value is not FF.
BB70 JP C,ReadActionFlags_MessagePointer
BB73 CALL CheckObjectAttribute Go to ReadActionFlags_FollowCharacterLink if the object is not a moving marker.
BB76 JR Z,ReadActionFlags_FollowCharacterLink
BB78 LD HL,$BA1C Count one more at BA13+09.
BB7B INC (HL)
ReadActionFlags_FollowCharacterLink BB7C CALL FollowCharacterLink Call FollowCharacterLink to follow the character link.
BB7F JR NZ,ReadActionFlags_CalculateObjectPointer Go back to ReadActionFlags_CalculateObjectPointer when the character link is still set.
BB81 LD A,($BA1C) Jump to ReadActionFlags_SavedFlag if the count at BA13+09 is set.
BB84 AND A
BB85 JR NZ,ReadActionFlags_SavedFlag
BB87 LD HL,$725F Take the message, then call PrintTextAndHandleControlCharacters to print the message.
BB8A CALL PrintTextAndHandleControlCharacters
BB8D RET Return.
Tests the flag at BA13+0A.
ReadActionFlags_SavedFlag BB8E LD A,($BA1D) Jump to ReadActionFlags_CountClearOutstanding if the flag at BA13+0A is zero.
BB91 AND A
BB92 JR Z,ReadActionFlags_CountClearOutstanding
BB94 LD IX,($BA1E) Point IX at the record at BA13+0B and call AdvancePointerAndCheckBit.
BB98 PUSH IX
BB9A CALL AdvancePointerAndCheckBit
ReadActionFlags_ActionFlags BB9D LD A,(IX+$03) Jump to ReadActionFlags_PrintMessageBefore if the top two bits of the action flags are 80.
BBA0 AND $C0
BBA2 CP $80
BBA4 JR Z,ReadActionFlags_PrintMessageBefore
BBA6 BIT 3,(IX+$03) Jump to ReadActionFlags_PrintMessageBefore if bit 3 of the action flags is set.
BBAA JR NZ,ReadActionFlags_PrintMessageBefore
BBAC CALL ProcessEntryWithCounter Call ProcessEntryWithCounter to count down this repeating entry.
BBAF JR ReadActionFlags_ActionFlags
Print the message before returning.
ReadActionFlags_PrintMessageBefore BBB1 POP IX Restore the record from the stack and go to ReadActionFlags_Next if bit 3 of the action flags is set.
BBB3 JR NZ,ReadActionFlags_Next
BBB5 LD HL,$7295 Point HL at the message at 722D+68.
ReadActionFlags_KeepCharacterRecord BBB8 PUSH IX Keep the character record, then call PrintTextAndHandleControlCharacters to print the message.
BBBA CALL PrintTextAndHandleControlCharacters
BBBD RET Return.
This entry point is used by the routine at RecordResultCharacterScript.
Use the message as the pointer.
ReadActionFlags_MessagePointer BBBE LD HL,$7243 Jump back to PrintTextAndHandleControlCharacters to print this message.
BBC1 JP PrintTextAndHandleControlCharacters
Use the message as the pointer.
ReadActionFlags_Next BBC4 LD HL,$72A6 Point at this message and print it from ReadActionFlags_KeepCharacterRecord.
BBC7 JR ReadActionFlags_KeepCharacterRecord
Read the count, then clear the outstanding borrow.
ReadActionFlags_CountClearOutstanding BBC9 CALL ProcessGameStatusEntries Call ProcessGameStatusEntries to run game status entries, then call ProcessGameStatusEntriesAlternate to run game status entries alternate.
BBCC CALL ProcessGameStatusEntriesAlternate
BBCF LD A,B Jump ahead to PrintTextBasedOnFlag if the count is not zero.
BBD0 AND A
BBD1 JR NZ,PrintTextBasedOnFlag
BBD3 CALL ProcessGameStatusEntriesWithCounter Jump ahead to ReadActionFlags_MessagePointerAgain if the count is zero.
BBD6 AND A
BBD7 JR Z,ReadActionFlags_MessagePointerAgain
BBD9 LD HL,$72BD Point at this message and print it from ReadActionFlags_KeepCharacterRecord.
BBDC JR ReadActionFlags_KeepCharacterRecord
Use the message as the pointer.
ReadActionFlags_MessagePointerAgain BBDE LD HL,$727E Take the message, then call PrintTextAndHandleControlCharacters to print the message.
BBE1 CALL PrintTextAndHandleControlCharacters
BBE4 RET Return.
Prev: BB46 Up: Map Next: BBE5