Prev: CEB8 Up: Map Next: CEFE
CEDE: 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 (F5-FD are special values)
Output
A Resolved parameter value
ProcessRoomDisplayParameter CEDE CP $F5 Return unchanged if the parameter is not a special value (less than F5).
CEE0 RET C
CEE1 CP $FE Return unchanged when the parameter is at least FE.
CEE3 RET NC
CEE4 CP $FA Jump ahead to ProcessRoomDisplayParameter_CheckCharacterID if the room is not FA.
CEE6 JR NZ,ProcessRoomDisplayParameter_CheckCharacterID
CEE8 LD A,($9FD6) Read the room id at CurrentRoom_ID into A.
CEEB RET Return.
A parameter of FB is the character being processed.
ProcessRoomDisplayParameter_CheckCharacterID CEEC CP $FB Go to ProcessRoomDisplayParameter_GetLocationValue when the parameter is not the current character (FB).
CEEE JR NZ,ProcessRoomDisplayParameter_GetLocationValue
CEF0 LD A,($A036) Load the character being processed.
CEF3 RET Return.
A parameter of FC is the high byte of the location value.
ProcessRoomDisplayParameter_GetLocationValue CEF4 CP $FC Compare the parameter with FC and load the high byte of the location value at LocationValue.
CEF6 LD A,($9FD8)
CEF9 RET Z Return if it is FC.
CEFA LD A,($9FD7) Read the location value at LocationValue.
CEFD RET Return.
Prev: CEB8 Up: Map Next: CEFE