Prev: F25B Up: Map Next: F2BD
F25F: Adjust Camera Y
Adjust the camera y-coordinate.
Adjust_CameraY F25F LD C,$00 Load C with 00.
This entry point is used by the routine at Adjust_CameraX.
Shared camera adjust: scan entities backward from the weight-chain slot.
Adjust_Camera_Common F261 PUSH HL Stash HL and DE on the stack.
F262 PUSH DE
F263 LD HL,$908D Point HL at the weight-chain entity (StateData_Complex_30).
This entry point is used by the routine at Clamp_CameraPosition.
Walk entity records with stride $FFF2 looking for a camera blocker.
Adjust_Camera_ScanEntities F266 LD DE,$FFF2 Load DE with $FFF2.
Stop with carry set when the entity-table terminator (FF) is reached.
Adjust_Camera_ScanLoop F269 LD A,(HL) Fetch this entity's type.
F26A CP $FF Is A equal to FF? If not, jump to Adjust_Camera_CheckEntity.
F26C JR NZ,Adjust_Camera_CheckEntity
F26E POP DE Restore DE and HL from the stack.
F26F POP HL
F270 SCF Signal success.
F271 RET Return.
Test whether this solid, same-room entity overlaps the camera subject.
Adjust_Camera_CheckEntity F272 LD A,(HL) Re-fetch this entity's type.
F273 OR A Is the next script byte zero? If so, jump to Adjust_Camera_NextEntity.
F274 JR Z,Adjust_Camera_NextEntity
F276 BIT 7,A Is bit 07 of A set? If so, jump to Adjust_Camera_NextEntity.
F278 JR NZ,Adjust_Camera_NextEntity
F27A CP (IX+$00) Does A match this entity's type? If so, jump to Adjust_Camera_NextEntity.
F27D JR Z,Adjust_Camera_NextEntity
F27F PUSH HL Stash HL on the stack.
F280 INC HL Advance the camera-table pointer in HL by one byte.
F281 LD A,(HL) Fetch this entity's flags byte.
F282 AND %00000010 Keep only bit 01 of those flags.
F284 JR Z,Adjust_Camera_SkipEntity If it was clear, skip this entity at Adjust_Camera_SkipEntity.
F286 BIT 5,(HL) Is bit 05 of the byte at HL set? If so, jump to Adjust_Camera_SkipEntity.
F288 JR NZ,Adjust_Camera_SkipEntity
F28A INC HL Advance HL past three entity fields onto the room byte.
F28B INC HL
F28C INC HL
F28D LD A,(HL) Fetch this entity's room.
F28E ADD A,C A+=C.
F28F CP (IX+$04) Does A match this entity's room? If not, jump to Adjust_Camera_SkipEntity.
F292 JR NZ,Adjust_Camera_SkipEntity
F294 INC HL Advance the camera-table pointer in HL by one byte.
F295 LD A,(IX+$06) Load A with the current entity's y-extent.
F298 CP (HL) Is A less than the byte at HL? If so, jump to Adjust_Camera_SkipEntity.
F299 JR C,Adjust_Camera_SkipEntity
F29B INC HL Advance the camera-table pointer in HL by one byte.
F29C LD A,(HL) Fetch the next script byte.
F29D CP (IX+$05) Is A less than this entity's y-coordinate? If so, jump to Adjust_Camera_SkipEntity.
F2A0 JR C,Adjust_Camera_SkipEntity
F2A2 INC HL Advance the camera-table pointer in HL by one byte.
F2A3 LD A,(IX+$08) Load A with the current entity's x-extent.
F2A6 CP (HL) Is A less than the byte at HL? If so, jump to Adjust_Camera_SkipEntity.
F2A7 JR C,Adjust_Camera_SkipEntity
F2A9 INC HL Advance the camera-table pointer in HL by one byte.
F2AA LD A,(HL) Fetch the next script byte.
F2AB CP (IX+$07) Is A less than this entity's x-coordinate? If so, jump to Adjust_Camera_SkipEntity.
F2AE JR C,Adjust_Camera_SkipEntity
F2B0 POP HL Restore HL from the stack.
F2B1 XOR A Clear A to 00.
F2B2 LD ($72AA),HL Store HL in the last-collided entity pointer (Pointer_LastCollidedEntity).
F2B5 LD A,(HL) Fetch the next script byte.
F2B6 POP DE Restore DE and HL from the stack.
F2B7 POP HL
F2B8 RET Return.
Skip a non-blocking camera entity and keep scanning.
Adjust_Camera_SkipEntity F2B9 POP HL Restore HL from the stack.
Step to the previous entity record and continue the camera scan.
Adjust_Camera_NextEntity F2BA ADD HL,DE HL+=DE.
F2BB JR Adjust_Camera_ScanLoop Jump to Adjust_Camera_ScanLoop to continue the loop.
Prev: F25B Up: Map Next: F2BD