Prev: 43297 Up: Map Next: 43568
43308: Handler: Move Non-Player Characters
Used by the routine at 33198.
Handler_Move_Characters 43308 PUSH IY Stash IY on the stack.
43310 LD A,(IY+15) Write IY+15 to TempStore_Room.
43313 LD (47441),A
43316 LD IY,48231 IY=FrameId_Wally.
43320 LD A,(46431) B=(*Flag_DemoMode)+4.
43323 ADD A,4
43325 LD B,A
Handler_Move_Characters_0 43326 PUSH BC Stash BC on the stack.
43327 LD A,(46431) If Flag_DemoMode is not zero jump to Handler_Move_Characters_1.
43330 OR A
43331 JR NZ,Handler_Move_Characters_1
43333 CALL Character_Active Call Character_Active.
43336 JR NZ,Handler_Move_Characters_1
43338 INC IY Increment IY by one.
Handler_Move_Characters_1 43340 LD A,(IY+15) Compare the current room (IY+15) against (IY+90) jump to Handler_Move_Characters_2 if they are different.
43343 CP (IY+90)
43346 JR NZ,Handler_Move_Characters_2
43348 LD A,(IY-20)
43351 OR A
43352 JP NZ,Handler_Move_Characters_6
Handler_Move_Characters_2 43355 CALL 44996 Call 44996.
43358 LD A,(IY+70)
43361 OR A
43362 JR Z,Handler_Move_Characters_3
43364 CALL 45497 Call 45497.
43367 JP Handler_Move_Characters_5 Jump to Handler_Move_Characters_5.
Handler_Move_Characters_3 43370 LD A,(IY+55) A=*IY+N$37.
43373 OR A If A is zero, jump to Handler_Move_Characters_4.
43374 JR Z,Handler_Move_Characters_4
43376 CALL 45463 Call 45463.
43379 JR Handler_Move_Characters_5 Jump to Handler_Move_Characters_5.
Handler_Move_Characters_4 43381 LD A,(IY+100) E=(*IY+100)*2.
43384 ADD A,A
43385 LD E,A
43386 LD D,0 D=0.
43388 LD HL,43680 HL=Table_Jump+DE.
43391 ADD HL,DE
43392 LD E,(HL) E=*HL.
43393 INC HL Increment HL by one.
43394 LD D,(HL) D=*HL.
43395 EX DE,HL Switch the DE and HL registers.
43396 LD DE,43401 DE=Handler_Move_Characters_5.
43399 PUSH DE Stash DE on the stack.
43400 JP (HL) Jump to *HL.
TODO.
Handler_Move_Characters_5 43401 POP BC Restore BC from the stack.
43402 INC IY Increment IY by one.
43404 DJNZ Handler_Move_Characters_0
43406 POP IY Restore IY from the stack.
43408 RET Return.
Handler_Move_Characters_6 43409 CALL 44996 Call 44996.
43412 LD A,(IY+70)
43415 OR A
43416 JR Z,Handler_Move_Characters_7
43418 CALL 45497
43421 JP Handler_Move_Characters_5
Handler_Move_Characters_7 43424 LD A,(IY+55)
43427 OR A
43428 JR Z,Handler_Move_Characters_8
43430 CALL 45463
43433 JP Handler_Move_Characters_5
Handler_Move_Characters_8 43436 LD A,(IY+10)
43439 CP 152
43441 JR Z,Handler_Move_Characters_11
43443 LD A,(IY+5)
43446 CP 120
43448 JR NC,Handler_Move_Characters_10
43450 LD (IY+60),1
Handler_Move_Characters_9 43454 CALL 45704
43457 JP Handler_Move_Characters_5
Handler_Move_Characters_10 43460 LD (IY+60),255
43464 JR Handler_Move_Characters_9
Handler_Move_Characters_11 43466 LD B,(IY-15)
43469 CALL Handler_ItemsCurrentRoom
43472 INC HL
43473 LD A,(HL)
43474 PUSH AF
43475 LD A,(IY+5)
43478 CP (HL)
43479 JR NC,Handler_Move_Characters_12
43481 LD (IY+60),1
43485 JR Handler_Move_Characters_13
Handler_Move_Characters_12 43487 LD (IY+60),255
Handler_Move_Characters_13 43491 CALL 45704
43494 POP AF
43495 CP (IY+5)
43498 JP NZ,Handler_Move_Characters_5
43501 LD B,(IY-15)
43504 CALL Handler_PickUpObjects
43507 LD (IY-20),0
43511 LD E,(IY+120)
43514 LD D,(IY+125)
43517 LD H,0
43519 INC (IY-5)
43522 LD L,(IY-5)
43525 ADD HL,DE
43526 LD A,(HL)
43527 CP 255
43529 JR NZ,Handler_Move_Characters_14
43531 EX DE,HL
43532 LD (IY-5),0
Handler_Move_Characters_14 43536 LD E,(HL)
43537 CALL 44682 Call 44682.
43540 LD A,B
43541 OR A
43542 JR NZ,Handler_Move_Characters_16
Handler_Move_Characters_15 43544 CALL 44759
43547 LD C,0
43549 LD D,A
43550 LD A,D
43551 CP (IY+15)
43554 JR Z,Handler_Move_Characters_15
Handler_Move_Characters_16 43556 LD (IY+90),D Write D to IY+90.
43559 LD (IY-15),C Write C to IY+15.
43562 CALL 44474 Call 44474.
43565 JP Handler_Move_Characters_5 Jump to Handler_Move_Characters_5.
Prev: 43297 Up: Map Next: 43568