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
|
2015-11-20 20:15:32 +00:00
|
|
|
cp SCGB_RAM
|
|
|
|
jr nz, .not_ram
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [SGBPredef]
|
2015-11-20 20:15:32 +00:00
|
|
|
.not_ram
|
2015-12-23 03:19:33 +00:00
|
|
|
cp SCGB_PARTY_MENU_HP_PALS
|
|
|
|
jp z, SGB_ApplyPartyMenuHPPals
|
2013-09-09 18:33:04 +00:00
|
|
|
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
|
2017-06-09 21:01:10 +00:00
|
|
|
jp hl
|
2013-09-09 18:33:04 +00:00
|
|
|
; 866f
|
|
|
|
|
2015-07-22 19:57:02 +00:00
|
|
|
.Jumptable: ; 866f
|
2015-12-28 15:57:04 +00:00
|
|
|
dw .SGB_BattleGrayscale
|
|
|
|
dw .SGB_BattleColors
|
|
|
|
dw .SGB_PokegearPals
|
|
|
|
dw .SGB_StatsScreenHPPals
|
2016-01-10 01:51:14 +00:00
|
|
|
dw .SGB_Pokedex
|
2015-12-28 15:57:04 +00:00
|
|
|
dw .SGB_SlotMachine
|
2015-07-22 19:57:02 +00:00
|
|
|
dw .SGB06
|
|
|
|
dw .SGB07
|
2016-06-06 22:23:00 +00:00
|
|
|
dw .SGB_Diploma
|
2015-12-28 15:57:04 +00:00
|
|
|
dw .SGB_MapPals
|
2016-06-06 22:23:00 +00:00
|
|
|
dw .SGB_PartyMenu
|
|
|
|
dw .SGB_Evolution
|
2015-07-22 19:57:02 +00:00
|
|
|
dw .SGB0c
|
2015-11-13 05:49:27 +00:00
|
|
|
dw .SGB0d
|
2016-06-06 22:23:00 +00:00
|
|
|
dw .SGB_MoveList
|
2015-07-22 19:57:02 +00:00
|
|
|
dw .SGB0f
|
2016-01-10 03:56:37 +00:00
|
|
|
dw .SGB_PokedexSearchOption
|
2015-07-22 19:57:02 +00:00
|
|
|
dw .SGB11
|
|
|
|
dw .SGB12
|
|
|
|
dw .SGB13
|
2015-12-28 15:57:04 +00:00
|
|
|
dw .SGB_PackPals
|
|
|
|
dw .SGB_TrainerCard
|
2016-01-10 03:56:37 +00:00
|
|
|
dw .SGB_PokedexUnownMode
|
2016-06-06 22:23:00 +00:00
|
|
|
dw .SGB_BillsPC
|
|
|
|
dw .SGB_UnownPuzzle
|
2015-07-22 19:57:02 +00:00
|
|
|
dw .SGB19
|
2016-05-14 02:46:32 +00:00
|
|
|
dw .SGB_PlayerOrMonFrontpicPals
|
|
|
|
dw .SGB_TradeTube
|
|
|
|
dw .SGB_TrainerOrMonFrontpicPals
|
2016-06-06 22:23:00 +00:00
|
|
|
dw .SGB_MysteryGift
|
2015-07-22 19:57:02 +00:00
|
|
|
dw .SGB1e
|
2013-09-09 18:33:04 +00:00
|
|
|
; 86ad
|
|
|
|
|
2015-12-28 15:57:04 +00:00
|
|
|
.SGB_BattleGrayscale: ; 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-12-28 15:57:04 +00:00
|
|
|
.SGB_BattleColors: ; 86b4
|
2014-03-02 21:02:55 +00:00
|
|
|
ld hl, BlkPacket_9aa6
|
2016-05-11 13:49:03 +00:00
|
|
|
call PushSGBPals_
|
2015-11-13 05:49:27 +00:00
|
|
|
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-12-22 23:03:00 +00:00
|
|
|
ld de, wSGBPals
|
|
|
|
ld bc, $10
|
2013-09-09 18:33:04 +00:00
|
|
|
call CopyBytes
|
2015-11-13 05:49:27 +00:00
|
|
|
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [PlayerHPPal]
|
|
|
|
ld l, a
|
2014-03-02 21:02:55 +00:00
|
|
|
ld h, 0
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, hl
|
2016-05-04 15:46:23 +00:00
|
|
|
add hl, hl
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, Palettes_a8be
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, de
|
2015-11-13 05:49:27 +00:00
|
|
|
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 3], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 4], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 5], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 6], a
|
2015-11-13 05:49:27 +00:00
|
|
|
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [EnemyHPPal]
|
|
|
|
ld l, a
|
2015-12-22 23:03:00 +00:00
|
|
|
ld h, 0
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, hl
|
2016-05-04 15:46:23 +00:00
|
|
|
add hl, hl
|
2015-11-13 05:49:27 +00:00
|
|
|
|
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-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 9], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 10], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 11], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 12], a
|
2015-11-13 05:49:27 +00:00
|
|
|
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9cf6
|
2015-12-22 23:03:00 +00:00
|
|
|
ld de, wSGBPals + $10
|
|
|
|
ld bc, $10
|
2013-09-09 18:33:04 +00:00
|
|
|
call CopyBytes
|
2015-11-13 05:49:27 +00:00
|
|
|
|
2015-12-17 02:57:42 +00:00
|
|
|
call GetBattlemonBackpicPalettePointer
|
2015-11-13 05:49:27 +00:00
|
|
|
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + $13], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + $14], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + $15], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + $16], a
|
2015-12-17 02:57:42 +00:00
|
|
|
call GetEnemyFrontpicPalettePointer
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + $19], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + $1a], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + $1b], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + $1c], a
|
2015-11-13 05:49:27 +00:00
|
|
|
|
2015-12-22 23:03:00 +00:00
|
|
|
ld hl, wSGBPals
|
|
|
|
ld de, wSGBPals + $10
|
2015-12-28 15:57:04 +00:00
|
|
|
ld a, SCGB_BATTLE_COLORS
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [SGBPredef], a
|
|
|
|
ret
|
|
|
|
; 873c
|
|
|
|
|
2016-06-06 22:23:00 +00:00
|
|
|
.SGB_MoveList: ; 873c
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9bd6
|
2015-12-22 23:03:00 +00:00
|
|
|
ld de, wSGBPals
|
|
|
|
ld bc, $10
|
2013-09-09 18:33:04 +00:00
|
|
|
call CopyBytes
|
2015-11-13 05:49:27 +00:00
|
|
|
|
2015-12-22 23:03:00 +00:00
|
|
|
ld hl, wSGBPals + 1
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hl], $10
|
|
|
|
inc hl
|
2016-05-04 15:46:23 +00:00
|
|
|
inc hl
|
2015-11-13 05:49:27 +00:00
|
|
|
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [PlayerHPPal]
|
|
|
|
add $2f
|
|
|
|
ld [hl], a
|
2015-12-22 23:03:00 +00:00
|
|
|
ld hl, wSGBPals
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, BlkPacket_9ad6
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 875c
|
|
|
|
|
2015-12-28 15:57:04 +00:00
|
|
|
.SGB_PokegearPals: ; 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-12-28 15:57:04 +00:00
|
|
|
.SGB_StatsScreenHPPals: ; 8763
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-12-22 23:03:00 +00:00
|
|
|
ld de, wSGBPals
|
|
|
|
ld bc, $10
|
2013-09-09 18:33:04 +00:00
|
|
|
call CopyBytes
|
2015-02-10 22:16:31 +00:00
|
|
|
ld a, [wcda1]
|
2013-09-09 18:33:04 +00:00
|
|
|
ld l, a
|
2015-12-22 23:03:00 +00:00
|
|
|
ld h, 0
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, hl
|
2016-05-04 15:46:23 +00:00
|
|
|
add hl, hl
|
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-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 3], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 4], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 5], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 6], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [CurPartySpecies]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld bc, TempMonDVs
|
2015-12-17 02:57:42 +00:00
|
|
|
call GetPlayerOrMonPalettePointer
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 9], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 10], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 11], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 12], a
|
|
|
|
ld hl, wSGBPals
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, BlkPacket_9ac6
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 87ab
|
|
|
|
|
2016-06-06 22:23:00 +00:00
|
|
|
.SGB_PartyMenu: ; 87ab
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9c56
|
2015-12-22 23:03:00 +00:00
|
|
|
ld de, wSGBPals + 1
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 87b2
|
|
|
|
|
2016-01-10 01:51:14 +00:00
|
|
|
.SGB_Pokedex: ; 87b2
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-12-22 23:03:00 +00:00
|
|
|
ld de, wSGBPals
|
|
|
|
ld bc, $10
|
2013-09-09 18:33:04 +00:00
|
|
|
call CopyBytes
|
2015-12-22 23:03:00 +00:00
|
|
|
ld hl, wSGBPals + 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-12-17 02:57:42 +00:00
|
|
|
call GetMonPalettePointer_
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 9], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 10], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 11], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 12], a
|
|
|
|
ld hl, wSGBPals
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, BlkPacket_9ae6
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 87e9
|
|
|
|
|
2016-06-06 22:23:00 +00:00
|
|
|
.SGB_BillsPC: ; 87e9
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-12-22 23:03:00 +00:00
|
|
|
ld de, wSGBPals
|
|
|
|
ld bc, $10
|
2013-09-09 18:33:04 +00:00
|
|
|
call CopyBytes
|
2015-12-22 23:03:00 +00:00
|
|
|
ld hl, wSGBPals + 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-12-22 23:03:00 +00:00
|
|
|
ld bc, TempMonDVs
|
2015-12-17 02:57:42 +00:00
|
|
|
call GetPlayerOrMonPalettePointer
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 9], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 10], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 11], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 12], a
|
|
|
|
ld hl, wSGBPals
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, BlkPacket_9ae6
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 8823
|
|
|
|
|
2016-01-10 03:56:37 +00:00
|
|
|
.SGB_PokedexUnownMode: ; 8823
|
2016-01-10 01:51:14 +00:00
|
|
|
call .SGB_Pokedex
|
2014-03-02 21:02:55 +00:00
|
|
|
ld de, BlkPacket_9af6
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 882a
|
|
|
|
|
2016-01-10 03:56:37 +00:00
|
|
|
.SGB_PokedexSearchOption: ; 882a
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-12-22 23:03:00 +00:00
|
|
|
ld de, wSGBPals
|
|
|
|
ld bc, $10
|
2013-09-09 18:33:04 +00:00
|
|
|
call CopyBytes
|
2015-12-22 23:03:00 +00:00
|
|
|
ld hl, wSGBPals + 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-12-22 23:03:00 +00:00
|
|
|
ld hl, wSGBPals
|
2014-03-02 02:43:16 +00:00
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 884b
|
|
|
|
|
2015-12-28 15:57:04 +00:00
|
|
|
.SGB_PackPals: ; 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-12-28 15:57:04 +00:00
|
|
|
.SGB_SlotMachine: ; 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
|
|
|
|
|
2016-06-06 22:23:00 +00:00
|
|
|
.SGB_Diploma:
|
|
|
|
.SGB_MysteryGift: ; 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
|
2016-06-06 22:23:00 +00:00
|
|
|
ld a, SCGB_DIPLOMA
|
2013-09-09 18:33:04 +00:00
|
|
|
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
|
2015-12-22 23:03:00 +00:00
|
|
|
ld bc, $10
|
2013-09-09 18:33:04 +00:00
|
|
|
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-12-28 15:57:04 +00:00
|
|
|
.SGB_MapPals: ; 88b1
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9bd6
|
2015-12-22 23:03:00 +00:00
|
|
|
ld de, wSGBPals
|
|
|
|
ld bc, $10
|
2013-09-09 18:33:04 +00:00
|
|
|
call CopyBytes
|
2015-12-22 23:03:00 +00:00
|
|
|
call .GetMapPalsIndex
|
|
|
|
ld hl, wSGBPals + 1
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hld], a
|
2014-03-02 02:43:16 +00:00
|
|
|
ld de, BlkPacket_9a86
|
2015-12-22 23:03:00 +00:00
|
|
|
ld a, SCGB_MAPPALS
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [SGBPredef], a
|
|
|
|
ret
|
|
|
|
; 88cd
|
|
|
|
|
2016-06-06 22:23:00 +00:00
|
|
|
.SGB_Evolution: ; 88cd
|
2013-09-09 18:33:04 +00:00
|
|
|
push bc
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-12-22 23:03:00 +00:00
|
|
|
ld de, wSGBPals
|
|
|
|
ld bc, $10
|
2013-09-09 18:33:04 +00:00
|
|
|
call CopyBytes
|
|
|
|
pop bc
|
|
|
|
ld a, c
|
|
|
|
and a
|
2015-12-23 03:19:33 +00:00
|
|
|
jr z, .partymon
|
2016-06-06 22:23:00 +00:00
|
|
|
; Egg
|
2015-12-22 23:03:00 +00:00
|
|
|
ld hl, wSGBPals + 3
|
2016-06-06 22:23:00 +00:00
|
|
|
; RGB 7, 7, 7
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hl], $e7
|
|
|
|
inc hl
|
|
|
|
ld [hl], $1c
|
|
|
|
inc hl
|
2016-06-06 22:23:00 +00:00
|
|
|
; RGB 2, 3, 3
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hl], $62
|
|
|
|
inc hl
|
|
|
|
ld [hl], $c
|
2015-12-23 03:19:33 +00:00
|
|
|
jr .done
|
2013-09-09 18:33:04 +00:00
|
|
|
|
2015-12-23 03:19:33 +00:00
|
|
|
.partymon
|
2013-09-09 18:33:04 +00:00
|
|
|
ld hl, PartyMon1DVs
|
2015-12-23 03:19:33 +00:00
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [CurPartyMon]
|
|
|
|
call AddNTimes
|
|
|
|
ld c, l
|
|
|
|
ld b, h
|
|
|
|
ld a, [PlayerHPPal]
|
2015-12-17 02:57:42 +00:00
|
|
|
call GetPlayerOrMonPalettePointer
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 3], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 4], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 5], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 6], a
|
2013-09-09 18:33:04 +00:00
|
|
|
|
2015-12-23 03:19:33 +00:00
|
|
|
.done
|
2015-12-22 23:03:00 +00:00
|
|
|
ld hl, wSGBPals
|
2014-03-02 02:43:16 +00:00
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 891a
|
|
|
|
|
2015-11-13 05:49:27 +00:00
|
|
|
.SGB0d:
|
2015-12-28 15:57:04 +00:00
|
|
|
.SGB_TrainerCard: ; 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
|
|
|
|
|
2016-06-06 22:23:00 +00:00
|
|
|
.SGB_UnownPuzzle: ; 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-12-22 23:03:00 +00:00
|
|
|
ld de, wSGBPals
|
|
|
|
ld bc, $10
|
2013-09-09 18:33:04 +00:00
|
|
|
call CopyBytes
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, BlkPacket_9a86
|
2015-12-22 23:03:00 +00:00
|
|
|
ld de, wSGBPals + $10
|
|
|
|
ld bc, $10
|
2013-09-09 18:33:04 +00:00
|
|
|
call CopyBytes
|
2015-12-22 23:03:00 +00:00
|
|
|
call .GetMapPalsIndex
|
|
|
|
ld hl, wSGBPals + 1
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hl], a
|
2015-12-22 23:03:00 +00:00
|
|
|
ld hl, wSGBPals + 3
|
2013-09-09 18:33:04 +00:00
|
|
|
ld [hl], $2e
|
2015-12-22 23:03:00 +00:00
|
|
|
ld hl, wSGBPals + $13
|
|
|
|
ld a, 5
|
2013-09-09 18:33:04 +00:00
|
|
|
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-12-22 23:03:00 +00:00
|
|
|
ld hl, wSGBPals
|
|
|
|
ld de, wSGBPals + $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-12-22 23:03:00 +00:00
|
|
|
ld de, wSGBPals
|
|
|
|
ld bc, $10
|
2013-09-09 18:33:04 +00:00
|
|
|
call CopyBytes
|
|
|
|
ld a, [CurPartySpecies]
|
|
|
|
ld l, a
|
2014-03-02 21:02:55 +00:00
|
|
|
ld h, 0
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, hl
|
2016-05-10 16:31:49 +00:00
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
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-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 3], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 4], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 5], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 6], a
|
|
|
|
ld hl, wSGBPals
|
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
|
|
|
|
|
2016-05-14 02:46:32 +00:00
|
|
|
.SGB_PlayerOrMonFrontpicPals: ; 89ad
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-12-22 23:03:00 +00:00
|
|
|
ld de, wSGBPals
|
|
|
|
ld bc, $10
|
2013-09-09 18:33:04 +00:00
|
|
|
call CopyBytes
|
|
|
|
ld a, [CurPartySpecies]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld bc, TempMonDVs
|
2015-12-17 02:57:42 +00:00
|
|
|
call GetPlayerOrMonPalettePointer
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 3], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 4], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 5], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 6], a
|
|
|
|
ld hl, wSGBPals
|
2014-03-02 02:43:16 +00:00
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 89d9
|
|
|
|
|
2016-05-14 02:46:32 +00:00
|
|
|
.SGB_TradeTube: ; 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
|
|
|
|
|
2016-05-14 02:46:32 +00:00
|
|
|
.SGB_TrainerOrMonFrontpicPals: ; 89e0
|
2014-03-02 02:43:16 +00:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-12-22 23:03:00 +00:00
|
|
|
ld de, wSGBPals
|
|
|
|
ld bc, $10
|
2013-09-09 18:33:04 +00:00
|
|
|
call CopyBytes
|
|
|
|
ld a, [CurPartySpecies]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld bc, TempMonDVs
|
2015-12-17 02:57:42 +00:00
|
|
|
call GetFrontpicPalettePointer
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 3], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 4], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hli]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 5], a
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [hl]
|
2015-12-22 23:03:00 +00:00
|
|
|
ld [wSGBPals + 6], a
|
|
|
|
ld hl, wSGBPals
|
2014-03-02 02:43:16 +00:00
|
|
|
ld de, BlkPacket_9a86
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 8a0c
|
|
|
|
|
2015-12-22 23:03:00 +00:00
|
|
|
.GetMapPalsIndex: ; 8a0c
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [TimeOfDayPal]
|
2015-12-22 23:03:00 +00:00
|
|
|
cp NITE
|
|
|
|
jr c, .morn_day
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, $19
|
|
|
|
ret
|
|
|
|
|
2015-12-22 23:03:00 +00:00
|
|
|
.morn_day
|
2015-07-21 04:02:21 +00:00
|
|
|
ld a, [wPermission]
|
2015-12-22 23:03:00 +00:00
|
|
|
cp ROUTE
|
|
|
|
jr z, .route
|
|
|
|
cp CAVE
|
|
|
|
jr z, .cave
|
|
|
|
cp DUNGEON
|
|
|
|
jr z, .cave
|
|
|
|
cp PERM_5
|
|
|
|
jr z, .perm5
|
|
|
|
cp GATE
|
|
|
|
jr z, .gate
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, [MapGroup]
|
|
|
|
ld e, a
|
2014-03-02 21:02:55 +00:00
|
|
|
ld d, 0
|
2015-12-22 23:03:00 +00:00
|
|
|
ld hl, .SGBRoofPalInds
|
2013-09-09 18:33:04 +00:00
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
|
|
|
ret
|
|
|
|
|
2015-12-22 23:03:00 +00:00
|
|
|
.route
|
|
|
|
ld a, $00
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-22 23:03:00 +00:00
|
|
|
.cave
|
2013-09-09 18:33:04 +00:00
|
|
|
ld a, $18
|
|
|
|
ret
|
|
|
|
|
2015-12-22 23:03:00 +00:00
|
|
|
.perm5
|
|
|
|
ld a, $06
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-22 23:03:00 +00:00
|
|
|
.gate
|
|
|
|
ld a, $03
|
2013-09-09 18:33:04 +00:00
|
|
|
ret
|
|
|
|
; 8a45
|
|
|
|
|
2015-12-22 23:03:00 +00:00
|
|
|
.SGBRoofPalInds: ; 8a45
|
|
|
|
db $00 ; Unused
|
|
|
|
db $12 ; Olivine
|
|
|
|
db $14 ; Mahogany
|
|
|
|
db $18 ; Various Dungeons
|
|
|
|
db $11 ; Ecruteak
|
|
|
|
db $15 ; Blackthorn
|
|
|
|
db $09 ; Cinnabar
|
|
|
|
db $04 ; Cerulean
|
|
|
|
db $0f ; Azalea
|
|
|
|
db $16 ; Lake Of Rage
|
|
|
|
db $0e ; Violet
|
|
|
|
db $10 ; Goldenrod
|
|
|
|
db $06 ; Vermilion
|
|
|
|
db $01 ; Palette
|
|
|
|
db $03 ; Pewter
|
|
|
|
db $06 ; Fast Ship
|
|
|
|
db $0b ; Indigo Plateau
|
|
|
|
db $08 ; Fuchsia
|
|
|
|
db $05 ; Lavender
|
|
|
|
db $17 ; Silver Cave Outside
|
|
|
|
db $08 ; Pokemon Center 2F
|
|
|
|
db $07 ; Celadon
|
|
|
|
db $13 ; Cianwood
|
|
|
|
db $02 ; Viridian
|
|
|
|
db $0c ; New Bark
|
|
|
|
db $0a ; Saffron
|
|
|
|
db $0d ; Cherrygrove
|
2014-03-02 21:02:55 +00:00
|
|
|
; 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
|
2016-05-11 13:49:03 +00:00
|
|
|
call PushSGBPals_
|
2013-09-09 18:33:04 +00:00
|
|
|
pop hl
|
2016-05-11 13:49:03 +00:00
|
|
|
jp PushSGBPals_
|
2013-09-09 18:33:04 +00:00
|
|
|
; 8a68
|