Prev: 56590 Up: Map Next: 56904
56629: Describe Object If Present
Used by the routine at ReadScheduleEntryFromCurrentCharacter.
Returns zero when A is zero, or when a bit of 40 is set in the object's attribute and its location is not below IY+2. Any other object returns non-zero.
DescribeObjectIfPresent 56629 AND A Return if the object is zero.
56630 RET Z
56631 PUSH IX Call FetchObjectDataPointer to look up that object.
56633 CALL FetchObjectDataPointer
56636 LD A,(IX+5) Read the object attribute.
None of the bits 40 are set in the object attribute?
56639 AND 40 Jump to DescribeObjectIfPresent_Next if none of the bits 40 are set in the object attribute.
56641 LD A,(IX+2)
56644 POP IX
56646 JR Z,DescribeObjectIfPresent_Next
56648 CP (IY+2) Go to DescribeObjectIfPresent_Next if the object's location is below the byte at IY+2.
56651 JR C,DescribeObjectIfPresent_Next
56653 XOR A Clear A.
56654 RET Return.
DescribeObjectIfPresent_Next 56655 OR %00000001 Reset the zero flag.
56657 RET Return.
Named from the script commands at 58464 and 59326.
56658 DEFB 164,0 Display record read by ProcessDisplayRecord: flags 164 value 0.
56660 DEFB 23,97,221,253,255,96,221 Refresh the room from the text at 56673, using the low byte of the location, 255 and otherwise continue at 56672.
56667 DEFB 17,253,96,221 Perform the simple action for the low byte of the location and otherwise continue at 56672.
56671 DEFB 11 Run the nested character script.
56672 DEFB 10 Run the nested character script.
56673 DEFB 100,0,110,221 Display record read by ProcessDisplayRecord: flags 100 value 0 handler 56686.
Run by 51812 after the display record at 56673.
56677 LD A,(IX+0) Read the object's first byte and store it as the location value.
56680 LD (40919),A
56683 OR %00000001 Reset the zero flag.
56685 RET Return.
Reached through the display record at 56673, dispatched by DispatchLookedUpHandlerThird.
56686 LD A,(41012) Read the room display parameter and call FindObjectByFieldTwo to find an object by field two.
56689 CALL FindObjectByFieldTwo
56692 CP 255 Go to ParseInputNumber_ReturnZero if it is 255.
56694 JP Z,ParseInputNumber_ReturnZero
56697 LD A,(IX+0) Return zero through ParseInputNumber_ReturnZero if the record's flag byte is at least 11.
56700 CP 11
56702 JP NC,ParseInputNumber_ReturnZero
56705 OR %00000001 Reset the zero flag.
56707 RET Return.
Named from the script commands at 58486 and 59343.
56708 DEFB 109,0,145,221 Display record read by ProcessDisplayRecord: flags 109 value 0 handler 56721.
Run by 51812 after the display record at 56708.
56712 LD A,(IX+1) Record the current room.
56715 LD (40918),A
56718 OR %00000001 Reset the zero flag.
56720 RET Return.
56721 LD IX,(40979) Read the current object.
56725 LD A,(IX+1) Go to ParseInputNumber_ReturnZero if the moved marker is 255.
56728 AND A
56729 INC A
56730 JP Z,ParseInputNumber_ReturnZero
56733 RET Return.
56734 DEFB 13,16 Display record read by ProcessDisplayRecord: flags 13 value 16.
Run by 51812 after the display record at 56734.
56736 LD A,(41012) Read the room display parameter.
56739 CALL FindCharacter Call FindCharacter to find the character.
Was this character 255?
56742 CP 255 Use zero and go to DescribeObjectIfPresent_0 if this character is 255.
56744 LD A,0
56746 JR Z,DescribeObjectIfPresent_0
56748 LD A,1 Take 1.
DescribeObjectIfPresent_0 56750 CALL FollowLinkPointer Call FollowLinkPointer.
56753 OR 1
56755 RET Return.
56756 DEFB 64,80,184,221 Display record read by ProcessDisplayRecord: flags 64 value 80 handler 56760.
Reached through the display record at CopySavedCharacterIdentifier, 56756 and 56784, dispatched by DispatchLookedUpHandlerThird.
Run by 51812 after the display record at 56756.
56760 CALL CheckFlagAndJumpToNewline Call CheckFlagAndJumpToNewline.
56763 OR 1
56765 RET Return.
Named from the script commands at 61118, 61156, 61188, 61268, 61301, 61673, 61997, 62022, 62043, 62056, 62072, 62093 and 62124.
56766 DEFB 64,0,184,221 Display record read by ProcessDisplayRecord: flags 64 value 0 handler 56760.
Run by 51812 after the display record at 56766.
56770 LD A,(41012) Store the room display parameter in the character script cycle.
56773 LD (40991),A
56776 OR %00000001 Reset the zero flag.
56778 RET Return.
56779 DEFW 0 The location text pointer, read by DescribeObjectIfPresent and MeasureGapBetweenTwoPointers_Next.
56781 DEFW 0 The object's description pointer, read by DescribeObjectIfPresent and MeasureGapBetweenTwoPointers_Next.
56783 DEFB 0 Data bytes 0 read by DescribeObjectIfPresent.
56784 DEFB 69,0,184,221 Display record read by ProcessDisplayRecord: flags 69 value 0 handler 56760.
Run by 51812 after the display record at 56784.
56788 LD HL,(41007) Read the display pointer.
56791 RES 7,H Clear the marker.
56793 PUSH HL
56794 LD A,H
DescribeObjectIfPresent_MaskName 56795 AND 63 Keep the low six bits of the name, then call ScaleHighByteBySixty to scale the high byte by sixty.
56797 LD H,A
56798 LD A,L
56799 AND 63
56801 LD L,A
56802 CALL ScaleHighByteBySixty
56805 LD (56781),HL Remember the object's description.
56808 LD HL,(40927) Scale the word at CurrentTime_Minutes by sixty.
56811 CALL ScaleHighByteBySixty
56814 LD (56779),HL Remember the location text.
56817 POP HL
56818 LD A,97
56820 LD (56783),A Store it in the workspace byte at 56783.
56823 BIT 6,H Jump ahead to DescribeObjectIfPresent_ObjectDescriptionLocation if bit 6 is present.
56825 JR NZ,DescribeObjectIfPresent_ObjectDescriptionLocation
56827 LD A,112 Write the letter p into the description marker.
56829 LD (56783),A
56832 BIT 6,L Jump ahead to DescribeObjectIfPresent_ObjectDescriptionLocation if bit 6 is present.
56834 JR NZ,DescribeObjectIfPresent_ObjectDescriptionLocation
56836 CALL MeasureGapBetweenTwoPointers_Next Call MeasureGapBetweenTwoPointers_Next, read the AM/PM letter at Messaging_AM_PM and go to DescribeObjectIfPresent_Letter if the description pointer is below the location text.
56839 LD A,(40930)
56842 JR C,DescribeObjectIfPresent_Letter
56844 JR NZ,DescribeObjectIfPresent_WorkspaceByte Go to DescribeObjectIfPresent_WorkspaceByte if the description is past the location text.
Is the marker the letter a?
DescribeObjectIfPresent_Letter 56846 CP 97 Use the letter p when the marker is the letter a.
56848 LD A,112
56850 JR Z,DescribeObjectIfPresent_WorkspaceByte
56852 LD A,97 Take the letter a.
DescribeObjectIfPresent_WorkspaceByte 56854 LD (56783),A Store it in the workspace byte at 56783.
DescribeObjectIfPresent_ObjectDescriptionLocation 56857 LD HL,(56781) Read the object's description and the location text.
56860 LD DE,(56779)
56864 AND A Subtract the value at 56779 from the one at 56781 and take 720, the half-day step added at 56889.
56865 SBC HL,DE
56867 LD DE,720
56870 LD A,(40930) Read the AM/PM marker into C and the description marker at 56783 into B.
56873 LD C,A
56874 LD A,(56783)
56877 LD B,A
56878 CALL MeasureGapBetweenTwoPointers_Next Jump to DescribeObjectIfPresent_AdvancePointerSource if the object's description pointer is below the location text pointer.
56881 JR C,DescribeObjectIfPresent_AdvancePointerSource
56883 JR Z,DescribeObjectIfPresent_AdvancePointerSource Go to DescribeObjectIfPresent_AdvancePointerSource if the object's description pointer equals the location text pointer.
56885 LD A,B Go to DescribeObjectIfPresent_RecordCharacterScript if the description marker matches AM/PM.
56886 CP C
56887 JR Z,DescribeObjectIfPresent_RecordCharacterScript
56889 ADD HL,DE The hours differ, so add one step and store the total from DescribeObjectIfPresent_RecordCharacterScript.
56890 JR DescribeObjectIfPresent_RecordCharacterScript
Add one step, and a second step when the description marker matches.
DescribeObjectIfPresent_AdvancePointerSource 56892 ADD HL,DE Add one step, and go to DescribeObjectIfPresent_RecordCharacterScript if the description marker does not match AM/PM.
56893 LD A,B
56894 CP C
56895 JR NZ,DescribeObjectIfPresent_RecordCharacterScript
56897 ADD HL,DE Add one more step to the cycle count.
DescribeObjectIfPresent_RecordCharacterScript 56898 LD (40991),HL Record the character script cycle.
56901 OR %00000001 Reset the zero flag.
56903 RET Return.
Prev: 56590 Up: Map Next: 56904