Prev: 9531 Up: Map Next: 9654
95B6: Routine at 95B6
Used by the routine at B1A4.
95B6 CALL $91BB Call 91BB.
95B9 PUSH HL Stash HL on the stack.
95BA LD DE,$7000 DE=TerrainData_Active.
95BD EX DE,HL Switch the DE and HL registers.
95BE ADD HL,DE HL=HL+DE.
95BF BIT 3,(HL)
95C1 JR Z,$95C7
95C3 LD (HL),$0A Write 0A to HL. udg63166_67x4
95C5 JR $95C9 Jump to 95C9.
95C7 LD (HL),$08 Write 08 to HL. udg63150_67x4
95C9 INC DE
95CA LD A,D
95CB AND %00000011 Keep only bits 0-1.
95CD LD D,A
95CE LD HL,$7000 HL=TerrainData_Active.
95D1 ADD HL,DE HL=HL+DE.
95D2 BIT 3,(HL)
95D4 JR Z,$95DA
95D6 LD (HL),$0A Write 0A to HL. udg63166_67x4
95D8 JR $95DC Jump to 95DC.
95DA LD (HL),$09 Write 09 to HL. udg63158_67x4
95DC CALL $98AE
95DF JP NZ,$9652
95E2 LD A,H
95E3 SUB $08
95E5 LD H,A
95E6 EX (SP),HL
95E7 LD A,H
95E8 AND %00011111 Keep only bits 0-4.
95EA LD H,A
95EB LD DE,$7000 DE=TerrainData_Active.
95EE EX DE,HL
95EF ADD HL,DE
95F0 EX DE,HL
95F1 EX (SP),HL
95F2 LD A,($607A)
95F5 AND $07
95F7 JR NZ,$95FA
95F9 INC HL
95FA PUSH HL
95FB LD A,(DE)
95FC LD L,A
95FD LD H,$00
95FF LD DE,$F66E
9602 ADD HL,HL
9603 ADD HL,HL
9604 ADD HL,HL
9605 ADD HL,DE
9606 EX DE,HL
9607 EXX
9608 LD A,($607A)
960B NEG
960D AND $07
960F LD C,A
9610 EXX
9611 POP HL
9612 PUSH HL
9613 LD B,$08
9615 CALL $9632
9618 POP HL
9619 EX (SP),HL
961A INC HL
961B LD A,H
961C AND $03
961E LD H,A
961F LD DE,$7000
9622 ADD HL,DE
9623 LD L,(HL)
9624 LD H,$00
9626 ADD HL,HL
9627 ADD HL,HL
9628 ADD HL,HL
9629 LD DE,$F66E
962C ADD HL,DE
962D EX DE,HL
962E POP HL
962F INC L
9630 LD B,$08 B=08 (counter).
9632 LD A,(DE) A=DE.
9633 EXX
9634 LD H,A
9635 LD L,$00
9637 LD B,C
9638 LD A,C
9639 AND A
963A JR Z,$9642
963C SRL H
963E RR L
9640 DJNZ $963C
9642 LD A,L
9643 EX AF,AF'
9644 LD A,H
9645 EXX
9646 OR (HL)
9647 LD (HL),A
9648 INC L
9649 EX AF,AF'
964A OR (HL)
964B LD (HL),A
964C INC DE
964D DEC L
964E INC H
964F DJNZ $9632
9651 RET Return.
9652 POP HL Restore HL from the stack.
9653 RET Return.
Prev: 9531 Up: Map Next: 9654