Prev: C858 Up: Map Next: C8B7
C859: routine57
Used by the routine at routine56.
routine57 C859 SUB $29
C85B LD (unknown60),A
C85E LD HL,current_player
C861 CP (HL)
C862 RET Z
C863 LD HL,(object_table_entry_pointer)
C866 LD DE,map_object_table
C869 XOR A
C86A SBC HL,DE
C86C LD A,L
C86D LD HL,(BUFPNT)
C870 INC HL
C871 LD (HL),A
C872 LD HL,map_object_table
C875 LD B,$9F
routine57_0 C877 PUSH BC
C878 PUSH HL
C879 LD A,(HL)
C87A LD C,A
C87B OR A
C87C JR Z,routine57_1
C87E CP $26
C880 JP P,routine57_1
C883 LD DE,$01E1
C886 ADD HL,DE
C887 LD A,(HL)
C888 AND $07
C88A LD E,A
C88B LD A,(unknown60)
C88E CP E
C88F JR NZ,routine57_1
C891 LD HL,THRTAB
C894 LD B,$00
C896 ADD HL,BC
C897 LD A,(HL)
C898 SRL A
C89A SRL A
C89C LD HL,(BUFPNT)
C89F ADD A,(HL)
C8A0 LD (HL),A
routine57_1 C8A1 POP HL
C8A2 INC HL
C8A3 POP BC
C8A4 DJNZ routine57_0
C8A6 LD HL,(BUFPNT)
C8A9 LD A,(unknown64)
C8AC ADD A,(HL)
C8AD LD (HL),A
C8AE LD HL,(BUFPNT)
C8B1 INC HL
C8B2 INC HL
C8B3 LD (BUFPNT),HL
C8B6 RET
Prev: C858 Up: Map Next: C8B7