Prev: 47942 Up: Map Next: 48101
47964: Read The Action Flags
Used by the routine at RecordResultCharacterScript.
Reads the saved character record and dispatches through its action handler.
ReadActionFlags 47964 LD IX,(47717) Read the saved character record and the handler stored in it.
47968 LD L,(IX+3)
47971 LD H,(IX+4)
47974 JP (HL) Jump to the handler address in HL.
47975 LD (47645),A Store A in the flag at 47635+10 and the count at 47635+9.
47978 LD (47644),A
A following display value is not 255.
ReadActionFlags_CalculateObjectPointer 47981 CALL CalculateObjectPointerOffset Call CalculateObjectPointerOffset and jump to ReadActionFlags_MessagePointer if a following display value is not 255.
47984 JP C,ReadActionFlags_MessagePointer
47987 CALL CheckObjectAttribute Go to ReadActionFlags_FollowCharacterLink if the object is not a moving marker.
47990 JR Z,ReadActionFlags_FollowCharacterLink
47992 LD HL,47644 Count one more at 47635+9.
47995 INC (HL)
ReadActionFlags_FollowCharacterLink 47996 CALL FollowCharacterLink Call FollowCharacterLink to follow the character link.
47999 JR NZ,ReadActionFlags_CalculateObjectPointer Go back to ReadActionFlags_CalculateObjectPointer when the character link is still set.
48001 LD A,(47644) Jump to ReadActionFlags_SavedFlag if the count at 47635+9 is set.
48004 AND A
48005 JR NZ,ReadActionFlags_SavedFlag
48007 LD HL,29279 Take the message, then call PrintTextAndHandleControlCharacters to print the message.
48010 CALL PrintTextAndHandleControlCharacters
48013 RET Return.
Tests the flag at 47635+10.
ReadActionFlags_SavedFlag 48014 LD A,(47645) Jump to ReadActionFlags_CountClearOutstanding if the flag at 47635+10 is zero.
48017 AND A
48018 JR Z,ReadActionFlags_CountClearOutstanding
48020 LD IX,(47646) Point IX at the record at 47635+11 and call AdvancePointerAndCheckBit.
48024 PUSH IX
48026 CALL AdvancePointerAndCheckBit
ReadActionFlags_ActionFlags 48029 LD A,(IX+3) Jump to ReadActionFlags_PrintMessageBefore if the top two bits of the action flags are 128.
48032 AND 192
48034 CP 128
48036 JR Z,ReadActionFlags_PrintMessageBefore
48038 BIT 3,(IX+3) Jump to ReadActionFlags_PrintMessageBefore if bit 3 of the action flags is set.
48042 JR NZ,ReadActionFlags_PrintMessageBefore
48044 CALL ProcessEntryWithCounter Call ProcessEntryWithCounter to count down this repeating entry.
48047 JR ReadActionFlags_ActionFlags
Print the message before returning.
ReadActionFlags_PrintMessageBefore 48049 POP IX Restore the record from the stack and go to ReadActionFlags_Next if bit 3 of the action flags is set.
48051 JR NZ,ReadActionFlags_Next
48053 LD HL,29333 Point HL at the message at 29229+104.
ReadActionFlags_KeepCharacterRecord 48056 PUSH IX Keep the character record, then call PrintTextAndHandleControlCharacters to print the message.
48058 CALL PrintTextAndHandleControlCharacters
48061 RET Return.
This entry point is used by the routine at RecordResultCharacterScript.
Use the message as the pointer.
ReadActionFlags_MessagePointer 48062 LD HL,29251 Jump back to PrintTextAndHandleControlCharacters to print this message.
48065 JP PrintTextAndHandleControlCharacters
Use the message as the pointer.
ReadActionFlags_Next 48068 LD HL,29350 Point at this message and print it from ReadActionFlags_KeepCharacterRecord.
48071 JR ReadActionFlags_KeepCharacterRecord
Read the count, then clear the outstanding borrow.
ReadActionFlags_CountClearOutstanding 48073 CALL ProcessGameStatusEntries Call ProcessGameStatusEntries to run game status entries, then call ProcessGameStatusEntriesAlternate to run game status entries alternate.
48076 CALL ProcessGameStatusEntriesAlternate
48079 LD A,B Jump ahead to PrintTextBasedOnFlag if the count is not zero.
48080 AND A
48081 JR NZ,PrintTextBasedOnFlag
48083 CALL ProcessGameStatusEntriesWithCounter Jump ahead to ReadActionFlags_MessagePointerAgain if the count is zero.
48086 AND A
48087 JR Z,ReadActionFlags_MessagePointerAgain
48089 LD HL,29373 Point at this message and print it from ReadActionFlags_KeepCharacterRecord.
48092 JR ReadActionFlags_KeepCharacterRecord
Use the message as the pointer.
ReadActionFlags_MessagePointerAgain 48094 LD HL,29310 Take the message, then call PrintTextAndHandleControlCharacters to print the message.
48097 CALL PrintTextAndHandleControlCharacters
48100 RET Return.
Prev: 47942 Up: Map Next: 48101