Prev: CBB9 Up: Map Next: CC55
CBC7: routine66
Used by the routine at routine64.
routine66 CBC7 LD A,$0D
CBC9 LD (unknown63),A
This entry point is used by the routine at routine65.
routine66_0 CBCC CALL fill_inbuf
CBCF LD A,$01
CBD1 LD (SRTCNT),A
CBD4 LD HL,INBUF
CBD7 LD (BUFPNT),HL
CBDA LD HL,(D_ADD)
CBDD LD (TEMADD),HL
CBE0 LD HL,map_object_table
CBE3 LD (D_ADD),HL
CBE6 LD B,$9E
routine66_1 CBE8 PUSH BC
CBE9 LD HL,(D_ADD)
CBEC CALL routine53
CBEF LD A,L
CBF0 CP $10
CBF2 JR Z,routine66_2
CBF4 LD (unknown75),HL
CBF7 LD HL,(TEMADD)
CBFA CALL routine53
CBFD LD (unknown76),HL
CC00 CALL calculate_distance
CC03 LD HL,total_distance
CC06 LD A,(unknown63)
CC09 CP (HL)
CC0A JP M,routine66_2
CC0D CALL routine68
CC10 LD HL,(D_ADD)
CC13 LD DE,map_object_table
CC16 AND A
CC17 SBC HL,DE
CC19 LD A,L
CC1A LD HL,(BUFPNT)
CC1D INC HL
CC1E LD (HL),A
CC1F INC HL
CC20 LD (BUFPNT),HL
CC23 LD HL,SRTCNT
CC26 INC (HL)
routine66_2 CC27 LD HL,(D_ADD)
CC2A INC HL
CC2B LD (D_ADD),HL
CC2E POP BC
CC2F DJNZ routine66_1
CC31 LD A,(SRTCNT)
CC34 LD HL,INBUF
CC37 CALL SORT
CC3A LD HL,$D493
routine66_3 CC3D DEC HL
CC3E DEC HL
CC3F LD A,(HL)
CC40 CP $FF
CC42 JR Z,routine66_3
CC44 LD HL,map_object_table
CC47 LD D,$00
CC49 LD E,A
CC4A ADD HL,DE
CC4B LD (AIM),HL
CC4E LD HL,(TEMADD)
CC51 LD (D_ADD),HL
CC54 RET
Prev: CBB9 Up: Map Next: CC55