Prev: 9D23 Up: Map Next: 9D91
9D41: Routine at 9D41
Used by the routine at AAED.
Each block of amulet data is 0B bytes long.
9D41 LD DE,$000B DE=000B.
9D44 LD HL,$97FE HL=AmuletData.
There are four pieces of the amulet.
9D47 LD B,$04 B=04.
9D49 LD A,(HL) A=HL (a byte of amulet data).
9D4A INC HL Increment HL by one.
9D4B AND A If A is zero, jump to 9D66.
9D4C JR Z,$9D66
9D4E LD A,(HL) A=HL (a byte of amulet data).
9D4F AND %00001111 Keep only bits 0-3.
9D51 LD C,A Store the result in C.
9D52 LD A,(IX+$01) A=IX+01 (current location).
9D55 AND %00001111 Keep only bits 0-3.
9D57 CP C
9D58 JR Z,$9D6B
9D5A LD A,(HL)
9D5B AND %11110000 Keep only bits 4-7.
9D5D LD C,A
9D5E LD A,(IX+$01) A=IX+01 (current location).
9D61 AND %11110000 Keep only bits 4-7.
9D63 CP C
9D64 JR Z,$9D7D
9D66 ADD HL,DE
9D67 DJNZ $9D49
9D69 AND A
9D6A RET Return.
9D6B INC HL Increment HL by two.
9D6C INC HL
9D6D LD A,(HL)
9D6E DEC HL
9D6F DEC HL
9D70 SUB (IX+$03)
9D73 JP P,$9D78
9D76 NEG
9D78 CP $10
9D7A JR NC,$9D5A
9D7C RET Return.
9D7D INC HL
9D7E INC HL
9D7F INC HL
9D80 LD A,(HL)
9D81 DEC HL
9D82 DEC HL
9D83 DEC HL
9D84 SUB (IX+$04)
9D87 JP P,$9D8C
9D8A NEG
9D8C CP $10
9D8E JR NC,$9D66
9D90 RET Return.
Prev: 9D23 Up: Map Next: 9D91