Prev: 50728 Up: Map Next: 51022
50878: Test The Graphics Field Of The Display Record
Used by the routine at ProcessDisplayRecord.
Tests the low nibble of the record's value byte against the room graphics.
Low nibble of the record's value byte is clear?
TestLowBitsOfGraphics 50878 LD A,(IY+1) Read the low nibble of the record's value byte and jump ahead to TestLowBitsOfGraphics_CodeFromFive when it is not zero.
50881 AND 15
50883 JR NZ,TestLowBitsOfGraphics_CodeFromFive
TestLowBitsOfGraphics_ReportMatch 50885 OR %00000001 Reset the zero flag.
50887 RET Return.
50888 JP ParseInputNumber_ReturnZero Return zero through ParseInputNumber_ReturnZero.
For a graphics code from 5 up to but not including 7, reads the room chosen for the graphics.
TestLowBitsOfGraphics_CodeFromFive 50891 CP 5 Jump ahead to TestLowBitsOfGraphics_CodeBelowThree if the low nibble of the value byte is below 5.
50893 JR C,TestLowBitsOfGraphics_CodeBelowThree
50895 CP 7 Jump ahead to TestLowBitsOfGraphics_UseGraphics if the low nibble of the value byte is at least 7.
50897 JR NC,TestLowBitsOfGraphics_UseGraphics
50899 LD A,(41013) Jump to TestLowBitsOfCharacter_ClearFlag if the room graphics parameter is not 254.
50902 CP 254
50904 JP NZ,TestLowBitsOfCharacter_ClearFlag
50907 LD HL,(41009) Read the display pointer.
50910 LD A,(IY+1) Jump to TestLowBitsOfGraphics_TestTopBit unless the low nibble of the value byte is 5.
50913 AND 15
50915 CP 5
50917 JR NZ,TestLowBitsOfGraphics_TestTopBit
50919 BIT 7,L Jump back to TestLowBitsOfGraphics_ReportMatch if bit 7 is clear.
50921 JR Z,TestLowBitsOfGraphics_ReportMatch
50923 JP TestLowBitsOfCharacter_ClearFlag This picture does not match, so give up from TestLowBitsOfCharacter_ClearFlag.
Bit 7 of the graphics pointer selects the next picture.
TestLowBitsOfGraphics_TestTopBit 50926 BIT 7,L Jump back to TestLowBitsOfGraphics_ReportMatch while bit 7 is present.
50928 JR NZ,TestLowBitsOfGraphics_ReportMatch
50930 JP TestLowBitsOfCharacter_ClearFlag Bit 7 of the graphics pointer is clear, so give up from TestLowBitsOfCharacter_ClearFlag.
For a graphics code below 3, looks the room up and accepts it when the top flag is set.
TestLowBitsOfGraphics_CodeBelowThree 50933 CP 3 Jump ahead to TestLowBitsOfGraphics_TestMarker if the low nibble of the value byte is at least 3.
50935 JR NC,TestLowBitsOfGraphics_TestMarker
50937 LD A,(41013) Read the room graphics parameter, then call FetchLocationDataPointer to look up this room.
50940 CALL FetchLocationDataPointer
50943 BIT 7,(IX+0) Jump to TestLowBitsOfCharacter_ClearFlag if a marker on the record's flag byte is clear.
50947 JP Z,TestLowBitsOfCharacter_ClearFlag
TestLowBitsOfGraphics_TestMarker 50950 BIT 0,(IY+1) Jump to TestLowBitsOfGraphics_ReportMatch if bit 0 of the value byte is clear.
50954 JR Z,TestLowBitsOfGraphics_ReportMatch
50956 LD A,(41013) Read the room graphics parameter and call FindObjectByFieldTwo to find an object by field two.
50959 CALL FindObjectByFieldTwo
50962 CP 255 Jump back to TestLowBitsOfCharacter_ClearFlag if the entry is the end marker.
50964 JP Z,TestLowBitsOfCharacter_ClearFlag
50967 JR TestLowBitsOfGraphics_ReportMatch The entry is not the end marker, so return non-zero from TestLowBitsOfGraphics_ReportMatch.
Read the room graphics parameter and keep it for the picture.
TestLowBitsOfGraphics_UseGraphics 50969 LD A,(41013) Read the room graphics parameter, store it in the room parameter at 52090 and keep it in C.
50972 LD (52090),A
50975 LD C,A
50976 LD A,(IY+1) Return if TestSeventhMarker returns zero.
50979 CALL TestSeventhMarker
50982 RET Z
50983 BIT 4,(IY+0) Jump to TestLowBitsOfCharacter_ReportMatch if bit 4 of the record flags is clear.
50987 JP Z,TestLowBitsOfCharacter_ReportMatch
50990 LD A,(IY+2) Read record bytes 2 and 5.
50993 LD L,(IY+5)
50996 LD H,(IY+6) Read record byte 6.
50999 BIT 6,(IY+0) Jump to TestLowBitsOfGraphics_TestAttribute unless bit 6 of the record flags is set.
51003 JR Z,TestLowBitsOfGraphics_TestAttribute
51005 LD A,(IY+4) With a handler word present, read record bytes 4 and 7 instead.
51008 LD L,(IY+7)
51011 LD H,(IY+8) Read record byte 8.
TestLowBitsOfGraphics_TestAttribute 51014 LD B,A Use that byte as the count and call ReadObjectAttribute_LooksObjectFolds to test the object attribute.
51015 CALL ReadObjectAttribute_LooksObjectFolds
51018 RET NZ Return if ReadObjectAttribute_LooksObjectFolds does not match the attribute.
51019 JP TestLowBitsOfCharacter_MarkMatched The attribute matched, so record it from TestLowBitsOfCharacter_MarkMatched.
Prev: 50728 Up: Map Next: 51022