Prev: AB25 Up: Map Next: AD86
AB5F: Routine at AB5F
Used by the routine at A80E.
AB5F CP $02
AB61 JP NZ,$AC1B
AB64 LD BC,$0024
AB67 CALL Path_InGivenRange
AB6A JR NZ,$AB20
AB6C ADD HL,BC
AB6D LD A,L
AB6E CP $1B
AB70 JR C,$AB7E
AB72 SET 7,(IX+$0D)
AB76 SET 7,(IX+$0E)
AB7A SET 7,(IX+$0F)
AB7E CP $12
AB80 JR NC,$AB88
AB82 LD A,(Stat_ResetGame)
AB85 AND A
AB86 JR Z,$ABDF
AB88 LD E,(IX+$01)
AB8B LD D,$00
AB8D LD HL,$AA77
AB90 ADD HL,DE
AB91 LD A,(HL)
AB92 CP $FF
AB94 JR NZ,$AB9D
AB96 LD (IX+$01),$00
AB9A LD A,($AA77)
AB9D INC (IX+$01)
ABA0 LD HL,$C3EB
ABA3 CP $2C
ABA5 JR NC,$ABB1
ABA7 CP $1A
ABA9 JR C,$ABB1
ABAB INC HL
ABAC CP $1D
ABAE JR C,$ABB1
ABB0 INC HL
ABB1 OR $80
ABB3 LD (HL),A
This entry point is used by the routine at AB25.
ABB4 LD B,$03
ABB6 LD HL,$C3EB
ABB9 LD (IX+$09),$00
ABBD RLC (HL)
ABBF SRL (HL)
ABC1 JR NC,$ABD3
ABC3 LD A,(HL)
ABC4 LD ($C3E9),A
ABC7 PUSH BC
ABC8 PUSH HL
ABC9 CALL $AD5D
ABCC LD A,$01
ABCE CALL $B288
ABD1 POP HL
ABD2 POP BC
ABD3 LD A,(IX+$09)
ABD6 ADD A,$18
ABD8 LD (IX+$09),A
ABDB INC HL
ABDC DJNZ $ABBD
ABDE RET
ABDF LD (IX+$00),$03
ABE3 LD A,$0C
ABE5 LD (Stat_ResetGame),A
ABE8 LD (IX+$04),$00
ABEC LD HL,(Position_NS)
ABEF LD DE,(Position_EW)
ABF3 LD A,(Stage_Compass)
ABF6 BIT 0,A
ABF8 JR Z,$ABFB
ABFA EX DE,HL
ABFB LD HL,($C3E3)
ABFE BIT 0,A
AC00 JR NZ,$AC0D
AC02 LD A,$01
AC04 AND A
AC05 SBC HL,DE
AC07 JR C,$AC16
AC09 LD A,$03
AC0B JR $AC16
AC0D LD A,$02
AC0F AND A
AC10 SBC HL,DE
AC12 JR C,$AC16
AC14 LD A,$00
AC16 LD ($C3E1),A
AC19 JR $AC20
AC1B CP $03
AC1D JP NZ,$ACA5
AC20 LD A,($C3E2)
AC23 LD E,A
AC24 LD D,$00
AC26 INC A
AC27 INC A
AC28 LD ($C3E2),A
AC2B LD HL,$AACA
AC2E ADD HL,DE
AC2F LD A,(HL)
AC30 CP $FF
AC32 JR Z,$AC99
AC34 LD ($C3E9),A
AC37 INC HL
AC38 LD C,(HL)
AC39 LD B,$00
AC3B LD HL,($C3E3)
AC3E LD DE,($C3E5)
AC42 PUSH HL
AC43 PUSH DE
AC44 LD A,($C3E1)
AC47 BIT 0,A
AC49 JR Z,$AC4C
AC4B EX DE,HL
AC4C CP $00
AC4E JR Z,$AC57
AC50 CP $03
AC52 JR Z,$AC57
AC54 ADD HL,BC
AC55 JR $AC5A
AC57 AND A
AC58 SBC HL,BC
AC5A BIT 0,A
AC5C JR Z,$AC5F
AC5E EX DE,HL
AC5F LD ($C3E3),HL
AC62 LD ($C3E5),DE
AC66 CALL $AD5D
AC69 LD HL,($C3E9)
AC6C CALL Bitmap_GetData
AC6F LD A,(Stage_Compass)
AC72 SUB (IX+$03)
AC75 RRCA
AC76 RRCA
AC77 XOR (HL)
AC78 JP M,$AC81
AC7B LD HL,($C3E9)
AC7E CALL _a345_28
AC81 LD A,($C3E9)
AC84 LD ($C3EA),A
AC87 LD (IX+$09),$30
AC8B XOR A
AC8C CALL $B288
AC8F POP DE
AC90 POP HL
AC91 LD ($C3E3),HL
AC94 LD ($C3E5),DE
AC98 RET
AC99 SET 7,(IX+$0F)
AC9D LD A,$02
AC9F LD ($C3DE),A
ACA2 JP $AB5F
ACA5 CP $04
ACA7 JR NZ,$ACB3
ACA9 LD (IX+$00),$05
ACAD LD (IX+$04),$00
ACB1 JR $ACB7
ACB3 CP $05
ACB5 JR NZ,$AD23
ACB7 LD HL,_5b00_buffer
ACBA LD (Bitmap_Table),HL
ACBD LD DE,$5B01
ACC0 LD BC,$005F
ACC3 LD (HL),$00
ACC5 LDIR
ACC7 LD HL,$C58E
ACCA LD (HL),$83
ACCC INC HL
ACCD LD (HL),$04
ACCF LD A,($C3E2)
ACD2 LD E,A
ACD3 LD D,$00
ACD5 LD HL,$AAEB
ACD8 ADD HL,DE
ACD9 INC A
ACDA INC A
ACDB INC A
ACDC LD ($C3E2),A
ACDF LD A,(HL)
ACE0 CP $FF
ACE2 JR Z,$ACEF
ACE4 LD DE,$C3EB
ACE7 LD BC,$0003
ACEA LDIR
ACEC JP $ABB4
ACEF LD (IX+$0B),$83
ACF3 LD (IX+$09),$18
ACF7 LD A,$01
ACF9 CALL $B288
ACFC LD HL,$5B3C
ACFF LD B,$04
AD01 LD (HL),$FF
AD03 INC HL
AD04 DJNZ $AD01
AD06 LD (IX+$0B),$00
AD0A LD (IX+$09),$30
AD0E LD A,$01
AD10 CALL $B288
AD13 LD (IX+$00),$06
AD17 LD (IX+$04),$0C
AD1B LD (IX+$0B),$4E
AD1F LD (IX+$0C),$4B
AD23 DEC (IX+$04)
AD26 JR Z,$AD38
AD28 LD (IX+$09),$12
AD2C LD A,(IX+$0B)
AD2F XOR $01
AD31 LD (IX+$0B),A
AD34 XOR A
AD35 JP $B288
AD38 LD (IX+$00),$00
AD3C LD A,$FF
AD3E LD ($BD2C),A
AD41 LD A,(Level_Char)
AD44 SUB $61
AD46 LD B,A
AD47 ADD A,A
AD48 ADD A,A
AD49 ADD A,B
AD4A ADD A,A
AD4B LD E,A
AD4C LD D,$00
AD4E LD HL,_bda5
AD51 ADD HL,DE
AD52 SET 7,(HL)
AD54 RET
AD55 ADD HL,DE
AD56 INC E
AD57 LD E,$2D
AD59 JR $AD76
AD5B DEC E
AD5C INC L
AD5D LD A,(IX+$0B)
AD60 LD HL,$AD55
AD63 LD BC,$0008
AD66 CPIR
AD68 RET NZ
AD69 LD A,C
AD6A CP $04
AD6C LD A,$00
AD6E JR C,$AD75
AD70 DEC (IX+$0B)
AD73 LD A,$80
AD75 PUSH AF
AD76 LD L,(IX+$0B)
AD79 CALL Bitmap_GetData
AD7C POP AF
AD7D XOR (HL)
AD7E RLCA
AD7F RET NC
AD80 LD L,(IX+$0B)
AD83 JP _a345_28
Prev: AB25 Up: Map Next: AD86