Prev: 9FC7 Up: Map Next: A09D
A050: Table: List What Is Here
Used by the routines at ActionOpenOrClose and Message_RememberTheSeparator.
Lists the objects in the current place.
TableListWhatIsHere A050 PUSH IX Keep the object id.
A052 PUSH BC
A053 PUSH DE
A054 LD C,A
Find the object's record.
A055 CALL LocateObject Call LocateObject to locate object.
A058 LD A,(IX+$07) Read the attribute flags from the object record.
A05B AND $28 Keep bits 3, 5.
A05D JR Z,TableListWhatIsHere_FinishTheList Jump to TableListWhatIsHere_FinishTheList when the object is neither broken nor open.
A05F LD A,C Use the result again.
Count the visible objects.
A060 CALL ObjectCount Call ObjectCount to count the visible objects.
A063 CP $00 Compare it with zero.
A065 JR Z,TableListWhatIsHere_FinishTheList Jump to TableListWhatIsHere_FinishTheList if ObjectCount counted nothing inside the current object.
A067 BIT 6,(IX+$07) Jump to TableListWhatIsHere_UseTheToken if the object is not an animal.
A06B JR Z,TableListWhatIsHere_UseTheToken
A06D LD A,C Use the result again.
A06E PUSH AF Point HL at "[0x13] carrying[0x14]".
A06F LD HL,$ADF9
A072 JR TableListWhatIsHere_PrintCarryingOrThere Jump to TableListWhatIsHere_PrintCarryingOrThere to print "carrying".
TableListWhatIsHere_UseTheToken A074 LD HL,$039B Use the token IS.
A077 DEC A Drop one from the hold count.
A078 JR Z,TableListWhatIsHere_ReadTheNameTokenFromTheObject Jump to TableListWhatIsHere_ReadTheNameTokenFromTheObject if the count was 01.
A07A LD HL,$0065 Use the token ARE.
TableListWhatIsHere_ReadTheNameTokenFromTheObject A07D PUSH HL Read the name token from the object record.
A07E LD L,(IX+$08)
A081 LD A,(IX+$09) Read the name token's high byte from the object record.
A084 AND $0F Keep the low nibble of byte 9 of this object.
A086 LD H,A
A087 PUSH HL Call Message_ExitsForThisLocation to list the exits for this location.
A088 CALL Message_ExitsForThisLocation
A08B LD HL,$AFE0 Point at the message "[0x01] there[0x01][0x14]" (AFE0).
TableListWhatIsHere_PrintCarryingOrThere A08E CALL PrintMessage Call PrintMessage to print message.
A091 AND A Clear carry and return through TableListWhatIsHere_RestoreAndReturn.
TableListWhatIsHere_RestoreAndReturn A092 POP DE Restore DE, BC and IX from the stack.
A093 POP BC
A094 POP IX
A096 RET Return.
TableListWhatIsHere_FinishTheList A097 CALL Print_LineBreak Call Print_LineBreak to print a newline.
A09A SCF Set carry and return: the list of what is here is finished.
A09B JR TableListWhatIsHere_RestoreAndReturn Jump back to TableListWhatIsHere_RestoreAndReturn.
Prev: 9FC7 Up: Map Next: A09D