Prev: 40227 Up: Map Next: 40337
40257: Routine at 9D41
Used by the routine at 43757.
Each block of amulet data is 11 bytes long.
40257 LD DE,11 DE=0011.
40260 LD HL,38910 HL=AmuletData.
There are four pieces of the amulet.
40263 LD B,4 B=4.
40265 LD A,(HL) A=HL (a byte of amulet data).
40266 INC HL Increment HL by one.
40267 AND A If A is zero, jump to 40294.
40268 JR Z,40294
40270 LD A,(HL) A=HL (a byte of amulet data).
40271 AND %00001111 Keep only bits 0-3.
40273 LD C,A Store the result in C.
40274 LD A,(IX+1) A=IX+1 (current location).
40277 AND %00001111 Keep only bits 0-3.
40279 CP C
40280 JR Z,40299
40282 LD A,(HL)
40283 AND %11110000 Keep only bits 4-7.
40285 LD C,A
40286 LD A,(IX+1) A=IX+1 (current location).
40289 AND %11110000 Keep only bits 4-7.
40291 CP C
40292 JR Z,40317
40294 ADD HL,DE
40295 DJNZ 40265
40297 AND A
40298 RET Return.
40299 INC HL Increment HL by two.
40300 INC HL
40301 LD A,(HL)
40302 DEC HL
40303 DEC HL
40304 SUB (IX+3)
40307 JP P,40312
40310 NEG
40312 CP 16
40314 JR NC,40282
40316 RET Return.
40317 INC HL
40318 INC HL
40319 INC HL
40320 LD A,(HL)
40321 DEC HL
40322 DEC HL
40323 DEC HL
40324 SUB (IX+4)
40327 JP P,40332
40330 NEG
40332 CP 16
40334 JR NC,40294
40336 RET Return.
Prev: 40227 Up: Map Next: 40337