Prev: 62043 Up: Map Next: 62141
62047: Adjust Camera Y
Adjust the camera y-coordinate.
Adjust_CameraY 62047 LD C,0 Load C with 0.
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 62049 PUSH HL Stash HL and DE on the stack.
62050 PUSH DE
62051 LD HL,37005 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 62054 LD DE,65522 Load DE with $FFF2.
Stop with carry set when the entity-table terminator (255) is reached.
Adjust_Camera_ScanLoop 62057 LD A,(HL) Fetch this entity's type.
62058 CP 255 Is A equal to 255? If not, jump to Adjust_Camera_CheckEntity.
62060 JR NZ,Adjust_Camera_CheckEntity
62062 POP DE Restore DE and HL from the stack.
62063 POP HL
62064 SCF Signal success.
62065 RET Return.
Test whether this solid, same-room entity overlaps the camera subject.
Adjust_Camera_CheckEntity 62066 LD A,(HL) Re-fetch this entity's type.
62067 OR A Is the next script byte zero? If so, jump to Adjust_Camera_NextEntity.
62068 JR Z,Adjust_Camera_NextEntity
62070 BIT 7,A Is bit 7 of A set? If so, jump to Adjust_Camera_NextEntity.
62072 JR NZ,Adjust_Camera_NextEntity
62074 CP (IX+0) Does A match this entity's type? If so, jump to Adjust_Camera_NextEntity.
62077 JR Z,Adjust_Camera_NextEntity
62079 PUSH HL Stash HL on the stack.
62080 INC HL Advance the camera-table pointer in HL by one byte.
62081 LD A,(HL) Fetch this entity's flags byte.
62082 AND %00000010 Keep only bit 1 of those flags.
62084 JR Z,Adjust_Camera_SkipEntity If it was clear, skip this entity at Adjust_Camera_SkipEntity.
62086 BIT 5,(HL) Is bit 5 of the byte at HL set? If so, jump to Adjust_Camera_SkipEntity.
62088 JR NZ,Adjust_Camera_SkipEntity
62090 INC HL Advance HL past three entity fields onto the room byte.
62091 INC HL
62092 INC HL
62093 LD A,(HL) Fetch this entity's room.
62094 ADD A,C A+=C.
62095 CP (IX+4) Does A match this entity's room? If not, jump to Adjust_Camera_SkipEntity.
62098 JR NZ,Adjust_Camera_SkipEntity
62100 INC HL Advance the camera-table pointer in HL by one byte.
62101 LD A,(IX+6) Load A with the current entity's y-extent.
62104 CP (HL) Is A less than the byte at HL? If so, jump to Adjust_Camera_SkipEntity.
62105 JR C,Adjust_Camera_SkipEntity
62107 INC HL Advance the camera-table pointer in HL by one byte.
62108 LD A,(HL) Fetch the next script byte.
62109 CP (IX+5) Is A less than this entity's y-coordinate? If so, jump to Adjust_Camera_SkipEntity.
62112 JR C,Adjust_Camera_SkipEntity
62114 INC HL Advance the camera-table pointer in HL by one byte.
62115 LD A,(IX+8) Load A with the current entity's x-extent.
62118 CP (HL) Is A less than the byte at HL? If so, jump to Adjust_Camera_SkipEntity.
62119 JR C,Adjust_Camera_SkipEntity
62121 INC HL Advance the camera-table pointer in HL by one byte.
62122 LD A,(HL) Fetch the next script byte.
62123 CP (IX+7) Is A less than this entity's x-coordinate? If so, jump to Adjust_Camera_SkipEntity.
62126 JR C,Adjust_Camera_SkipEntity
62128 POP HL Restore HL from the stack.
62129 XOR A Clear A to 0.
62130 LD (29354),HL Store HL in the last-collided entity pointer (Pointer_LastCollidedEntity).
62133 LD A,(HL) Fetch the next script byte.
62134 POP DE Restore DE and HL from the stack.
62135 POP HL
62136 RET Return.
Skip a non-blocking camera entity and keep scanning.
Adjust_Camera_SkipEntity 62137 POP HL Restore HL from the stack.
Step to the previous entity record and continue the camera scan.
Adjust_Camera_NextEntity 62138 ADD HL,DE HL+=DE.
62139 JR Adjust_Camera_ScanLoop Jump to Adjust_Camera_ScanLoop to continue the loop.
Prev: 62043 Up: Map Next: 62141