Prev: 603B Up: Map Next: 60AB
6071: Update area data and set compass to correct direction.
Used by the routines at Vector_HeroInit, HeroInit and 61B8.
Input
A New Area Index
AreaUpdateData 6071 LD (AreaDataCurrent_Index),A Store new index
6074 DEC A Calculate area data address from index value
6075 LD L,A
6076 LD H,$00
6078 ADD HL,HL
6079 LD E,L
607A LD D,H
607B ADD HL,HL
607C ADD HL,HL
607D EX DE,HL
607E ADD HL,DE
607F EX DE,HL
6080 ADD HL,HL
6081 ADD HL,DE
6082 LD DE,(AreaDataHandle_E001)
6086 ADD HL,DE
6087 LD DE,AreaDataCurrent_SceneryPrimary
608A LD A,(AreaDataCurrent_CompassOffset) Get previous area compass offset.
608D LD BC,$001A Copy new area data as current area.
6090 LDIR
6092 LD C,A Make sure the compass is correct for area and man is facing the right direction on entry.
6093 LD HL,(AreaDataCurrent_CompassOffset)
6096 LD A,(CamDirection_DFD2)
6099 ADD A,C
609A SUB L
609B AND $03
609D LD (CamDirection_DFD2),A
60A0 LD A,(ManCamDirection_DFD5)
60A3 ADD A,C
60A4 SUB L
60A5 AND $03
60A7 LD (ManCamDirection_DFD5),A
60AA RET
Prev: 603B Up: Map Next: 60AB