Prev: A234 Up: Map Next: A2BD
A255: Place Amulet Pieces
Used by the routine at B21E.
PlaceAmuletPieces A255 LD IX,$97FE IX=AmuletData.
A259 LD A,($9695) A=9695.
A25C AND %00000111 Keep only bits 0-2.
A25E LD L,A Create an offset.
A25F LD H,$00
A261 ADD HL,HL
A262 ADD HL,HL
A263 LD BC,$A29D
A266 ADD HL,BC HL=Initialisation_Amulet + (A * 02).
A267 EX DE,HL
There are four pieces of the amulet to collect.
A268 LD B,$04 B=04.
PlaceAmuletPieces_Loop A26A PUSH BC Stash the counter on the stack.
A26B LD A,B
A26C ADD A,$8F
A26E LD (IX+$00),A
A271 LD A,(DE)
A272 INC DE
A273 LD (IX+$01),A
A276 LD L,A
A277 LD H,$00
A279 LD BC,$6066 BC=Layout.
A27C ADD HL,BC
A27D LD L,(HL)
A27E LD H,$00
A280 ADD HL,HL
A281 ADD HL,HL
A282 ADD HL,HL
A283 LD BC,$DC6C BC=ObjectLocation.
A286 ADD HL,BC
A287 LD A,(HL)
A288 INC HL
A289 LD (IX+$03),A
A28C LD A,(HL)
A28D LD (IX+$04),A
A290 LD (IX+$05),$46
A294 LD BC,$000C BC=0C.
A297 ADD IX,BC
A299 POP BC Restore the counter from the stack.
A29A DJNZ PlaceAmuletPieces_Loop Decrease counter by one and loop back to PlaceAmuletPieces_Loop until counter is zero.
A29C RET Return.
Initialisation_Amulet A29D DEFB $43,$91,$4D,$CB,$9D,$AC,$2D,$26
A2A5 DEFB $E1,$73,$44,$2D,$35,$C3,$4D,$A9
A2AD DEFB $8A,$4D,$E1,$52,$43,$58,$39,$E7
A2B5 DEFB $59,$A7,$E2,$91,$26,$35,$CB,$A3
Prev: A234 Up: Map Next: A2BD