Prev: 52920 Up: Map Next: 52990
52958: Process Room Display Parameter
Resolves special parameter values used in room display scripts to actual game values (current room, character ID, location value).
Input
A Parameter value (245-253 are special values)
Output
A Resolved parameter value
ProcessRoomDisplayParameter 52958 CP 245 Return unchanged if the parameter is not a special value (less than 245).
52960 RET C
52961 CP 254 Return unchanged when the parameter is at least 254.
52963 RET NC
52964 CP 250 Jump ahead to ProcessRoomDisplayParameter_CheckCharacterID if the room is not 250.
52966 JR NZ,ProcessRoomDisplayParameter_CheckCharacterID
52968 LD A,(40918) Read the room id at CurrentRoom_ID into A.
52971 RET Return.
A parameter of 251 is the character being processed.
ProcessRoomDisplayParameter_CheckCharacterID 52972 CP 251 Go to ProcessRoomDisplayParameter_GetLocationValue when the parameter is not the current character (251).
52974 JR NZ,ProcessRoomDisplayParameter_GetLocationValue
52976 LD A,(41014) Load the character being processed.
52979 RET Return.
A parameter of 252 is the high byte of the location value.
ProcessRoomDisplayParameter_GetLocationValue 52980 CP 252 Compare the parameter with 252 and load the high byte of the location value at LocationValue.
52982 LD A,(40920)
52985 RET Z Return if it is 252.
52986 LD A,(40919) Read the location value at LocationValue.
52989 RET Return.
Prev: 52920 Up: Map Next: 52990