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-FE 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 if the parameter is not a special value (greater than FE).
CEE3 RET NC
CEE4 CP $FA Jump to ProcessRoomDisplayParameter_CheckCharacterID if not room parameter (FA).
CEE6 JR NZ,ProcessRoomDisplayParameter_CheckCharacterID
CEE8 LD A,($9FD6) Return the current room ID (A=*CurrentRoom_ID).
CEEB RET
ProcessRoomDisplayParameter_CheckCharacterID CEEC CP $FB Jump to ProcessRoomDisplayParameter_GetLocationValue if not character ID parameter (FB).
CEEE JR NZ,ProcessRoomDisplayParameter_GetLocationValue
CEF0 LD A,($A036) Return the current character ID (A=*CurrentCharacter_ID).
CEF3 RET
ProcessRoomDisplayParameter_GetLocationValue CEF4 CP $FC Return the location value (high byte) if parameter is FC otherwise return the location value (low byte).
CEF6 LD A,($9FD8)
CEF9 RET Z
CEFA LD A,($9FD7)
CEFD RET
Prev: CEB8 Up: Map Next: CEFE