Prev: 41524 Up: Map Next: 41661
41557: Place Amulet Pieces
Used by the routine at 45598.
PlaceAmuletPieces 41557 LD IX,38910 IX=AmuletData.
41561 LD A,(38549) A=38549.
41564 AND %00000111 Keep only bits 0-2.
41566 LD L,A Create an offset.
41567 LD H,0
41569 ADD HL,HL
41570 ADD HL,HL
41571 LD BC,41629
41574 ADD HL,BC HL=Initialisation_Amulet + (A * 2).
41575 EX DE,HL
There are four pieces of the amulet to collect.
41576 LD B,4 B=4.
PlaceAmuletPieces_Loop 41578 PUSH BC Stash the counter on the stack.
41579 LD A,B
41580 ADD A,143
41582 LD (IX+0),A
41585 LD A,(DE)
41586 INC DE
41587 LD (IX+1),A
41590 LD L,A
41591 LD H,0
41593 LD BC,24678 BC=Layout.
41596 ADD HL,BC
41597 LD L,(HL)
41598 LD H,0
41600 ADD HL,HL
41601 ADD HL,HL
41602 ADD HL,HL
41603 LD BC,56428 BC=ObjectLocation.
41606 ADD HL,BC
41607 LD A,(HL)
41608 INC HL
41609 LD (IX+3),A
41612 LD A,(HL)
41613 LD (IX+4),A
41616 LD (IX+5),70
41620 LD BC,12 BC=12.
41623 ADD IX,BC
41625 POP BC Restore the counter from the stack.
41626 DJNZ PlaceAmuletPieces_Loop Decrease counter by one and loop back to PlaceAmuletPieces_Loop until counter is zero.
41628 RET Return.
Initialisation_Amulet 41629 DEFB 67,145,77,203,157,172,45,38
41637 DEFB 225,115,68,45,53,195,77,169
41645 DEFB 138,77,225,82,67,88,57,231
41653 DEFB 89,167,226,145,38,53,203,163
Prev: 41524 Up: Map Next: 41661