Prev: 51043 Up: Map Next: 51233
51110: Test For The Seventh Marker
Used by the routines at TestLowBitsOfCharacter and TestLowBitsOfGraphics.
Keeps bits 0-3 and tests the seventh and eighth markers.
TestSeventhMarker 51110 AND 15 Jump back to TestLowBitsOfCharacter_ReportMatch if the low nibble is command 7.
51112 CP 7
51114 JP Z,TestLowBitsOfCharacter_ReportMatch
51117 CP 8 Go to TestSeventhMarker_CommandNine when the command is not 8.
51119 JR NZ,TestSeventhMarker_CommandNine
51121 LD A,C Take the count, then call CheckObjectLocationMatch to test object location match.
51122 CALL CheckObjectLocationMatch
TestSeventhMarker_0 51125 JP Z,TestLowBitsOfCharacter_GiveUp Go to TestLowBitsOfCharacter_GiveUp if the object is not in this location.
51128 JP TestLowBitsOfCharacter_ReportMatch Jump back to TestLowBitsOfCharacter_ReportMatch to return non-zero.
For command 9, checks the low count and gives up when that check fails.
TestSeventhMarker_CommandNine 51131 CP 9 Jump ahead to TestSeventhMarker_CommandTen if the command is not 9.
51133 JR NZ,TestSeventhMarker_CommandTen
51135 LD A,C Go to TestLowBitsOfCharacter_GiveUp if the object is not in this location.
51136 CALL CheckObjectLocationMatch
51139 JP Z,TestLowBitsOfCharacter_GiveUp
51142 LD A,C Go to TestLowBitsOfCharacter_GiveUp if the record's first byte is not 1.
51143 CALL GetObjectAttribute
51146 JP NZ,TestLowBitsOfCharacter_GiveUp
51149 LD A,C Go to TestLowBitsOfCharacter_GiveUp if the object has a special description.
51150 CALL TestObjectHasSpecialDescription
51153 JP NZ,TestLowBitsOfCharacter_GiveUp
51156 LD B,C Read the character being processed, then call ProcessObjectAttribute_LookObjectRun to run object attribute.
51157 LD A,(41014)
51160 CALL ProcessObjectAttribute_LookObjectRun
51163 JP Z,TestLowBitsOfCharacter_GiveUp Go to TestLowBitsOfCharacter_GiveUp if the attribute comparison borrows.
51166 LD A,C Jump back to ReadHighByteSource_0 to run display action.
51167 CALL GetObjectMotherID
51170 JR ReadHighByteSource_0
For command 10, checks the low count and gives up when that check fails.
TestSeventhMarker_CommandTen 51172 CP 10 Jump ahead to TestSeventhMarker_CommandEleven if the command is not 10.
51174 JR NZ,TestSeventhMarker_CommandEleven
51176 LD A,C Go to TestLowBitsOfCharacter_GiveUp if the object is not in this location.
51177 CALL CheckObjectLocationMatch
51180 JP Z,TestLowBitsOfCharacter_GiveUp
51183 LD A,C Jump to TestLowBitsOfCharacter_GiveUp if CheckCharacterIDRange does not match this character.
51184 CALL CheckCharacterIDRange
51187 JP NC,TestLowBitsOfCharacter_GiveUp
51190 JP TestLowBitsOfCharacter_ReportMatch Jump back to TestLowBitsOfCharacter_ReportMatch to return non-zero.
For command 11, checks the low count and gives up when that check fails.
TestSeventhMarker_CommandEleven 51193 CP 11 Jump ahead to TestSeventhMarker_CommandTwelve if the command is not 11.
51195 JR NZ,TestSeventhMarker_CommandTwelve
51197 LD A,C Go to TestLowBitsOfCharacter_GiveUp if the object is not in this location.
51198 CALL CheckObjectLocationMatch
51201 JP Z,TestLowBitsOfCharacter_GiveUp
51204 LD A,C Call GetObjectAttribute for the object in C and jump to TestSeventhMarker_0.
51205 CALL GetObjectAttribute
51208 JR TestSeventhMarker_0
For command 12, follows the object that contains this one.
TestSeventhMarker_CommandTwelve 51210 CP 12 Jump ahead to TestSeventhMarker_MatchObjectThenRoom if the command is not 12.
51212 JR NZ,TestSeventhMarker_MatchObjectThenRoom
51214 LD A,C Call TestObjectHasSpecialDescription and jump back to TestSeventhMarker_0, which gives up when the special description is clear.
51215 CALL TestObjectHasSpecialDescription
51218 JR TestSeventhMarker_0
The object is in the room, so follow whatever contains it.
TestSeventhMarker_MatchObjectThenRoom 51220 LD A,C Give up on this object when it is not in the room, otherwise follow the object that contains it.
51221 CALL CheckObjectLocationMatch
51224 JP Z,TestLowBitsOfCharacter_GiveUp
51227 LD A,C Call TestObjectHasSpecialDescription and jump back to TestSeventhMarker_0, which gives up when the special description is clear.
51228 CALL TestObjectHasSpecialDescription
51231 JR TestSeventhMarker_0
Prev: 51043 Up: Map Next: 51233