Prev: 7F87 Up: Map Next: 80D0
7FA7: Copy background into hero's background store and draw correct frame for hero.
Used by the routine at Vectors.
HeroDraw() 7FA7 LD A,(Hero_AnimCount)
This entry point is used by the routine at Vectors.
HeroDraw(a) 7FAA LD (Hero_AnimCount),A
7FAD CALL Vector_RunActions
7FB0 CALL SidheUpdate
7FB3 LD A,(Hero_AnimCount)
7FB6 AND A
7FB7 RET Z
7FB8 LD DE,HeroBackground
7FBB LD A,(Hero_AnimCount)
7FBE LD (Hero_AnimCount),A
7FC1 CP $14
7FC3 JR NZ,HeroDraw()_5
7FC5 LD HL,$F78C
7FC8 LD A,(ManWalkDirection_DFD4)
7FCB LD (Hero_AttackDir),A
7FCE CP $02
7FD0 JR Z,HeroDraw()_0
7FD2 INC HL
HeroDraw()_0 7FD3 LD A,$18
HeroDraw()_1 7FD5 LDI
7FD7 LDI
7FD9 LDI
7FDB LDI
7FDD LDI
7FDF LD BC,$001D
7FE2 ADD HL,BC
7FE3 DEC A
7FE4 JR NZ,HeroDraw()_1
7FE6 LD A,(ManWalkDirection_DFD4)
7FE9 CP $02
7FEB JR Z,HeroDraw()_2
7FED DEC HL
7FEE JR HeroDraw()_3
HeroDraw()_2 7FF0 INC HL
HeroDraw()_3 7FF1 LD A,$18
HeroDraw()_4 7FF3 LDI
7FF5 LDI
7FF7 LDI
7FF9 LDI
7FFB LDI
7FFD LD BC,$001D
8000 ADD HL,BC
8001 DEC A
8002 JR NZ,HeroDraw()_4
8004 JR HeroDraw()_7
HeroDraw()_5 8006 LD HL,$F67D
8009 LD A,$38
HeroDraw()_6 800B LDI
800D LDI
800F LDI
8011 LDI
8013 LD BC,$001E
8016 ADD HL,BC
8017 DEC A
8018 JR NZ,HeroDraw()_6
HeroDraw()_7 801A LD DE,(Hero_AnimCount)
801E LD D,$00
8020 LD HL,HeroFrameDir
8023 ADD HL,DE
8024 LD A,(ManWalkDirection_DFD4)
8027 AND (HL)
8028 JR NZ,HeroDraw()_8
802A LD A,(HL)
802B XOR $03
802D LD (HL),A
802E EX DE,HL
802F CALL Vector_BitmapMirror
HeroDraw()_8 8032 LD DE,(Hero_AnimCount)
8036 LD D,$00
8038 LD HL,$7F87
803B ADD HL,DE
803C LD E,(HL)
803D PUSH DE
803E LD HL,$7F7E
8041 ADD HL,DE
8042 LD A,(ManWalkDirection_DFD4)
8045 AND (HL)
8046 JR NZ,HeroDraw()_9
8048 LD A,(HL)
8049 XOR $03
804B LD (HL),A
804C EX DE,HL
804D CALL Vector_BitmapMirror
HeroDraw()_9 8050 LD HL,(Hero_AnimCount)
8053 LD H,$00
8055 ADD HL,HL
8056 ADD HL,HL
8057 LD DE, BitmapData_E
805A ADD HL,DE
805B LD C,(HL)
805C INC HL
805D LD B,(HL)
805E LD HL,BmpStart_E
8061 ADD HL,BC
8062 LD ( s0),HL
8065 POP HL
8066 ADD HL,HL
8067 ADD HL,HL
8068 ADD HL,DE
8069 LD E,(HL)
806A INC HL
806B LD D,(HL)
806C INC HL
806D LD A,(HL)
806E AND $7F
8070 RLA
8071 RLA
8072 RLA
8073 LD ( s2),A
8076 INC HL
8077 LD A,(HL)
8078 AND $7F
807A LD ( s3),A
807D LD HL,BmpStart_E
8080 ADD HL,DE
8081 EX DE,HL
8082 LD HL,$F78C
8085 LD A,(Hero_AnimCount)
8088 CP $14
808A JR Z,HeroDraw()_10
808C LD HL,$F67D
808F LD A,( s3)
8092 CP $02
8094 JR NZ,HeroDraw()_10
8096 INC HL
HeroDraw()_10 8097 LD BC,$B6DD
809A LD A,(ManData_SelObj_02_DFCB)
809D CP $6E
809F JR NZ,HeroDraw()_11
80A1 LD A,($DFCE)
80A4 BIT 3,A
80A6 JR NZ,HeroDraw()_11
80A8 LD BC,$0000
HeroDraw()_11 80AB LD ($80BC),BC
80AF LD IX,( s0)
80B3 LD BC,( s2)
HeroDraw()_12 80B7 PUSH BC
80B8 PUSH HL
HeroDraw()_13 80B9 LD A,(DE)
80BA CPL
80BB AND (HL)
80BC OR (IX+$00)
80BF LD (HL),A
80C0 INC HL
80C1 INC DE
80C2 INC IX
80C4 DJNZ HeroDraw()_13
80C6 POP HL
80C7 LD BC,$0022
80CA ADD HL,BC
80CB POP BC
80CC DEC C
80CD JR NZ,HeroDraw()_12
80CF RET
Prev: 7F87 Up: Map Next: 80D0