Prev: 872A Up: Map Next: 87C9
873A: ; TODO
Used by the routines at Game_Init, _87c9 and 8BB6.
_873a 873A CALL Data_ClearToZero Clear the four bytes pointed to by the next address to zero.
873D DEFW Door_CurrentPos
873F DEFB $04
8740 CALL Bg_DrawColumn
8743 CALL $86B9
8746 LD A,(Hero_ThroughDoor)
8749 BIT 5,A
874B JR NZ,_873a_1
874D BIT 4,A
874F RET NZ
8750 AND A
8751 JR NZ,_873a_1
8753 LD A,(Hero_ThroughCompass)
8756 LD HL,(Stage_Compass)
8759 LD E,$12
875B CP L
875C JR Z,_873a_0
875E LD E,$13
8760 ADD A,$02
8762 AND $03
8764 CP L
8765 JR Z,_873a_0
8767 LD E,$10
8769 LD A,(Hero_ThroughCompass)
876C SUB L
876D AND $03
876F LD (Hero_LastDir),A
8772 CP $03
8774 JR NZ,_873a_0
8776 LD A,$02
8778 LD (Hero_LastDir),A
_873a_0 877B LD D,$00
877D LD (Hero_ThroughN),DE
_873a_1 8781 CALL Stage_Colour
Update compass on screen.
8784 LD A,$01
8786 CALL $1601
8789 LD HL,(Stage_Compass) Get the current compass value.
878C LD H,$00
878E LD DE,Str_Compass Get the address of hte first letter matching the compass.
8791 ADD HL,DE
8792 LD DE,Compass_PositionString
8795 LD C,$04 Number of compass points.
8797 LD B,$07 Length of first part of positioning string.
_873a_2 8799 LD A,(DE) Print positioning string for point.
879A CALL Print_Character
879D INC DE
879E DJNZ _873a_2
87A0 LD A,(HL) Print compass point letter.
87A1 CALL Print_Character
87A4 INC HL
87A5 LD B,$03 From then on we only need next three characters of the positioning string.
87A7 DEC C Next compass point.
87A8 JR NZ,_873a_2
87AA LD A,(Hero_ThroughDoor)
87AD BIT 5,A
87AF RET NZ
87B0 AND A
87B1 JR Z,_873a_3
87B3 CALL $AFFA
87B6 JR _873a_4
_873a_3 87B8 LD A,(Hero_ThroughN)
87BB CALL $AFFD
_873a_4 87BE JP Screen_Update
87C1 INC B
87C2 RLCA
87C3 DEC BC
87C4 LD C,$10
87C6 LD (DE),A
87C7 INC DE
87C8 DEC D
Prev: 872A Up: Map Next: 87C9