Prev: 57898 Up: Map Next: 58094
57997: Test This Character Against The Room
Used by the routine at CheckCharacterForRoomGraphics.
Returns through ParseInputNumber_ReturnZero when the character being processed is the room display parameter. A non-zero return means the script step succeeded.
TestCharacterAgainstRoom 57997 LD A,(41014) Go to ParseInputNumber_ReturnZero if the character being processed is the room display parameter.
58000 LD HL,41012
58003 CP (HL)
58004 JP Z,ParseInputNumber_ReturnZero
58007 RET Return.
Reached through the display record at 58055, dispatched by DispatchLookedUpHandlerThird.
58008 LD A,(41012) Jump to TestCharacterAgainstRoom_SearchPairs if the room display parameter is 30.
58011 CP 30
58013 JR Z,TestCharacterAgainstRoom_SearchPairs
58015 CP 33 Return zero through ParseInputNumber_ReturnZero if the room display parameter is not Entrance Hall.
58017 JP NZ,ParseInputNumber_ReturnZero
TestCharacterAgainstRoom_SearchPairs 58020 LD A,(40970) Call SearchPairTable to search pair table.
58023 LD C,0
58025 CALL SearchPairTable
58028 JP NZ,ParseInputNumber_ReturnZero Return zero through ParseInputNumber_ReturnZero if SearchPairTable finds no pair.
58031 LD IX,(40979) Read the current object.
58035 LD A,(IX+15) Return zero through ParseInputNumber_ReturnZero if the record is not zero.
58038 AND A
58039 JP NZ,ParseInputNumber_ReturnZero
58042 LD A,(41012) Read the room display parameter.
58045 CALL FindCharacterScriptEntry_StartSearch Call FindCharacterScriptEntry_StartSearch to walk the character-script entries.
58048 JP NZ,ParseInputNumber_ReturnZero Return zero through ParseInputNumber_ReturnZero if FindCharacterScriptEntry_StartSearch finds a script entry.
58051 OR %00000001 Reset the zero flag.
58053 RET Return.
58054 DEFB 0 Script byte overwritten by 39641, read by ReadRoomDisplayParameter and PlaceCharacterBesideMatch.
58055 DEFB 71,16,152,226 Display record read by ProcessDisplayRecord: flags 71 value 16 handler 58008.
Run by 51812 after the display record at 58055.
58059 LD A,(40970) Read the character attribute.
58062 LD B,A Keep it as the count.
58063 LD A,(41012) Read the room display parameter.
58066 INC A Count one more.
58067 LD (58054),A Store that count in the script byte at 58054.
58070 DEC A Count down one.
58071 CALL StoreMatchedCharacterRoom Call StoreMatchedCharacterRoom to match the character and store its room.
58074 LD A,(41014) Read the character being processed.
58077 LD B,A Keep it as the count.
58078 LD A,(41012) Read the room display parameter.
58081 LD C,A Keep that parameter.
58082 LD DE,62134 Take the workspace at 62134.
58085 LD A,(58054) Read the script byte at 58054.
58088 CALL RecordResultRoomDisplay Call RecordResultRoomDisplay to record the room display.
58091 OR %00000001 Reset the zero flag.
58093 RET Return.
Prev: 57898 Up: Map Next: 58094