2013-12-17 21:23:50 -08:00
|
|
|
; Pic animation arrangement.
|
|
|
|
|
|
|
|
|
|
|
|
Functiond0000: ; d0000
|
2014-06-04 01:10:56 -07:00
|
|
|
hlcoord 12, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [IsInBattle]
|
|
|
|
cp $1
|
|
|
|
jr z, .asm_d0012
|
|
|
|
ld e, $0
|
|
|
|
ld d, $0
|
|
|
|
call Functiond008e
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_d0012
|
|
|
|
ld e, $1
|
|
|
|
ld d, $0
|
|
|
|
call Functiond008e
|
|
|
|
ret
|
|
|
|
; d001a
|
|
|
|
|
2014-07-24 12:02:58 -07:00
|
|
|
Functiond001a: ; d001a
|
|
|
|
ld e, $2
|
|
|
|
ld d, $0
|
|
|
|
call Functiond008e
|
|
|
|
ret
|
|
|
|
; d0022
|
|
|
|
|
|
|
|
Functiond0022: ; d0022
|
|
|
|
ld e, $3
|
|
|
|
ld d, $0
|
|
|
|
call Functiond008e
|
|
|
|
ret
|
|
|
|
; d002a
|
|
|
|
|
|
|
|
Functiond002a: ; d002a
|
|
|
|
ld e, $4
|
|
|
|
ld d, $0
|
|
|
|
call Functiond008e
|
|
|
|
ret
|
|
|
|
; d0032
|
|
|
|
|
|
|
|
Functiond0032: ; d0032
|
|
|
|
ld e, $5
|
|
|
|
ld d, $0
|
|
|
|
call Functiond008e
|
|
|
|
ret
|
|
|
|
; d003a
|
|
|
|
|
|
|
|
Functiond003a: ; d003a
|
|
|
|
ld e, $6
|
|
|
|
ld d, $0
|
|
|
|
call Functiond008e
|
|
|
|
ret
|
|
|
|
; d0042
|
|
|
|
|
|
|
|
|
|
|
|
Unknown_d0042: ; d0042
|
|
|
|
dw Unknown_d0054
|
|
|
|
dw Unknown_d0058
|
|
|
|
dw Unknown_d005c
|
|
|
|
dw Unknown_d0064
|
|
|
|
dw Unknown_d006e
|
|
|
|
dw Unknown_d0076
|
|
|
|
dw Unknown_d0080
|
|
|
|
dw Unknown_d0088
|
|
|
|
dw Unknown_d008b
|
|
|
|
|
|
|
|
Unknown_d0054: db 11, 5, 7, 0
|
|
|
|
Unknown_d0058: db 11, 4, 7, 0
|
|
|
|
Unknown_d005c: db 10, 4, 7, 2, 3, 6, 7, 0
|
|
|
|
Unknown_d0064: db 6, 8, 6, 7, 2, 3, 9, 4, 7, 0
|
|
|
|
Unknown_d006e: db 6, 7, 2, 3,10, 4, 7, 0
|
|
|
|
Unknown_d0076: db 6, 7,10, 4, 7, 2, 3, 6, 7, 0
|
|
|
|
Unknown_d0080: db 10, 4, 7, 2, 3, 6, 7, 0
|
|
|
|
Unknown_d0088: db 4, 7, 0
|
|
|
|
Unknown_d008b: db 6, 7, 0
|
|
|
|
|
2013-12-17 21:23:50 -08:00
|
|
|
|
|
|
|
Functiond008e: ; d008e
|
|
|
|
call Functiond01c6
|
|
|
|
ret c
|
|
|
|
call Functiond00a3
|
|
|
|
.asm_d0095
|
|
|
|
call Functiond00b4
|
|
|
|
push af
|
|
|
|
callba Function10402d
|
|
|
|
pop af
|
|
|
|
jr nc, .asm_d0095
|
|
|
|
ret
|
|
|
|
; d00a3
|
|
|
|
|
|
|
|
Functiond00a3: ; d00a3
|
|
|
|
push hl
|
|
|
|
ld c, e
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 0
|
|
|
|
ld hl, Unknown_d0042
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, bc
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hli]
|
|
|
|
ld b, [hl]
|
|
|
|
ld c, a
|
|
|
|
pop hl
|
|
|
|
call Functiond01d6
|
|
|
|
ret
|
|
|
|
; d00b4
|
|
|
|
|
|
|
|
Functiond00b4: ; d00b4
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $2
|
|
|
|
ld [rSVBK], a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d168]
|
2013-12-17 21:23:50 -08:00
|
|
|
ld c, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 0
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d169
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2014-07-24 12:02:58 -07:00
|
|
|
ld hl, Jumptable_d00da
|
2013-12-17 21:23:50 -08:00
|
|
|
rst JumpTable
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d168]
|
2013-12-17 21:23:50 -08:00
|
|
|
ld c, a
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ld a, c
|
|
|
|
and $80
|
|
|
|
ret z
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; d00da
|
|
|
|
|
2014-07-24 12:02:58 -07:00
|
|
|
Jumptable_d00da: ; d00da
|
2013-12-17 21:23:50 -08:00
|
|
|
dw Functiond0171
|
|
|
|
dw Functiond0166
|
|
|
|
dw Functiond00f2
|
|
|
|
dw Functiond00fe
|
|
|
|
dw Functiond010b
|
|
|
|
dw Functiond011d
|
|
|
|
dw Functiond012f
|
|
|
|
dw Functiond0141
|
|
|
|
dw Functiond0155
|
|
|
|
dw Functiond017a
|
|
|
|
dw Functiond0188
|
|
|
|
dw Functiond0196
|
|
|
|
; d00f2
|
|
|
|
|
|
|
|
Functiond00f2: ; d00f2
|
|
|
|
ld a, $12
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d181], a
|
|
|
|
ld a, [w2_d168]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d168], a
|
2013-12-17 21:23:50 -08:00
|
|
|
|
|
|
|
Functiond00fe: ; d00fe
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d181
|
2013-12-17 21:23:50 -08:00
|
|
|
dec [hl]
|
|
|
|
ret nz
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d168]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d168], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d010b
|
|
|
|
|
|
|
|
Functiond010b: ; d010b
|
|
|
|
ld c, $0
|
|
|
|
ld b, $0
|
|
|
|
call Functiond0228
|
|
|
|
call Functiond0504
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d168]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d168], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d011d
|
|
|
|
|
|
|
|
Functiond011d: ; d011d
|
|
|
|
ld c, $0
|
|
|
|
ld b, $4
|
|
|
|
call Functiond0228
|
|
|
|
call Functiond0504
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d168]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d168], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d012f
|
|
|
|
|
|
|
|
Functiond012f: ; d012f
|
|
|
|
ld c, $1
|
|
|
|
ld b, $0
|
|
|
|
call Functiond0228
|
|
|
|
call Functiond0504
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d168]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d168], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d0141
|
|
|
|
|
|
|
|
Functiond0141: ; d0141
|
|
|
|
call Functiond0250
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d17e]
|
2013-12-17 21:23:50 -08:00
|
|
|
bit 7, a
|
|
|
|
ret z
|
|
|
|
call Functiond04bd
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d168]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d168], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d0155
|
|
|
|
|
|
|
|
Functiond0155: ; d0155
|
|
|
|
call Functiond0250
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d17e]
|
2013-12-17 21:23:50 -08:00
|
|
|
bit 7, a
|
|
|
|
ret z
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d168]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d168], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d0166
|
|
|
|
|
|
|
|
Functiond0166: ; d0166
|
|
|
|
call Functiond01a9
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d168]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d168], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d0171
|
|
|
|
|
|
|
|
Functiond0171: ; d0171
|
|
|
|
call Functiond01a9
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d168
|
2013-12-17 21:23:50 -08:00
|
|
|
set 7, [hl]
|
|
|
|
ret
|
|
|
|
; d017a
|
|
|
|
|
|
|
|
Functiond017a: ; d017a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d16b]
|
2014-07-18 10:25:03 -07:00
|
|
|
call _PlayCry
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d168]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d168], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d0188
|
|
|
|
|
|
|
|
Functiond0188: ; d0188
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d16b]
|
2014-07-18 10:25:03 -07:00
|
|
|
call PlayCry2
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d168]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d168], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d0196
|
|
|
|
|
|
|
|
Functiond0196: ; d0196
|
|
|
|
ld a, $f
|
|
|
|
ld [CryTracks], a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d16b]
|
2014-07-18 10:25:03 -07:00
|
|
|
call PlayStereoCry2
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d168]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d168], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d01a9
|
|
|
|
|
|
|
|
Functiond01a9: ; d01a9
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $2
|
|
|
|
ld [rSVBK], a
|
|
|
|
call Functiond04bd
|
|
|
|
callba Function10402d
|
|
|
|
call Functiond0536
|
|
|
|
callba Function104047
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
; d01c6
|
|
|
|
|
|
|
|
Functiond01c6: ; d01c6
|
|
|
|
ld a, [CurPartySpecies]
|
2014-07-24 12:02:58 -07:00
|
|
|
cp EGG
|
2013-12-17 21:23:50 -08:00
|
|
|
jr z, .asm_d01d4
|
|
|
|
call IsAPokemon
|
|
|
|
jr c, .asm_d01d4
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_d01d4
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; d01d6
|
|
|
|
|
|
|
|
Functiond01d6: ; d01d6
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $2
|
|
|
|
ld [rSVBK], a
|
|
|
|
push bc
|
|
|
|
push de
|
|
|
|
push hl
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d168
|
2013-12-17 21:23:50 -08:00
|
|
|
ld bc, $0029
|
|
|
|
xor a
|
|
|
|
call ByteFill
|
|
|
|
pop hl
|
|
|
|
pop de
|
|
|
|
pop bc
|
|
|
|
ld a, c
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d169], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, b
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d16a], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, l
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d16f], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d170], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, d
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d16e], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, $1
|
|
|
|
ld hl, CurPartySpecies
|
|
|
|
call GetFarWRAMByte
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d16b], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, $1
|
|
|
|
ld hl, UnownLetter
|
|
|
|
call GetFarWRAMByte
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d16c], a
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond065c
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d16d], a
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond05b4
|
|
|
|
ld a, c
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d171], a
|
2013-12-17 21:23:50 -08:00
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
; d0228
|
|
|
|
|
|
|
|
Functiond0228: ; d0228
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $2
|
|
|
|
ld [rSVBK], a
|
|
|
|
push bc
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d172
|
2013-12-17 21:23:50 -08:00
|
|
|
ld bc, $001f
|
|
|
|
xor a
|
|
|
|
call ByteFill
|
|
|
|
pop bc
|
|
|
|
ld a, b
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d172 + 1], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, c
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d172], a
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond055c
|
|
|
|
call Functiond05ce
|
|
|
|
call Functiond061b
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
; d0250
|
|
|
|
|
|
|
|
Functiond0250: ; d0250
|
|
|
|
xor a
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
|
|
|
Functiond0253: ; d0253
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d17e]
|
2013-12-17 21:23:50 -08:00
|
|
|
and $7f
|
|
|
|
ld hl, Tabled025d
|
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
; d025d
|
|
|
|
|
|
|
|
Tabled025d: ; d025d
|
|
|
|
dw Functiond0261
|
|
|
|
dw Functiond0282
|
|
|
|
; d0261
|
|
|
|
|
|
|
|
Functiond0261: ; d0261
|
|
|
|
call Functiond02f8
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d182]
|
2013-12-17 21:23:50 -08:00
|
|
|
cp $ff
|
|
|
|
jr z, Functiond02a8
|
|
|
|
cp $fe
|
|
|
|
jr z, Functiond028e
|
|
|
|
cp $fd
|
|
|
|
jr z, Functiond0296
|
|
|
|
call Functiond02c8
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d183]
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond02ae
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d181], a
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond02dc
|
|
|
|
|
|
|
|
Functiond0282: ; d0282
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d181]
|
2013-12-17 21:23:50 -08:00
|
|
|
dec a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d181], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret nz
|
|
|
|
call Functiond02e4
|
|
|
|
ret
|
|
|
|
; d028e
|
|
|
|
|
|
|
|
Functiond028e: ; d028e
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d183]
|
|
|
|
ld [w2_d17f], a
|
2013-12-17 21:23:50 -08:00
|
|
|
jr Functiond0253
|
|
|
|
; d0296
|
|
|
|
|
|
|
|
Functiond0296: ; d0296
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d17f]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
dec a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d17f], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret z
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d183]
|
|
|
|
ld [w2_d17d], a
|
2013-12-17 21:23:50 -08:00
|
|
|
jr Functiond0253
|
|
|
|
; d02a8
|
|
|
|
|
|
|
|
Functiond02a8: ; d02a8
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d17e
|
2013-12-17 21:23:50 -08:00
|
|
|
set 7, [hl]
|
|
|
|
ret
|
|
|
|
; d02ae
|
|
|
|
|
|
|
|
Functiond02ae: ; d02ae
|
|
|
|
ld c, a
|
|
|
|
ld b, $0
|
|
|
|
ld hl, $0000
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d173]
|
2013-12-17 21:23:50 -08:00
|
|
|
call AddNTimes
|
|
|
|
ld a, h
|
|
|
|
swap a
|
|
|
|
and $f0
|
|
|
|
ld h, a
|
|
|
|
ld a, l
|
|
|
|
swap a
|
|
|
|
and $f
|
|
|
|
or h
|
|
|
|
add c
|
|
|
|
ret
|
|
|
|
; d02c8
|
|
|
|
|
|
|
|
Functiond02c8: ; d02c8
|
|
|
|
call Functiond04bd
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d182]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
call Functiond031b
|
|
|
|
push hl
|
|
|
|
call Functiond033b
|
|
|
|
pop hl
|
|
|
|
call Functiond036b
|
|
|
|
ret
|
|
|
|
; d02dc
|
|
|
|
|
|
|
|
Functiond02dc: ; d02dc
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d17e]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d17e], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d02e4
|
|
|
|
|
|
|
|
Functiond02e4: ; d02e4
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d17e]
|
2013-12-17 21:23:50 -08:00
|
|
|
dec a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d17e], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d02ec
|
|
|
|
|
|
|
|
Functiond02ec: ; d02ec
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d16b]
|
2014-07-24 12:02:58 -07:00
|
|
|
cp UNOWN
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d02f2
|
|
|
|
|
|
|
|
Functiond02f2: ; d02f2
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d16b]
|
2014-07-24 12:02:58 -07:00
|
|
|
cp EGG
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d02f8
|
|
|
|
|
|
|
|
Functiond02f8: ; d02f8
|
|
|
|
push hl
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d17d]
|
2013-12-17 21:23:50 -08:00
|
|
|
ld e, a
|
|
|
|
ld d, $0
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d175
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
add hl, de
|
|
|
|
add hl, de
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d174]
|
2013-12-17 21:23:50 -08:00
|
|
|
call GetFarHalfword
|
|
|
|
ld a, l
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d182], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d183], a
|
|
|
|
ld hl, w2_d17d
|
2013-12-17 21:23:50 -08:00
|
|
|
inc [hl]
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
; d031b
|
|
|
|
|
|
|
|
Functiond031b: ; d031b
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d182]
|
2013-12-17 21:23:50 -08:00
|
|
|
dec a
|
|
|
|
ld c, a
|
|
|
|
ld b, $0
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d178
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
add hl, bc
|
|
|
|
add hl, bc
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d177]
|
2013-12-17 21:23:50 -08:00
|
|
|
call GetFarHalfword
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d177]
|
2013-12-17 21:23:50 -08:00
|
|
|
call GetFarByte
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d180], a
|
2013-12-17 21:23:50 -08:00
|
|
|
inc hl
|
|
|
|
ret
|
|
|
|
; d033b
|
|
|
|
|
|
|
|
Functiond033b: ; d033b
|
|
|
|
call Functiond0356
|
|
|
|
push bc
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d17b
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d180]
|
2013-12-17 21:23:50 -08:00
|
|
|
call AddNTimes
|
|
|
|
pop bc
|
2015-02-10 15:14:21 -08:00
|
|
|
ld de, w2_d188
|
|
|
|
ld a, [w2_d17a]
|
2013-12-17 21:23:50 -08:00
|
|
|
call FarCopyBytes
|
|
|
|
ret
|
|
|
|
; d0356
|
|
|
|
|
|
|
|
Functiond0356: ; d0356
|
|
|
|
push hl
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d171]
|
2014-07-24 12:02:58 -07:00
|
|
|
sub 5
|
2013-12-17 21:23:50 -08:00
|
|
|
ld c, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 0
|
|
|
|
ld hl, Unknown_d0368
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, bc
|
|
|
|
ld c, [hl]
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
; d0368
|
|
|
|
|
2014-07-24 12:02:58 -07:00
|
|
|
Unknown_d0368: db 4, 5, 7
|
2013-12-17 21:23:50 -08:00
|
|
|
|
|
|
|
Functiond036b: ; d036b
|
|
|
|
xor a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d187], a
|
|
|
|
ld [w2_d186], a
|
|
|
|
ld [w2_d185], a
|
2013-12-17 21:23:50 -08:00
|
|
|
.asm_d0375
|
|
|
|
push hl
|
|
|
|
call Functiond0392
|
|
|
|
pop hl
|
|
|
|
ld a, b
|
|
|
|
and a
|
|
|
|
jr z, .asm_d038a
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d177]
|
2013-12-17 21:23:50 -08:00
|
|
|
call GetFarByte
|
|
|
|
inc hl
|
|
|
|
push hl
|
|
|
|
call Functiond03bd
|
|
|
|
pop hl
|
|
|
|
|
|
|
|
.asm_d038a
|
|
|
|
push hl
|
|
|
|
call Functiond0499
|
|
|
|
pop hl
|
|
|
|
jr nc, .asm_d0375
|
|
|
|
ret
|
|
|
|
; d0392
|
|
|
|
|
|
|
|
Functiond0392: ; d0392
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d187]
|
2013-12-17 21:23:50 -08:00
|
|
|
and $f8
|
|
|
|
rrca
|
|
|
|
rrca
|
|
|
|
rrca
|
|
|
|
ld e, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, 0
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d188
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
|
|
|
ld b, [hl]
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d187]
|
2014-07-24 12:02:58 -07:00
|
|
|
and 7
|
2013-12-17 21:23:50 -08:00
|
|
|
jr z, .asm_d03b0
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2013-12-17 21:23:50 -08:00
|
|
|
ld c, a
|
|
|
|
ld a, b
|
|
|
|
.asm_d03ab
|
|
|
|
rrca
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_d03ab
|
|
|
|
ld b, a
|
|
|
|
|
|
|
|
.asm_d03b0
|
|
|
|
xor a
|
|
|
|
bit 0, b
|
|
|
|
jr z, .asm_d03b7
|
2014-07-24 12:02:58 -07:00
|
|
|
ld a, 1
|
2013-12-17 21:23:50 -08:00
|
|
|
|
|
|
|
.asm_d03b7
|
|
|
|
ld b, a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d187
|
2013-12-17 21:23:50 -08:00
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
; d03bd
|
|
|
|
|
|
|
|
Functiond03bd: ; d03bd
|
|
|
|
push af
|
|
|
|
call Functiond03cd
|
|
|
|
pop af
|
|
|
|
push hl
|
|
|
|
call Functiond03f7
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d16e
|
2013-12-17 21:23:50 -08:00
|
|
|
add [hl]
|
|
|
|
pop hl
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
; d03cd
|
|
|
|
|
|
|
|
Functiond03cd: ; d03cd
|
|
|
|
call Functiond046c
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d186]
|
2013-12-17 21:23:50 -08:00
|
|
|
ld bc, $0014
|
|
|
|
call AddNTimes
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [wc2c6]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
|
|
|
jr nz, .asm_d03e8
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d185]
|
2013-12-17 21:23:50 -08:00
|
|
|
ld e, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
|
|
|
jr .asm_d03f3
|
|
|
|
|
|
|
|
.asm_d03e8
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d185]
|
2013-12-17 21:23:50 -08:00
|
|
|
ld e, a
|
|
|
|
ld a, l
|
|
|
|
sub e
|
|
|
|
ld l, a
|
|
|
|
ld a, h
|
2014-07-24 12:02:58 -07:00
|
|
|
sbc 0
|
2013-12-17 21:23:50 -08:00
|
|
|
ld h, a
|
|
|
|
|
|
|
|
.asm_d03f3
|
|
|
|
ret
|
|
|
|
; d03f4
|
|
|
|
|
2014-07-24 12:02:58 -07:00
|
|
|
Unknown_d03f4: db 6, 5, 4
|
2013-12-17 21:23:50 -08:00
|
|
|
|
|
|
|
Functiond03f7: ; d03f7
|
|
|
|
push af
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d171]
|
2014-07-24 12:02:58 -07:00
|
|
|
cp 5
|
2013-12-17 21:23:50 -08:00
|
|
|
jr z, .asm_d0405
|
2014-07-24 12:02:58 -07:00
|
|
|
cp 6
|
2013-12-17 21:23:50 -08:00
|
|
|
jr z, .asm_d041a
|
|
|
|
pop af
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_d0405
|
|
|
|
pop af
|
2014-07-24 12:02:58 -07:00
|
|
|
cp 5 * 5
|
2013-12-17 21:23:50 -08:00
|
|
|
jr nc, .asm_d0417
|
|
|
|
push hl
|
|
|
|
push de
|
2014-07-24 12:02:58 -07:00
|
|
|
ld hl, Unknown_d042f
|
2013-12-17 21:23:50 -08:00
|
|
|
ld e, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_d0417
|
2014-07-24 12:02:58 -07:00
|
|
|
add 24
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_d041a
|
|
|
|
pop af
|
2014-07-24 12:02:58 -07:00
|
|
|
cp 6 * 6
|
2013-12-17 21:23:50 -08:00
|
|
|
jr nc, .asm_d042c
|
|
|
|
push hl
|
|
|
|
push de
|
2014-07-24 12:02:58 -07:00
|
|
|
ld hl, Unknown_d0448
|
2013-12-17 21:23:50 -08:00
|
|
|
ld e, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_d042c
|
2014-07-24 12:02:58 -07:00
|
|
|
add 13
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d042f
|
|
|
|
|
2014-07-24 12:02:58 -07:00
|
|
|
Unknown_d042f:
|
|
|
|
db 9, 10, 11, 12, 13
|
|
|
|
db 16, 17, 18, 19, 20
|
|
|
|
db 23, 24, 25, 26, 27
|
|
|
|
db 30, 31, 32, 33, 34
|
|
|
|
db 37, 38, 39, 40, 41
|
|
|
|
|
|
|
|
Unknown_d0448:
|
|
|
|
db 8, 9, 10, 11, 12, 13
|
|
|
|
db 15, 16, 17, 18, 19, 20
|
|
|
|
db 22, 23, 24, 25, 26, 27
|
|
|
|
db 29, 30, 31, 32, 33, 34
|
|
|
|
db 36, 37, 38, 39, 40, 41
|
|
|
|
db 43, 44, 45, 46, 47, 48
|
|
|
|
|
2013-12-17 21:23:50 -08:00
|
|
|
|
|
|
|
Functiond046c: ; d046c
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d16f
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d171]
|
2014-07-24 12:02:58 -07:00
|
|
|
ld de, 0
|
|
|
|
ld bc, 6
|
|
|
|
cp 7
|
2013-12-17 21:23:50 -08:00
|
|
|
jr z, .asm_d048f
|
2014-07-24 12:02:58 -07:00
|
|
|
ld de, 21
|
|
|
|
ld bc, 25
|
|
|
|
cp 6
|
2013-12-17 21:23:50 -08:00
|
|
|
jr z, .asm_d048f
|
2014-07-24 12:02:58 -07:00
|
|
|
ld de, 41
|
|
|
|
ld bc, 45
|
2013-12-17 21:23:50 -08:00
|
|
|
.asm_d048f
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [wc2c6]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
|
|
|
jr nz, .asm_d0497
|
|
|
|
add hl, de
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_d0497
|
|
|
|
add hl, bc
|
|
|
|
ret
|
|
|
|
; d0499
|
|
|
|
|
|
|
|
Functiond0499: ; d0499
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d186]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d186], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld c, a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d171]
|
2013-12-17 21:23:50 -08:00
|
|
|
cp c
|
|
|
|
jr nz, .asm_d04bb
|
|
|
|
xor a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d186], a
|
|
|
|
ld a, [w2_d185]
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d185], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld c, a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d171]
|
2013-12-17 21:23:50 -08:00
|
|
|
cp c
|
|
|
|
jr nz, .asm_d04bb
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_d04bb
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
; d04bd
|
|
|
|
|
|
|
|
Functiond04bd: ; d04bd
|
|
|
|
call Functiond04f6
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [wc2c6]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
|
|
|
jr nz, .asm_d04ce
|
2014-07-24 12:02:58 -07:00
|
|
|
ld de, 1
|
|
|
|
ld bc, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
jr .asm_d04d4
|
|
|
|
|
|
|
|
.asm_d04ce
|
2014-07-24 12:02:58 -07:00
|
|
|
ld de, -1
|
|
|
|
ld bc, 6
|
2013-12-17 21:23:50 -08:00
|
|
|
|
|
|
|
.asm_d04d4
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d16f
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
add hl, bc
|
2014-07-24 12:02:58 -07:00
|
|
|
ld c, 7
|
|
|
|
ld b, 7
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d16e]
|
2013-12-17 21:23:50 -08:00
|
|
|
.asm_d04e2
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
ld de, $0014
|
|
|
|
.asm_d04e8
|
|
|
|
ld [hl], a
|
|
|
|
inc a
|
|
|
|
add hl, de
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_d04e8
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
add hl, de
|
|
|
|
pop bc
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_d04e2
|
|
|
|
ret
|
|
|
|
; d04f6
|
|
|
|
|
|
|
|
Functiond04f6: ; d04f6
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d16f
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 7
|
|
|
|
ld c, 7
|
2013-12-17 21:23:50 -08:00
|
|
|
call ClearBox
|
|
|
|
ret
|
|
|
|
; d0504
|
|
|
|
|
|
|
|
Functiond0504: ; d0504
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $2
|
|
|
|
ld [rSVBK], a
|
|
|
|
xor a
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
call Functiond051b
|
|
|
|
callba Function104047
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
; d051b
|
|
|
|
|
|
|
|
Functiond051b: ; d051b
|
|
|
|
call Functiond0551
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 7
|
|
|
|
ld c, 7
|
2013-12-17 21:23:50 -08:00
|
|
|
ld de, $0014
|
|
|
|
.asm_d0525
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
.asm_d0527
|
|
|
|
ld a, [hl]
|
2014-07-24 12:02:58 -07:00
|
|
|
or 8
|
2013-12-17 21:23:50 -08:00
|
|
|
ld [hl], a
|
|
|
|
add hl, de
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_d0527
|
|
|
|
pop hl
|
|
|
|
inc hl
|
|
|
|
pop bc
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_d0525
|
|
|
|
ret
|
|
|
|
; d0536
|
|
|
|
|
|
|
|
Functiond0536: ; d0536
|
|
|
|
call Functiond0551
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, 7
|
|
|
|
ld c, 7
|
2013-12-17 21:23:50 -08:00
|
|
|
ld de, $0014
|
|
|
|
.asm_d0540
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
.asm_d0542
|
|
|
|
ld a, [hl]
|
|
|
|
and $f7
|
|
|
|
ld [hl], a
|
|
|
|
add hl, de
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_d0542
|
|
|
|
pop hl
|
|
|
|
inc hl
|
|
|
|
pop bc
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_d0540
|
|
|
|
ret
|
|
|
|
; d0551
|
|
|
|
|
|
|
|
Functiond0551: ; d0551
|
2015-02-10 15:14:21 -08:00
|
|
|
ld hl, w2_d16f
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2014-08-22 20:41:57 -07:00
|
|
|
ld de, AttrMap - TileMap
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
|
|
|
ret
|
|
|
|
; d055c
|
|
|
|
|
|
|
|
Functiond055c: ; d055c
|
|
|
|
call Functiond02f2
|
2014-07-24 12:02:58 -07:00
|
|
|
jr z, .egg
|
|
|
|
|
|
|
|
ld c, BANK(UnownAnimations)
|
2013-12-17 21:23:50 -08:00
|
|
|
ld hl, UnownAnimationPointers
|
|
|
|
ld de, UnownAnimationExtraPointers
|
|
|
|
call Functiond02ec
|
|
|
|
jr z, .asm_d0576
|
2014-07-24 12:02:58 -07:00
|
|
|
ld c, BANK(PicAnimations)
|
2013-12-17 21:23:50 -08:00
|
|
|
ld hl, AnimationPointers
|
|
|
|
ld de, AnimationExtraPointers
|
|
|
|
.asm_d0576
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d172]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
|
|
|
jr z, .asm_d057e
|
|
|
|
ld h, d
|
|
|
|
ld l, e
|
|
|
|
.asm_d057e
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d16d]
|
2013-12-17 21:23:50 -08:00
|
|
|
dec a
|
|
|
|
ld e, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
|
|
|
add hl, de
|
|
|
|
ld a, c
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d174], a
|
2013-12-17 21:23:50 -08:00
|
|
|
call GetFarHalfword
|
|
|
|
ld a, l
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d175], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d176], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2014-07-24 12:02:58 -07:00
|
|
|
.egg
|
2013-12-17 21:23:50 -08:00
|
|
|
ld hl, EggAnimation
|
2014-07-24 12:02:58 -07:00
|
|
|
ld c, BANK(EggAnimation)
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d172]
|
2013-12-17 21:23:50 -08:00
|
|
|
and a
|
|
|
|
jr z, .asm_d05a7
|
|
|
|
ld hl, EggAnimationExtra
|
2014-07-24 12:02:58 -07:00
|
|
|
ld c, BANK(EggAnimationExtra)
|
2013-12-17 21:23:50 -08:00
|
|
|
.asm_d05a7
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, c
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d174], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, l
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d175], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d176], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d05b4
|
|
|
|
|
|
|
|
Functiond05b4: ; d05b4
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $1
|
|
|
|
ld [rSVBK], a
|
|
|
|
ld a, [CurPartySpecies]
|
|
|
|
ld [CurSpecies], a
|
|
|
|
call GetBaseData
|
|
|
|
ld a, [BasePicSize]
|
|
|
|
and $f
|
|
|
|
ld c, a
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
; d05ce
|
|
|
|
|
|
|
|
Functiond05ce: ; d05ce
|
|
|
|
call Functiond02f2
|
2014-07-24 12:02:58 -07:00
|
|
|
jr z, .egg
|
|
|
|
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond02ec
|
2014-07-24 12:02:58 -07:00
|
|
|
ld b, BANK(UnownFramesPointers)
|
|
|
|
ld c, BANK(UnownsFrames)
|
|
|
|
ld hl, UnownFramesPointers
|
2013-12-17 21:23:50 -08:00
|
|
|
jr z, .asm_d05ef
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d16b]
|
2014-07-24 12:02:58 -07:00
|
|
|
cp 151 + 1
|
|
|
|
ld b, BANK(FramesPointers)
|
|
|
|
ld c, BANK(KantoFrames)
|
|
|
|
ld hl, FramesPointers
|
2013-12-17 21:23:50 -08:00
|
|
|
jr c, .asm_d05ef
|
2014-07-24 12:02:58 -07:00
|
|
|
ld c, BANK(JohtoFrames)
|
2013-12-17 21:23:50 -08:00
|
|
|
.asm_d05ef
|
|
|
|
ld a, c
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d177], a
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d16d]
|
2013-12-17 21:23:50 -08:00
|
|
|
dec a
|
|
|
|
ld e, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
|
|
|
add hl, de
|
|
|
|
ld a, b
|
|
|
|
call GetFarHalfword
|
|
|
|
ld a, l
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d178], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d179], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2014-07-24 12:02:58 -07:00
|
|
|
.egg
|
|
|
|
ld hl, EggFrames
|
|
|
|
ld c, BANK(EggFrames)
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, c
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d177], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, l
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d178], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d179], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d061b
|
|
|
|
|
|
|
|
Functiond061b: ; d061b
|
|
|
|
call Functiond02f2
|
2014-07-24 12:02:58 -07:00
|
|
|
jr z, .egg
|
|
|
|
|
2013-12-17 21:23:50 -08:00
|
|
|
call Functiond02ec
|
2014-07-24 12:02:58 -07:00
|
|
|
ld a, BANK(UnownBitmasksPointers)
|
2013-12-17 21:23:50 -08:00
|
|
|
ld hl, UnownBitmasksPointers
|
|
|
|
jr z, .asm_d062f
|
2014-07-24 12:02:58 -07:00
|
|
|
ld a, BANK(BitmasksPointers)
|
2013-12-17 21:23:50 -08:00
|
|
|
ld hl, BitmasksPointers
|
|
|
|
.asm_d062f
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d17a], a
|
2014-07-24 12:02:58 -07:00
|
|
|
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d16d]
|
2013-12-17 21:23:50 -08:00
|
|
|
dec a
|
|
|
|
ld e, a
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
add hl, de
|
|
|
|
add hl, de
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d17a]
|
2013-12-17 21:23:50 -08:00
|
|
|
call GetFarHalfword
|
|
|
|
ld a, l
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d17b], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d17c], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
2014-07-24 12:02:58 -07:00
|
|
|
.egg
|
|
|
|
ld c, BANK(EggBitmasks)
|
2013-12-17 21:23:50 -08:00
|
|
|
ld hl, EggBitmasks
|
|
|
|
ld a, c
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d17a], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, l
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d17b], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ld a, h
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [w2_d17c], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d065c
|
|
|
|
|
|
|
|
Functiond065c: ; d065c
|
|
|
|
call Functiond02ec
|
|
|
|
jr z, .asm_d0665
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d16b]
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_d0665
|
2015-02-10 15:14:21 -08:00
|
|
|
ld a, [w2_d16c]
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
; d0669
|
|
|
|
|
|
|
|
Functiond0669: ; d0669
|
|
|
|
ld a, $1
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [wc2c6], a
|
2013-12-17 21:23:50 -08:00
|
|
|
|
|
|
|
Functiond066e: ; d066e
|
|
|
|
call Functiond01c6
|
|
|
|
jr c, .asm_d068c
|
|
|
|
ld h, d
|
|
|
|
ld l, e
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
ld de, VTiles2
|
2014-06-16 11:20:01 -07:00
|
|
|
predef Function5108b
|
2013-12-17 21:23:50 -08:00
|
|
|
pop hl
|
|
|
|
pop bc
|
2014-07-24 12:02:58 -07:00
|
|
|
ld d, 0
|
2013-12-17 21:23:50 -08:00
|
|
|
ld e, c
|
|
|
|
call Functiond008e
|
|
|
|
xor a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [wc2c6], a
|
2013-12-17 21:23:50 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_d068c
|
|
|
|
xor a
|
2015-02-10 15:14:21 -08:00
|
|
|
ld [wc2c6], a
|
2013-12-17 21:23:50 -08:00
|
|
|
inc a
|
|
|
|
ld [CurPartySpecies], a
|
|
|
|
ret
|
|
|
|
; d0695
|
|
|
|
|
|
|
|
|