Prev: 55871 Up: Map Next: 56265
56069: Handler: Pendulum
Used by the routine at Dispatch_Handlers.
Rooms 9-11 share a swinging pendulum.
Handler_PendulumRooms 56069 LD A,(25762) Return if *CurrentRoom is 12 or higher.
56072 CP 12
56074 RET NC Return if *CurrentRoom is lower than 9.
56075 CP 9
56077 RET C
56078 CP 10 Jump to Handler_Pendulum if the room is 10 or 11.
56080 JR NC,Handler_Pendulum
56082 LD A,(25764) A=*Player-4.
56085 SUB 4
56087 LD B,224 B=224.
Handler_PendulumRooms_NextRoom 56089 SUB 6 Subtract 6 until A is negative, decreasing B by two each pass.
56091 BIT 7,A
56093 JR NZ,Handler_Pendulum_DrawPair
56095 DEC B
56096 DEC B
56097 JR Handler_PendulumRooms_NextRoom
Handler_Pendulum_DrawPair 56099 LD C,B C=B.
This entry point is used by the routine at Handler_CarriedObject.
Draw one pendulum pair.
Draw_Pendulum 56100 LD A,71 Write WHITE (BRIGHT) to *ATTR_T.
56102 LD (23695),A
56105 PUSH BC Draw the first bob at 1820.
56106 LD A,B
56107 LD BC,4628
56110 LD DE,258
56113 CALL JumpTable_PrintSprite
56116 POP BC
56117 LD A,C Jump to JumpTable_PrintSprite for the second bob at 1816.
56118 LD BC,4624
56121 LD DE,258
56124 JP JumpTable_PrintSprite
This entry point is used by the routines at Handler_Player and Handler_Actors.
Test the player against one actor pointed to by IY.
Test_ActorCollision 56127 LD A,(IY+8) Jump to Test_ActorCollision_Vertical if the actor is moving vertically.
56130 OR A
56131 JR NZ,Test_ActorCollision_Vertical
56133 LD A,7 Call Actor_Reverse if the actor lines up horizontally.
56135 CP (IY+3)
56138 JR NZ,Test_ActorCollision_Bounds
56140 LD A,(IY+1)
56143 CP (IY+6)
56146 CALL Z,Actor_Reverse Jump to Test_ActorCollision_Bounds.
56149 JR Test_ActorCollision_Bounds
Test_ActorCollision_Vertical 56151 LD A,7 Call Actor_Reverse if the actor lines up vertically.
56153 CP (IY+2)
56156 JR NZ,Test_ActorCollision_Bounds
56158 LD A,(IY+0)
56161 CP (IY+5)
56164 CALL Z,Actor_Reverse
Test_ActorCollision_Bounds 56167 LD A,(25616) Return if *Player_JumpTimer is set.
56170 OR A
56171 RET NZ
56172 LD A,(IY+1) Convert the actor row and fine-Y into a pixel row.
56175 ADD A,A
56176 ADD A,A
56177 ADD A,A
56178 ADD A,(IY+3)
56181 LD C,A
56182 LD A,(25767) Convert the player row the same way and return unless the difference is less than 4.
56185 LD B,A
56186 LD A,(25765)
56189 SUB 3
56191 ADD A,A
56192 ADD A,A
56193 ADD A,A
56194 ADD A,B
56195 SUB C
56196 CP 4
56198 RET NC
56199 LD D,A Convert the actor column and fine-X into a pixel column.
56200 LD A,(IY+0)
56203 DEC A
56204 DEC A
56205 ADD A,A
56206 ADD A,A
56207 ADD A,A
56208 ADD A,(IY+2)
56211 LD B,A
56212 LD A,(25673) Compare the player footprint at Player_Footprint and return unless the ranges overlap.
56215 LD C,A
56216 LD A,(IY+4)
56219 ADD A,A
56220 ADD A,A
56221 ADD A,A
56222 ADD A,C
56223 DEC A
56224 LD (56237),A
56227 SUB C
56228 LD C,A
56229 INC C
56230 LD A,(25672)
56233 ADD A,C
56234 SUB B
56235 DEC A
56236 CP 200
56238 RET NC
56239 LD A,(IY+8) Store the actor state in *Player_StoredState.
56242 LD (25772),A
56245 LD A,3 A=3.
56247 LD (25652),A Write the actor pointer to *Pointer_CollidedActor.
56250 LD A,(IY+9)
56253 OR A
56254 JR Z,Handler_PendulumRooms_StoreActor
56256 SUB D
Handler_PendulumRooms_StoreActor 56257 LD (25773),A Write the actor pointer to *Pointer_CollidedActor.
56260 LD (25675),IY
56264 RET
Prev: 55871 Up: Map Next: 56265