Prev: B60D Up: Map Next: B746
B626: routine28
Used by the routines at routine14, lightning_spell, routine20, routine35 and routine74.
routine28 B626 XOR A
B627 LD ($5C90),A
B62A LD ($5C91),A
B62D LD (unknown49),A
B630 LD A,(unknown48)
B633 OR A
B634 JR Z,routine28_5
B636 CP $01
B638 JR NZ,routine28_0
B63A LD (unknown54),A
B63D LD A,$2A
B63F LD (unknown50),A
B642 LD A,$47
B644 LD ($5C8F),A
routine28_0 B647 LD A,(unknown48)
B64A CP $02
B64C JR NZ,routine28_1
B64E LD (unknown54),A
B651 LD A,$0E
B653 LD (unknown50),A
B656 LD A,$46
B658 LD ($5C8F),A
routine28_1 B65B LD A,(unknown48)
B65E CP $03
B660 JR NZ,routine28_2
B662 LD (unknown54),A
B665 LD A,$3C
B667 LD (unknown50),A
B66A LD A,$45
B66C LD ($5C8F),A
routine28_2 B66F LD A,(unknown48)
B672 CP $04
B674 JR NZ,routine28_3
B676 LD A,$03
B678 LD (unknown54),A
B67B LD A,$46
B67D LD ($5C8F),A
B680 LD A,$64
B682 LD (unknown50),A
routine28_3 B685 CP $05
B687 JR NZ,routine28_4
B689 LD A,$03
B68B LD (unknown54),A
B68E LD A,$46
B690 LD ($5C8F),A
B693 LD A,$08
B695 LD (unknown50),A
routine28_4 B698 CP $06
B69A JR NZ,routine28_5
B69C LD A,$03
B69E LD (unknown54),A
B6A1 LD A,$47
B6A3 LD ($5C8F),A
B6A6 LD A,$64
B6A8 LD (unknown50),A
routine28_5 B6AB DI
B6AC XOR A
B6AD LD (unknown51),A
B6B0 EXX
B6B1 PUSH HL
B6B2 EXX
B6B3 LD HL,(D_ADD)
B6B6 CALL routine27
B6B9 LD ($5C7D),HL
B6BC LD HL,(object_table_entry_pointer)
B6BF CALL routine27
B6C2 LD (unknown52),HL
B6C5 EX DE,HL
B6C6 LD HL,($5C7D)
B6C9 LD A,H
B6CA CP D
B6CB JR C,routine28_6
B6CD SUB D
B6CE LD B,A
B6CF LD D,$FF
B6D1 JR routine28_7
routine28_6 B6D3 LD A,D
B6D4 SUB H
B6D5 LD B,A
B6D6 LD D,$01
routine28_7 B6D8 LD A,L
B6D9 CP E
B6DA JR C,routine28_8
B6DC SUB E
B6DD LD C,A
B6DE LD E,$FF
B6E0 JR routine28_9
routine28_8 B6E2 LD A,E
B6E3 SUB L
B6E4 LD C,A
B6E5 LD E,$01
routine28_9 B6E7 LD A,C
B6E8 CP B
B6E9 JR NC,routine28_10
B6EB LD L,C
B6EC PUSH DE
B6ED XOR A
B6EE LD E,A
B6EF JR routine28_11
routine28_10 B6F1 OR B
B6F2 JR Z,routine28_17
B6F4 LD L,B
B6F5 LD B,C
B6F6 PUSH DE
B6F7 LD D,$00
routine28_11 B6F9 LD H,B
B6FA LD A,B
B6FB RRA
routine28_12 B6FC ADD A,L
B6FD JR C,routine28_13
B6FF CP H
B700 JR C,routine28_14
routine28_13 B702 SUB H
B703 LD C,A
B704 EXX
B705 POP BC
B706 PUSH BC
B707 JR routine28_15
routine28_14 B709 LD C,A
B70A PUSH DE
B70B EXX
B70C POP BC
routine28_15 B70D LD HL,($5C7D)
B710 LD A,B
B711 ADD A,H
B712 LD B,A
B713 LD A,C
B714 INC A
B715 ADD A,L
B716 JR C,routine28_18
routine28_16 B718 DEC A
B719 LD C,A
B71A CALL routine29
B71D EXX
B71E LD A,C
B71F DJNZ routine28_12
B721 POP DE
routine28_17 B722 EXX
B723 POP HL
B724 EXX
B725 EI
B726 LD A,$03
B728 LD ($5C91),A
B72B LD A,$FF
B72D LD ($5C90),A
B730 RET
routine28_18 B731 JR Z,routine28_16
This entry point is used by the routine at routine34.
routine28_19 B733 LD ($5C7D),BC
B737 CALL $22AA
B73A LD B,A
B73B INC B
B73C LD A,$FE
routine28_20 B73E RRCA
B73F DJNZ routine28_20
B741 LD B,A
B742 LD A,(HL)
B743 AND B
B744 LD (HL),A
B745 RET
Prev: B60D Up: Map Next: B746