Prev: A921 Up: Map Next: AA30
A92C: Handler: Move Non-Player Characters
Used by the routine at 81AE.
Handler_Move_Characters A92C PUSH IY Stash IY on the stack.
A92E LD A,(IY+$0F) Write IY+0F to TempStore_Room.
A931 LD ($B951),A
A934 LD IY,$BC67 IY=FrameId_Wally.
A938 LD A,($B55F) B=(*Flag_DemoMode)+04.
A93B ADD A,$04
A93D LD B,A
Handler_Move_Characters_0 A93E PUSH BC Stash BC on the stack.
A93F LD A,($B55F) If Flag_DemoMode is not zero jump to Handler_Move_Characters_1.
A942 OR A
A943 JR NZ,Handler_Move_Characters_1
A945 CALL Character_Active Call Character_Active.
A948 JR NZ,Handler_Move_Characters_1
A94A INC IY Increment IY by one.
Handler_Move_Characters_1 A94C LD A,(IY+$0F) Compare the current room (IY+0F) against (IY+5A) jump to Handler_Move_Characters_2 if they are different.
A94F CP (IY+$5A)
A952 JR NZ,Handler_Move_Characters_2
A954 LD A,(IY-$14)
A957 OR A
A958 JP NZ,Handler_Move_Characters_6
Handler_Move_Characters_2 A95B CALL $AFC4 Call AFC4.
A95E LD A,(IY+$46)
A961 OR A
A962 JR Z,Handler_Move_Characters_3
A964 CALL $B1B9 Call B1B9.
A967 JP Handler_Move_Characters_5 Jump to Handler_Move_Characters_5.
Handler_Move_Characters_3 A96A LD A,(IY+$37) A=*IY+N$37.
A96D OR A If A is zero, jump to Handler_Move_Characters_4.
A96E JR Z,Handler_Move_Characters_4
A970 CALL $B197 Call B197.
A973 JR Handler_Move_Characters_5 Jump to Handler_Move_Characters_5.
Handler_Move_Characters_4 A975 LD A,(IY+$64) E=(*IY+64)*02.
A978 ADD A,A
A979 LD E,A
A97A LD D,$00 D=00.
A97C LD HL,$AAA0 HL=Table_Jump+DE.
A97F ADD HL,DE
A980 LD E,(HL) E=*HL.
A981 INC HL Increment HL by one.
A982 LD D,(HL) D=*HL.
A983 EX DE,HL Switch the DE and HL registers.
A984 LD DE,$A989 DE=Handler_Move_Characters_5.
A987 PUSH DE Stash DE on the stack.
A988 JP (HL) Jump to *HL.
TODO.
Handler_Move_Characters_5 A989 POP BC Restore BC from the stack.
A98A INC IY Increment IY by one.
A98C DJNZ Handler_Move_Characters_0
A98E POP IY Restore IY from the stack.
A990 RET Return.
Handler_Move_Characters_6 A991 CALL $AFC4 Call AFC4.
A994 LD A,(IY+$46)
A997 OR A
A998 JR Z,Handler_Move_Characters_7
A99A CALL $B1B9
A99D JP Handler_Move_Characters_5
Handler_Move_Characters_7 A9A0 LD A,(IY+$37)
A9A3 OR A
A9A4 JR Z,Handler_Move_Characters_8
A9A6 CALL $B197
A9A9 JP Handler_Move_Characters_5
Handler_Move_Characters_8 A9AC LD A,(IY+$0A)
A9AF CP $98
A9B1 JR Z,Handler_Move_Characters_11
A9B3 LD A,(IY+$05)
A9B6 CP $78
A9B8 JR NC,Handler_Move_Characters_10
A9BA LD (IY+$3C),$01
Handler_Move_Characters_9 A9BE CALL $B288
A9C1 JP Handler_Move_Characters_5
Handler_Move_Characters_10 A9C4 LD (IY+$3C),$FF
A9C8 JR Handler_Move_Characters_9
Handler_Move_Characters_11 A9CA LD B,(IY-$0F)
A9CD CALL Handler_ItemsCurrentRoom
A9D0 INC HL
A9D1 LD A,(HL)
A9D2 PUSH AF
A9D3 LD A,(IY+$05)
A9D6 CP (HL)
A9D7 JR NC,Handler_Move_Characters_12
A9D9 LD (IY+$3C),$01
A9DD JR Handler_Move_Characters_13
Handler_Move_Characters_12 A9DF LD (IY+$3C),$FF
Handler_Move_Characters_13 A9E3 CALL $B288
A9E6 POP AF
A9E7 CP (IY+$05)
A9EA JP NZ,Handler_Move_Characters_5
A9ED LD B,(IY-$0F)
A9F0 CALL Handler_PickUpObjects
A9F3 LD (IY-$14),$00
A9F7 LD E,(IY+$78)
A9FA LD D,(IY+$7D)
A9FD LD H,$00
A9FF INC (IY-$05)
AA02 LD L,(IY-$05)
AA05 ADD HL,DE
AA06 LD A,(HL)
AA07 CP $FF
AA09 JR NZ,Handler_Move_Characters_14
AA0B EX DE,HL
AA0C LD (IY-$05),$00
Handler_Move_Characters_14 AA10 LD E,(HL)
AA11 CALL $AE8A Call AE8A.
AA14 LD A,B
AA15 OR A
AA16 JR NZ,Handler_Move_Characters_16
Handler_Move_Characters_15 AA18 CALL $AED7
AA1B LD C,$00
AA1D LD D,A
AA1E LD A,D
AA1F CP (IY+$0F)
AA22 JR Z,Handler_Move_Characters_15
Handler_Move_Characters_16 AA24 LD (IY+$5A),D Write D to IY+5A.
AA27 LD (IY-$0F),C Write C to IY+0F.
AA2A CALL $ADBA Call ADBA.
AA2D JP Handler_Move_Characters_5 Jump to Handler_Move_Characters_5.
Prev: A921 Up: Map Next: AA30