2015-07-22 19:57:02 +00:00
|
|
|
Predef_LoadSGBLayout: ; 864c
|
2013-09-09 18:33:04 +00:00
|
|
|
; LoadSGBLayout
|
|
|
|
call CheckCGB
|
2015-07-22 19:57:02 +00:00
|
|
|
jp nz, Predef_LoadSGBLayoutCGB
|
2013-09-09 18:33:04 +00:00
|
|
|
|
|
|
|
ld a, b
|
|
|
|
cp $ff
|
|
|
|
jr nz, .asm_865a
|
|
|
|
ld a, [SGBPredef]
|
|
|
|
|
|
|
|
.asm_865a
|
|
|
|
cp $fc
|
|
|
|
jp z, Function8ade
|
|
|
|
ld l, a
|
|
|
|
ld h, 0
|
|
|
|
add hl, hl
|
2015-07-22 19:57:02 +00:00
|
|
|
ld de, .Jumptable
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2015-07-22 19:57:02 +00:00
|
|
|
ld de, .Finish
|
2013-09-09 18:33:04 +00:00
|
|
|
push de
|
|
|
|
jp [hl]
|
|
|
|
; 866f
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.Jumptable: ; 866f
|
|
|
|
dw .SGB00
|
|
|
|
dw .SGB01
|
|
|
|
dw .SGB02
|
|
|
|
dw .SGB03
|
|
|
|
dw .SGB04
|
|
|
|
dw .SGB05
|
|
|
|
dw .SGB06
|
|
|
|
dw .SGB07
|
|
|
|
dw .SGB08_1d
|
|
|
|
dw .SGB09
|
|
|
|
dw .SGB0a
|
|
|
|
dw .SGB0b
|
|
|
|
dw .SGB0c
|
|
|
|
dw .SGB0d_15
|
|
|
|
dw .SGB0e
|
|
|
|
dw .SGB0f
|
|
|
|
dw .SGB10
|
|
|
|
dw .SGB11
|
|
|
|
dw .SGB12
|
|
|
|
dw .SGB13
|
|
|
|
dw .SGB14
|
|
|
|
dw .SGB0d_15
|
|
|
|
dw .SGB16
|
|
|
|
dw .SGB17
|
|
|
|
dw .SGB18
|
|
|
|
dw .SGB19
|
|
|
|
dw .SGB1a
|
|
|
|
dw .SGB1b
|
|
|
|
dw .SGB1c
|
|
|
|
dw .SGB08_1d
|
|
|
|
dw .SGB1e
|
2013-09-09 18:33:04 +00:00
|
|
|
; 86ad
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB00: ; 86ad
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9c66
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, BlkPacket_9aa6
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 86b4
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB01: ; 86b4
|
2014-03-02 21:02:55 +00:00
|
|
|
ld hl, BlkPacket_9aa6
|
2013-09-09 18:33:04 +00:00
|
|
|
call Function9809
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-02-10 22:16:31 +00:00
|
|
|
ld de, wcda9
|
2013-09-09 18:33:04 +00:00
|
|
|
ld bc, $0010
|
|
|
|
call CopyBytes
|
|
|
|
ld a, [PlayerHPPal]
|
|
|
|
ld l, a
|
2014-03-02 21:02:55 +00:00
|
|
|
ld h, 0
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 2
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, hl
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, Palettes_a8be
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 3], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 4], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 5], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 6], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [EnemyHPPal]
|
|
|
|
ld l, a
|
|
|
|
ld h, $0
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 2
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, hl
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2015-02-07 05:07:35 +00:00
|
|
|
ld de, Palettes_a8be
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 9], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 10], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 11], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 12], a
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9cf6
|
2015-02-10 22:16:31 +00:00
|
|
|
ld de, wcda9 + $10
|
2013-09-09 18:33:04 +00:00
|
|
|
ld bc, $0010
|
|
|
|
call CopyBytes
|
|
|
|
call Function9729
|
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + $13], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + $14], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + $15], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + $16], a
|
2013-09-09 18:33:04 +00:00
|
|
|
call Function973a
|
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + $19], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + $1a], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + $1b], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + $1c], a
|
|
|
|
ld hl, wcda9
|
|
|
|
ld de, wcda9 + $10
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, $1
|
|
|
|
ld [SGBPredef], a
|
|
|
|
ret
|
|
|
|
; 873c
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB0e: ; 873c
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9bd6
|
2015-02-10 22:16:31 +00:00
|
|
|
ld de, wcda9
|
2013-09-09 18:33:04 +00:00
|
|
|
ld bc, $0010
|
|
|
|
call CopyBytes
|
2015-02-10 22:16:31 +00:00
|
|
|
ld hl, wcda9 + 1
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hl], $10
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 2
|
2013-09-09 18:33:04 +00:00
|
|
|
inc hl
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [PlayerHPPal]
|
|
|
|
add $2f
|
|
|
|
ld [hl], a
|
2015-02-10 22:16:31 +00:00
|
|
|
ld hl, wcda9
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, BlkPacket_9ad6
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 875c
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB02: ; 875c
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9c76
|
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 8763
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB03: ; 8763
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-02-10 22:16:31 +00:00
|
|
|
ld de, wcda9
|
2013-09-09 18:33:04 +00:00
|
|
|
ld bc, $0010
|
|
|
|
call CopyBytes
|
2015-02-10 22:16:31 +00:00
|
|
|
ld a, [wcda1]
|
2013-09-09 18:33:04 +00:00
|
|
|
ld l, a
|
|
|
|
ld h, $0
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 2
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, hl
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, Palettes_a8be
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 3], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 4], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 5], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 6], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [CurPartySpecies]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld bc, wd10e + 21
|
2013-09-09 18:33:04 +00:00
|
|
|
call Function974b
|
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 9], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 10], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 11], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 12], a
|
|
|
|
ld hl, wcda9
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, BlkPacket_9ac6
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 87ab
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB0a: ; 87ab
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9c56
|
2015-02-10 22:16:31 +00:00
|
|
|
ld de, wcda9 + 1
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 87b2
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB04: ; 87b2
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-02-10 22:16:31 +00:00
|
|
|
ld de, wcda9
|
2013-09-09 18:33:04 +00:00
|
|
|
ld bc, $0010
|
|
|
|
call CopyBytes
|
2015-02-10 22:16:31 +00:00
|
|
|
ld hl, wcda9 + 3
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hl], $9f
|
|
|
|
inc hl
|
|
|
|
ld [hl], $2a
|
|
|
|
inc hl
|
|
|
|
ld [hl], $5a
|
|
|
|
inc hl
|
|
|
|
ld [hl], $19
|
|
|
|
ld a, [CurPartySpecies]
|
|
|
|
call Function9775
|
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 9], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 10], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 11], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 12], a
|
|
|
|
ld hl, wcda9
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, BlkPacket_9ae6
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 87e9
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB17: ; 87e9
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-02-10 22:16:31 +00:00
|
|
|
ld de, wcda9
|
2013-09-09 18:33:04 +00:00
|
|
|
ld bc, $0010
|
|
|
|
call CopyBytes
|
2015-02-10 22:16:31 +00:00
|
|
|
ld hl, wcda9 + 3
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hl], $9f
|
|
|
|
inc hl
|
|
|
|
ld [hl], $2a
|
|
|
|
inc hl
|
|
|
|
ld [hl], $5a
|
|
|
|
inc hl
|
|
|
|
ld [hl], $19
|
|
|
|
ld a, [CurPartySpecies]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld bc, wd10e + 21
|
2013-09-09 18:33:04 +00:00
|
|
|
call Function974b
|
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 9], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 10], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 11], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 12], a
|
|
|
|
ld hl, wcda9
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, BlkPacket_9ae6
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 8823
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB16: ; 8823
|
|
|
|
call .SGB04
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, BlkPacket_9af6
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 882a
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB10: ; 882a
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-02-10 22:16:31 +00:00
|
|
|
ld de, wcda9
|
2013-09-09 18:33:04 +00:00
|
|
|
ld bc, $0010
|
|
|
|
call CopyBytes
|
2015-02-10 22:16:31 +00:00
|
|
|
ld hl, wcda9 + 3
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hl], $9f
|
|
|
|
inc hl
|
|
|
|
ld [hl], $2a
|
|
|
|
inc hl
|
|
|
|
ld [hl], $5a
|
|
|
|
inc hl
|
|
|
|
ld [hl], $19
|
2015-02-10 22:16:31 +00:00
|
|
|
ld hl, wcda9
|
2014-03-02 02:43:16 +00:00
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 884b
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB14: ; 884b
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9c36
|
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 8852
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB05: ; 8852
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9c96
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, BlkPacket_9b06
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 8859
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB06: ; 8859
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ca6
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, BlkPacket_9b76
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 8860
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB08_1d: ; 8860
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9cb6
|
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 8867
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB07: ; 8867
|
2014-03-02 21:02:55 +00:00
|
|
|
ld b, 0
|
2015-07-22 19:57:02 +00:00
|
|
|
ld hl, .BlkPacketTable_SGB07
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 4
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, bc
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2013-09-09 18:33:04 +00:00
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
|
|
|
inc hl
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
ret
|
|
|
|
; 8878
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.BlkPacketTable_SGB07: ; 8878
|
2014-03-02 21:02:55 +00:00
|
|
|
dw BlkPacket_9a86, PalPacket_9be6
|
|
|
|
dw BlkPacket_9a96, PalPacket_9c06
|
|
|
|
dw BlkPacket_9a86, PalPacket_9c16
|
|
|
|
; 8884
|
2013-09-09 18:33:04 +00:00
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB0c: ; 8884
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9b96
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, BlkPacket_9b56
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, $8
|
|
|
|
ld [SGBPredef], a
|
|
|
|
ret
|
|
|
|
; 8890
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB13: ; 8890
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ba6
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, BlkPacket_9b86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 8897
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB0f: ; 8897
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9c46
|
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 889e
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB11: ; 889e
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ld de, PlayerLightScreenCount
|
|
|
|
ld bc, $0010
|
|
|
|
call CopyBytes
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9bb6
|
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 88b1
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB09: ; 88b1
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9bd6
|
2015-02-10 22:16:31 +00:00
|
|
|
ld de, wcda9
|
2013-09-09 18:33:04 +00:00
|
|
|
ld bc, $0010
|
|
|
|
call CopyBytes
|
2015-07-22 19:57:02 +00:00
|
|
|
call .GetPermission
|
2015-02-10 22:16:31 +00:00
|
|
|
ld hl, wcda9 + 1
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hld], a
|
2014-03-02 02:43:16 +00:00
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, $9
|
|
|
|
ld [SGBPredef], a
|
|
|
|
ret
|
|
|
|
; 88cd
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB0b: ; 88cd
|
2013-09-09 18:33:04 +00:00
|
|
|
push bc
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-02-10 22:16:31 +00:00
|
|
|
ld de, wcda9
|
2013-09-09 18:33:04 +00:00
|
|
|
ld bc, $0010
|
|
|
|
call CopyBytes
|
|
|
|
pop bc
|
|
|
|
ld a, c
|
|
|
|
and a
|
|
|
|
jr z, .asm_88ef
|
2015-02-10 22:16:31 +00:00
|
|
|
ld hl, wcda9 + 3
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hl], $e7
|
|
|
|
inc hl
|
|
|
|
ld [hl], $1c
|
|
|
|
inc hl
|
|
|
|
ld [hl], $62
|
|
|
|
inc hl
|
|
|
|
ld [hl], $c
|
|
|
|
jr .asm_8913
|
|
|
|
|
|
|
|
.asm_88ef
|
|
|
|
ld hl, PartyMon1DVs
|
|
|
|
ld bc, $0030
|
|
|
|
ld a, [CurPartyMon]
|
|
|
|
call AddNTimes
|
|
|
|
ld c, l
|
|
|
|
ld b, h
|
|
|
|
ld a, [PlayerHPPal]
|
|
|
|
call Function974b
|
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 3], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 4], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 5], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 6], a
|
2013-09-09 18:33:04 +00:00
|
|
|
|
|
|
|
.asm_8913
|
2015-02-10 22:16:31 +00:00
|
|
|
ld hl, wcda9
|
2014-03-02 02:43:16 +00:00
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 891a
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB0d_15: ; 891a
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9cb6
|
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 8921
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB18: ; 8921
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9bc6
|
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 8928
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB12: ; 8928
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9bd6
|
2015-02-10 22:16:31 +00:00
|
|
|
ld de, wcda9
|
2013-09-09 18:33:04 +00:00
|
|
|
ld bc, $0010
|
|
|
|
call CopyBytes
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, BlkPacket_9a86
|
2015-02-10 22:16:31 +00:00
|
|
|
ld de, wcda9 + $10
|
2013-09-09 18:33:04 +00:00
|
|
|
ld bc, $0010
|
|
|
|
call CopyBytes
|
2015-07-22 19:57:02 +00:00
|
|
|
call .GetPermission
|
2015-02-10 22:16:31 +00:00
|
|
|
ld hl, wcda9 + 1
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hl], a
|
2015-02-10 22:16:31 +00:00
|
|
|
ld hl, wcda9 + 3
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hl], $2e
|
2015-02-10 22:16:31 +00:00
|
|
|
ld hl, wcda9 + $13
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, $5
|
|
|
|
ld [hli], a
|
2015-10-24 14:34:19 +00:00
|
|
|
ld a, [wMenuBorderLeftCoord]
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hli], a
|
2015-10-24 14:34:19 +00:00
|
|
|
ld a, [wMenuBorderTopCoord]
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hli], a
|
2015-10-24 14:34:19 +00:00
|
|
|
ld a, [wMenuBorderRightCoord]
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hli], a
|
2015-10-24 14:34:19 +00:00
|
|
|
ld a, [wMenuBorderBottomCoord]
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hl], a
|
2015-02-10 22:16:31 +00:00
|
|
|
ld hl, wcda9
|
|
|
|
ld de, wcda9 + $10
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 8969
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB1e: ; 8969
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-02-10 22:16:31 +00:00
|
|
|
ld de, wcda9
|
2013-09-09 18:33:04 +00:00
|
|
|
ld bc, $0010
|
|
|
|
call CopyBytes
|
|
|
|
ld a, [CurPartySpecies]
|
|
|
|
ld l, a
|
2014-03-02 21:02:55 +00:00
|
|
|
ld h, 0
|
2015-07-21 02:18:18 +00:00
|
|
|
rept 3
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, hl
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2014-04-13 04:03:21 +00:00
|
|
|
ld de, PokemonPalettes
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, de
|
2015-02-10 22:16:31 +00:00
|
|
|
ld a, [wcf65]
|
2014-03-02 21:02:55 +00:00
|
|
|
and 3
|
2013-09-09 18:33:04 +00:00
|
|
|
sla a
|
|
|
|
sla a
|
|
|
|
ld c, a
|
2014-03-02 21:02:55 +00:00
|
|
|
ld b, 0
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 3], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 4], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 5], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 6], a
|
|
|
|
ld hl, wcda9
|
2014-03-02 02:43:16 +00:00
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 89a6
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB19: ; 89a6
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9cd6
|
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 89ad
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB1a: ; 89ad
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-02-10 22:16:31 +00:00
|
|
|
ld de, wcda9
|
2013-09-09 18:33:04 +00:00
|
|
|
ld bc, $0010
|
|
|
|
call CopyBytes
|
|
|
|
ld a, [CurPartySpecies]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld bc, wd10e + 21
|
2013-09-09 18:33:04 +00:00
|
|
|
call Function974b
|
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 3], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 4], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 5], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 6], a
|
|
|
|
ld hl, wcda9
|
2014-03-02 02:43:16 +00:00
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 89d9
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB1b: ; 89d9
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9cc6
|
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 89e0
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.SGB1c: ; 89e0
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-02-10 22:16:31 +00:00
|
|
|
ld de, wcda9
|
2013-09-09 18:33:04 +00:00
|
|
|
ld bc, $0010
|
|
|
|
call CopyBytes
|
|
|
|
ld a, [CurPartySpecies]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld bc, wd10e + 21
|
2013-09-09 18:33:04 +00:00
|
|
|
call Function9764
|
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 3], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 4], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 5], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-02-10 22:16:31 +00:00
|
|
|
ld [wcda9 + 6], a
|
|
|
|
ld hl, wcda9
|
2014-03-02 02:43:16 +00:00
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 8a0c
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.GetPermission: ; 8a0c
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [TimeOfDayPal]
|
|
|
|
cp $2
|
|
|
|
jr c, .asm_8a16
|
|
|
|
ld a, $19
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_8a16
|
2015-07-21 04:02:21 +00:00
|
|
|
ld a, [wPermission]
|
2013-09-09 18:33:04 +00:00
|
|
|
cp $2
|
|
|
|
jr z, .asm_8a39
|
|
|
|
cp $4
|
|
|
|
jr z, .asm_8a3c
|
|
|
|
cp $7
|
|
|
|
jr z, .asm_8a3c
|
|
|
|
cp $5
|
|
|
|
jr z, .asm_8a3f
|
|
|
|
cp $6
|
|
|
|
jr z, .asm_8a42
|
|
|
|
ld a, [MapGroup]
|
|
|
|
ld e, a
|
2014-03-02 21:02:55 +00:00
|
|
|
ld d, 0
|
2015-07-22 19:57:02 +00:00
|
|
|
ld hl, .Unknown_8a45
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_8a39
|
|
|
|
ld a, $0
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_8a3c
|
|
|
|
ld a, $18
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_8a3f
|
|
|
|
ld a, $6
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_8a42
|
|
|
|
ld a, $3
|
|
|
|
ret
|
|
|
|
; 8a45
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.Unknown_8a45: ; 8a45
|
2014-03-02 21:02:55 +00:00
|
|
|
db $00
|
|
|
|
db $12
|
|
|
|
db $14
|
|
|
|
db $18
|
|
|
|
db $11
|
|
|
|
db $15
|
|
|
|
db $09
|
|
|
|
db $04
|
|
|
|
db $0f
|
|
|
|
db $16
|
|
|
|
db $0e
|
|
|
|
db $10
|
|
|
|
db $06
|
|
|
|
db $01
|
|
|
|
db $03
|
|
|
|
db $06
|
|
|
|
db $0b
|
|
|
|
db $08
|
|
|
|
db $05
|
|
|
|
db $17
|
|
|
|
db $08
|
|
|
|
db $07
|
|
|
|
db $13
|
|
|
|
db $02
|
|
|
|
db $0c
|
|
|
|
db $0a
|
|
|
|
db $0d
|
|
|
|
; 8a60
|
2013-09-09 18:33:04 +00:00
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.Finish: ; 8a60
|
2013-09-09 18:33:04 +00:00
|
|
|
push de
|
|
|
|
call Function9809
|
|
|
|
pop hl
|
|
|
|
jp Function9809
|
|
|
|
; 8a68
|