Prev: DEC1 Up: Map Next: DF5B
DEE4: Combine The Result With The Character's Room
Used by the routine at CheckCharacterForRoomGraphics.
Fails the script unless the low three bits of IY+04 are set and IY+02 is above IX+02 by more than the object count of the value in A. A non-zero return means the script step succeeded.
CombineCharacterRoom DEE4 LD B,A Keep the value in A as the count.
None of the bits 07 are set in IY+04?
DEE5 LD A,(IY+$04) Return zero through ParseInputNumber_ReturnZero if none of the bits 07 are set in the byte at IY+04.
DEE8 AND $07
DEEA JP Z,ParseInputNumber_ReturnZero
DEED LD A,(IY+$02) Go to CombineCharacterRoom_ClearResult if the byte at IY+02 is below the byte at IX+02.
DEF0 SUB (IX+$02)
DEF3 JR C,CombineCharacterRoom_ClearResult
DEF5 PUSH AF Save the difference, take the value in B and call StartTheAttributeCount.
DEF6 LD A,B
DEF7 CALL StartTheAttributeCount
DEFA LD B,A Go to CombineCharacterRoom_ClearResult if that difference is below the object count from StartTheAttributeCount.
DEFB POP AF
DEFC SUB B
DEFD JR C,CombineCharacterRoom_ClearResult
DEFF RET NZ Return if that difference is above the count from StartTheAttributeCount.
CombineCharacterRoom_ClearResult DF00 XOR A Clear A.
DF01 RET Return.
DF02 DEFB $6A,$1D,$24,$DF Display record read by ProcessDisplayRecord: flags 6A value 1D handler DF24.
Run by CA64 after the display record at DF02.
DF06 LD IY,($A015) Read the secondary pointer at A015.
DF0A LD IX,($A013) Read the current object.
DF0E LD A,($A035)
DF11 LD (IX+$01),A Store the moved marker.
DF14 LD A,(IY+$0F) Store the character attribute.
DF17 LD (IX+$0F),A
DF1A LD B,A
DF1B LD A,($A034) Read the room display parameter, then call ProcessObjectLocationRecursively to run object location recursively.
DF1E CALL ProcessObjectLocationRecursively
DF21 OR %00000001 Reset the zero flag.
DF23 RET Return.
Reached through the display record at DF02, dispatched by DispatchLookedUpHandlerThird.
DF24 LD A,($A034) Pass the room display parameter in B and the room graphics parameter in A, and carry on at ProcessObjectAttribute_LookObjectRun.
DF27 LD B,A
DF28 LD A,($A035)
DF2B JP ProcessObjectAttribute_LookObjectRun
Reached through the display record at DF40 and E135, dispatched by DispatchLookedUpHandlerThird.
DF2E LD A,($A034) Go to CombineCharacterRoom_TestActionSucceeded if the mother id is FF.
DF31 CALL GetObjectMotherID
DF34 JR Z,CombineCharacterRoom_TestActionSucceeded
DF36 LD HL,$A036 Go to ParseInputNumber_ReturnZero if the containing object is not this character.
DF39 CP (HL)
DF3A JP NZ,ParseInputNumber_ReturnZero
CombineCharacterRoom_TestActionSucceeded DF3D OR %00000001 Reset the zero flag.
DF3F RET Return.
DF40 DEFB $78,$10,$2E,$DF,$80,$40,$00,$00 Display record read by ProcessDisplayRecord: flags 78 value 10 handler DF2E, parameters 80 40 00 00 00.
DF48 DEFB $00
Run by CA64 after the display record at DF40.
DF49 LD A,$01 Take 01 as the room flag.
DF4B LD ($CAAE),A Store the room flag.
DF4E CALL CheckCharacterID Call CheckCharacterID to check the character id.
DF51 RET NZ Return unless the character is Sherlock, 01 or zero.
DF52 CALL PrintObjectDescriptionText Call PrintObjectDescriptionText to print the object's description.
DF55 CALL PrintNewline Call PrintNewline to print a new line.
DF58 OR %00000001 Reset the zero flag.
DF5A RET Return.
Prev: DEC1 Up: Map Next: DF5B