2018-06-24 07:09:41 -07:00
|
|
|
LoadSGBLayout:
|
2013-09-09 11:33:04 -07:00
|
|
|
call CheckCGB
|
2018-01-02 06:05:14 -08:00
|
|
|
jp nz, LoadSGBLayoutCGB
|
2013-09-09 11:33:04 -07:00
|
|
|
|
|
|
|
ld a, b
|
2020-07-04 13:18:16 -07:00
|
|
|
cp SCGB_DEFAULT
|
|
|
|
jr nz, .not_default
|
|
|
|
ld a, [wDefaultSGBLayout]
|
|
|
|
.not_default
|
|
|
|
cp SCGB_PARTY_MENU_HP_BARS
|
2015-12-22 19:19:33 -08:00
|
|
|
jp z, SGB_ApplyPartyMenuHPPals
|
2013-09-09 11:33:04 -07:00
|
|
|
ld l, a
|
|
|
|
ld h, 0
|
|
|
|
add hl, hl
|
2015-07-22 12:57:02 -07:00
|
|
|
ld de, .Jumptable
|
2013-09-09 11:33:04 -07:00
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2018-01-10 22:45:27 -08:00
|
|
|
ld de, _LoadSGBLayout_ReturnFromJumpTable
|
2013-09-09 11:33:04 -07:00
|
|
|
push de
|
2017-06-09 14:01:10 -07:00
|
|
|
jp hl
|
2013-09-09 11:33:04 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.Jumptable:
|
2015-12-28 07:57:04 -08:00
|
|
|
dw .SGB_BattleGrayscale
|
|
|
|
dw .SGB_BattleColors
|
|
|
|
dw .SGB_PokegearPals
|
|
|
|
dw .SGB_StatsScreenHPPals
|
2016-01-09 17:51:14 -08:00
|
|
|
dw .SGB_Pokedex
|
2015-12-28 07:57:04 -08:00
|
|
|
dw .SGB_SlotMachine
|
2018-09-16 10:40:47 -07:00
|
|
|
dw .SGB_BetaTitleScreen
|
2018-01-17 21:16:03 -08:00
|
|
|
dw .SGB_GSIntro
|
2016-06-06 15:23:00 -07:00
|
|
|
dw .SGB_Diploma
|
2015-12-28 07:57:04 -08:00
|
|
|
dw .SGB_MapPals
|
2016-06-06 15:23:00 -07:00
|
|
|
dw .SGB_PartyMenu
|
|
|
|
dw .SGB_Evolution
|
2018-01-17 21:16:03 -08:00
|
|
|
dw .SGB_GSTitleScreen
|
2020-10-28 10:35:39 -07:00
|
|
|
dw .SGB_Unused0D
|
2016-06-06 15:23:00 -07:00
|
|
|
dw .SGB_MoveList
|
2018-05-31 23:11:44 -07:00
|
|
|
dw .SGB_BetaPikachuMinigame
|
2016-01-09 19:56:37 -08:00
|
|
|
dw .SGB_PokedexSearchOption
|
2018-05-31 23:11:44 -07:00
|
|
|
dw .SGB_BetaPoker
|
2018-09-16 10:40:47 -07:00
|
|
|
dw .SGB_Pokepic
|
|
|
|
dw .SGB_MagnetTrain
|
2015-12-28 07:57:04 -08:00
|
|
|
dw .SGB_PackPals
|
|
|
|
dw .SGB_TrainerCard
|
2016-01-09 19:56:37 -08:00
|
|
|
dw .SGB_PokedexUnownMode
|
2016-06-06 15:23:00 -07:00
|
|
|
dw .SGB_BillsPC
|
|
|
|
dw .SGB_UnownPuzzle
|
2018-01-17 21:16:03 -08:00
|
|
|
dw .SGB_GamefreakLogo
|
2016-05-13 19:46:32 -07:00
|
|
|
dw .SGB_PlayerOrMonFrontpicPals
|
|
|
|
dw .SGB_TradeTube
|
|
|
|
dw .SGB_TrainerOrMonFrontpicPals
|
2016-06-06 15:23:00 -07:00
|
|
|
dw .SGB_MysteryGift
|
2020-10-28 10:35:39 -07:00
|
|
|
dw .SGB_Unused1E
|
2013-09-09 11:33:04 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_BattleGrayscale:
|
2018-01-17 21:16:03 -08:00
|
|
|
ld hl, PalPacket_BattleGrayscale
|
|
|
|
ld de, BlkPacket_Battle
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_BattleColors:
|
2018-01-17 21:16:03 -08:00
|
|
|
ld hl, BlkPacket_Battle
|
2018-07-22 21:13:43 -07:00
|
|
|
call PushSGBPals
|
2015-11-12 21:49:27 -08:00
|
|
|
|
2020-10-04 15:32:33 -07:00
|
|
|
ld hl, PalPacket_Pal01
|
2015-12-22 15:03:00 -08:00
|
|
|
ld de, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-09 11:33:04 -07:00
|
|
|
call CopyBytes
|
2015-11-12 21:49:27 -08:00
|
|
|
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPlayerHPPal]
|
2013-09-09 11:33:04 -07:00
|
|
|
ld l, a
|
2014-03-02 13:02:55 -08:00
|
|
|
ld h, 0
|
2013-09-09 11:33:04 -07:00
|
|
|
add hl, hl
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, hl
|
2017-12-15 19:36:33 -08:00
|
|
|
ld de, HPBarPals
|
2013-09-09 11:33:04 -07:00
|
|
|
add hl, de
|
2015-11-12 21:49:27 -08:00
|
|
|
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 3], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 4], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 5], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hl]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 6], a
|
2015-11-12 21:49:27 -08:00
|
|
|
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wEnemyHPPal]
|
2013-09-09 11:33:04 -07:00
|
|
|
ld l, a
|
2015-12-22 15:03:00 -08:00
|
|
|
ld h, 0
|
2013-09-09 11:33:04 -07:00
|
|
|
add hl, hl
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, hl
|
2015-11-12 21:49:27 -08:00
|
|
|
|
2017-12-15 19:36:33 -08:00
|
|
|
ld de, HPBarPals
|
2013-09-09 11:33:04 -07:00
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 9], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 10], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 11], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hl]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 12], a
|
2015-11-12 21:49:27 -08:00
|
|
|
|
2020-10-04 15:32:33 -07:00
|
|
|
ld hl, PalPacket_Pal23
|
2018-01-17 21:16:03 -08:00
|
|
|
ld de, wSGBPals + PALPACKET_LENGTH
|
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-09 11:33:04 -07:00
|
|
|
call CopyBytes
|
2015-11-12 21:49:27 -08:00
|
|
|
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetBattlemonBackpicPalettePointer
|
2015-11-12 21:49:27 -08:00
|
|
|
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [wSGBPals + 19], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [wSGBPals + 20], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [wSGBPals + 21], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hl]
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [wSGBPals + 22], a
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetEnemyFrontpicPalettePointer
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [wSGBPals + 25], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [wSGBPals + 26], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [wSGBPals + 27], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hl]
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [wSGBPals + 28], a
|
2015-11-12 21:49:27 -08:00
|
|
|
|
2015-12-22 15:03:00 -08:00
|
|
|
ld hl, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld de, wSGBPals + PALPACKET_LENGTH
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, SCGB_BATTLE_COLORS
|
2020-07-04 13:18:16 -07:00
|
|
|
ld [wDefaultSGBLayout], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_MoveList:
|
2020-10-04 16:43:28 -07:00
|
|
|
ld hl, PalPacket_AllPal0
|
2015-12-22 15:03:00 -08:00
|
|
|
ld de, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-09 11:33:04 -07:00
|
|
|
call CopyBytes
|
2015-11-12 21:49:27 -08:00
|
|
|
|
2015-12-22 15:03:00 -08:00
|
|
|
ld hl, wSGBPals + 1
|
2013-09-09 11:33:04 -07:00
|
|
|
ld [hl], $10
|
|
|
|
inc hl
|
2016-05-04 08:46:23 -07:00
|
|
|
inc hl
|
2015-11-12 21:49:27 -08:00
|
|
|
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPlayerHPPal]
|
2018-01-17 21:16:03 -08:00
|
|
|
add PREDEFPAL_HP_GREEN
|
2013-09-09 11:33:04 -07:00
|
|
|
ld [hl], a
|
2015-12-22 15:03:00 -08:00
|
|
|
ld hl, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld de, BlkPacket_MoveList
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_PokegearPals:
|
2018-01-17 21:16:03 -08:00
|
|
|
ld hl, PalPacket_Pokegear
|
2020-10-04 15:32:33 -07:00
|
|
|
ld de, BlkPacket_AllPal0
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_StatsScreenHPPals:
|
2020-10-04 15:32:33 -07:00
|
|
|
ld hl, PalPacket_Pal01
|
2015-12-22 15:03:00 -08:00
|
|
|
ld de, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-09 11:33:04 -07:00
|
|
|
call CopyBytes
|
2017-12-09 16:41:03 -08:00
|
|
|
ld a, [wCurHPPal]
|
2013-09-09 11:33:04 -07:00
|
|
|
ld l, a
|
2015-12-22 15:03:00 -08:00
|
|
|
ld h, 0
|
2013-09-09 11:33:04 -07:00
|
|
|
add hl, hl
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, hl
|
2017-12-15 19:36:33 -08:00
|
|
|
ld de, HPBarPals
|
2013-09-09 11:33:04 -07:00
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 3], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 4], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 5], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hl]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 6], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
|
|
|
ld bc, wTempMonDVs
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetPlayerOrMonPalettePointer
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 9], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 10], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 11], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hl]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 12], a
|
|
|
|
ld hl, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld de, BlkPacket_StatsScreen
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_PartyMenu:
|
2018-01-17 21:16:03 -08:00
|
|
|
ld hl, PalPacket_PartyMenu
|
2015-12-22 15:03:00 -08:00
|
|
|
ld de, wSGBPals + 1
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_Pokedex:
|
2020-10-04 15:32:33 -07:00
|
|
|
ld hl, PalPacket_Pal01
|
2015-12-22 15:03:00 -08:00
|
|
|
ld de, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-09 11:33:04 -07:00
|
|
|
call CopyBytes
|
2015-12-22 15:03:00 -08:00
|
|
|
ld hl, wSGBPals + 3
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [hl], LOW(palred 31 + palgreen 20 + palblue 10)
|
2013-09-09 11:33:04 -07:00
|
|
|
inc hl
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [hl], HIGH(palred 31 + palgreen 20 + palblue 10)
|
2013-09-09 11:33:04 -07:00
|
|
|
inc hl
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [hl], LOW(palred 26 + palgreen 10 + palblue 6)
|
2013-09-09 11:33:04 -07:00
|
|
|
inc hl
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [hl], HIGH(palred 26 + palgreen 10 + palblue 6)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
2018-07-22 21:13:43 -07:00
|
|
|
call GetMonPalettePointer
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 9], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 10], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 11], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hl]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 12], a
|
|
|
|
ld hl, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld de, BlkPacket_Pokedex_PC
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_BillsPC:
|
2020-10-04 15:32:33 -07:00
|
|
|
ld hl, PalPacket_Pal01
|
2015-12-22 15:03:00 -08:00
|
|
|
ld de, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-09 11:33:04 -07:00
|
|
|
call CopyBytes
|
2015-12-22 15:03:00 -08:00
|
|
|
ld hl, wSGBPals + 3
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [hl], LOW(palred 31 + palgreen 20 + palblue 10)
|
2013-09-09 11:33:04 -07:00
|
|
|
inc hl
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [hl], HIGH(palred 31 + palgreen 20 + palblue 10)
|
2013-09-09 11:33:04 -07:00
|
|
|
inc hl
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [hl], LOW(palred 26 + palgreen 10 + palblue 6)
|
2013-09-09 11:33:04 -07:00
|
|
|
inc hl
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [hl], HIGH(palred 26 + palgreen 10 + palblue 6)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
|
|
|
ld bc, wTempMonDVs
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetPlayerOrMonPalettePointer
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 9], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 10], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 11], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hl]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 12], a
|
|
|
|
ld hl, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld de, BlkPacket_Pokedex_PC
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_PokedexUnownMode:
|
2016-01-09 17:51:14 -08:00
|
|
|
call .SGB_Pokedex
|
2018-01-17 21:16:03 -08:00
|
|
|
ld de, BlkPacket_PokedexUnownMode
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_PokedexSearchOption:
|
2020-10-04 15:32:33 -07:00
|
|
|
ld hl, PalPacket_Pal01
|
2015-12-22 15:03:00 -08:00
|
|
|
ld de, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-09 11:33:04 -07:00
|
|
|
call CopyBytes
|
2015-12-22 15:03:00 -08:00
|
|
|
ld hl, wSGBPals + 3
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [hl], LOW(palred 31 + palgreen 20 + palblue 10)
|
2013-09-09 11:33:04 -07:00
|
|
|
inc hl
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [hl], HIGH(palred 31 + palgreen 20 + palblue 10)
|
2013-09-09 11:33:04 -07:00
|
|
|
inc hl
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [hl], LOW(palred 26 + palgreen 10 + palblue 6)
|
2013-09-09 11:33:04 -07:00
|
|
|
inc hl
|
2018-01-17 19:37:04 -08:00
|
|
|
ld [hl], HIGH(palred 26 + palgreen 10 + palblue 6)
|
2015-12-22 15:03:00 -08:00
|
|
|
ld hl, wSGBPals
|
2020-10-04 15:32:33 -07:00
|
|
|
ld de, BlkPacket_AllPal0
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_PackPals:
|
2018-01-17 21:16:03 -08:00
|
|
|
ld hl, PalPacket_Pack
|
2020-10-04 15:32:33 -07:00
|
|
|
ld de, BlkPacket_AllPal0
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_SlotMachine:
|
2018-01-17 21:16:03 -08:00
|
|
|
ld hl, PalPacket_SlotMachine
|
|
|
|
ld de, BlkPacket_SlotMachine
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-09-16 10:40:47 -07:00
|
|
|
.SGB_BetaTitleScreen:
|
|
|
|
ld hl, PalPacket_BetaTitleScreen
|
|
|
|
ld de, BlkPacket_BetaTitleScreen
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2016-06-06 15:23:00 -07:00
|
|
|
.SGB_Diploma:
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_MysteryGift:
|
2018-01-17 21:16:03 -08:00
|
|
|
ld hl, PalPacket_Diploma
|
2020-10-04 15:32:33 -07:00
|
|
|
ld de, BlkPacket_AllPal0
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_GSIntro:
|
2014-03-02 13:02:55 -08:00
|
|
|
ld b, 0
|
2018-01-17 21:16:03 -08:00
|
|
|
ld hl, .BlkPacketTable_GSIntro
|
2015-07-20 19:18:18 -07:00
|
|
|
rept 4
|
2013-09-09 11:33:04 -07:00
|
|
|
add hl, bc
|
2015-07-20 19:18:18 -07:00
|
|
|
endr
|
2013-09-09 11:33:04 -07:00
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
|
|
|
inc hl
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.BlkPacketTable_GSIntro:
|
2020-10-04 15:32:33 -07:00
|
|
|
dw BlkPacket_AllPal0, PalPacket_GSIntroShellderLapras
|
2018-01-17 21:16:03 -08:00
|
|
|
dw BlkPacket_GSIntroJigglypuffPikachu, PalPacket_GSIntroJigglypuffPikachu
|
2020-10-04 15:32:33 -07:00
|
|
|
dw BlkPacket_AllPal0, PalPacket_GSIntroStartersTransition
|
2013-09-09 11:33:04 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_GSTitleScreen:
|
2018-01-17 21:16:03 -08:00
|
|
|
ld hl, PalPacket_GSTitleScreen
|
|
|
|
ld de, BlkPacket_GSTitleScreen
|
2016-06-06 15:23:00 -07:00
|
|
|
ld a, SCGB_DIPLOMA
|
2020-07-04 13:18:16 -07:00
|
|
|
ld [wDefaultSGBLayout], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-09-16 10:40:47 -07:00
|
|
|
.SGB_MagnetTrain:
|
|
|
|
ld hl, PalPacket_MagnetTrain
|
|
|
|
ld de, BlkPacket_MagnetTrain
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_BetaPikachuMinigame:
|
2018-05-31 23:11:44 -07:00
|
|
|
ld hl, PalPacket_BetaPikachuMinigame
|
2020-10-04 15:32:33 -07:00
|
|
|
ld de, BlkPacket_AllPal0
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_BetaPoker:
|
2020-10-04 15:32:33 -07:00
|
|
|
ld hl, BlkPacket_AllPal0
|
2020-05-17 17:59:15 -07:00
|
|
|
ld de, wBetaPokerSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-09 11:33:04 -07:00
|
|
|
call CopyBytes
|
2018-05-31 23:11:44 -07:00
|
|
|
ld hl, PalPacket_BetaPoker
|
2020-10-04 15:32:33 -07:00
|
|
|
ld de, BlkPacket_AllPal0
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_MapPals:
|
2020-10-04 16:43:28 -07:00
|
|
|
ld hl, PalPacket_AllPal0
|
2015-12-22 15:03:00 -08:00
|
|
|
ld de, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-09 11:33:04 -07:00
|
|
|
call CopyBytes
|
2015-12-22 15:03:00 -08:00
|
|
|
call .GetMapPalsIndex
|
|
|
|
ld hl, wSGBPals + 1
|
2013-09-09 11:33:04 -07:00
|
|
|
ld [hld], a
|
2020-10-04 15:32:33 -07:00
|
|
|
ld de, BlkPacket_AllPal0
|
2015-12-22 15:03:00 -08:00
|
|
|
ld a, SCGB_MAPPALS
|
2020-07-04 13:18:16 -07:00
|
|
|
ld [wDefaultSGBLayout], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_Evolution:
|
2013-09-09 11:33:04 -07:00
|
|
|
push bc
|
2020-10-04 15:32:33 -07:00
|
|
|
ld hl, PalPacket_Pal01
|
2015-12-22 15:03:00 -08:00
|
|
|
ld de, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-09 11:33:04 -07:00
|
|
|
call CopyBytes
|
|
|
|
pop bc
|
|
|
|
ld a, c
|
|
|
|
and a
|
2015-12-22 19:19:33 -08:00
|
|
|
jr z, .partymon
|
2016-06-06 15:23:00 -07:00
|
|
|
; Egg
|
2015-12-22 15:03:00 -08:00
|
|
|
ld hl, wSGBPals + 3
|
2018-01-10 22:45:27 -08:00
|
|
|
ld [hl], LOW(palred 7 + palgreen 7 + palblue 7)
|
2013-09-09 11:33:04 -07:00
|
|
|
inc hl
|
2018-01-10 22:45:27 -08:00
|
|
|
ld [hl], HIGH(palred 7 + palgreen 7 + palblue 7)
|
2013-09-09 11:33:04 -07:00
|
|
|
inc hl
|
2018-01-10 22:45:27 -08:00
|
|
|
ld [hl], LOW(palred 2 + palgreen 3 + palblue 3)
|
2013-09-09 11:33:04 -07:00
|
|
|
inc hl
|
2018-01-10 22:45:27 -08:00
|
|
|
ld [hl], HIGH(palred 2 + palgreen 3 + palblue 3)
|
2015-12-22 19:19:33 -08:00
|
|
|
jr .done
|
2013-09-09 11:33:04 -07:00
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
.partymon
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyMon1DVs
|
2015-12-22 19:19:33 -08:00
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartyMon]
|
2013-09-09 11:33:04 -07:00
|
|
|
call AddNTimes
|
|
|
|
ld c, l
|
|
|
|
ld b, h
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPlayerHPPal]
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetPlayerOrMonPalettePointer
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 3], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 4], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 5], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hl]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 6], a
|
2013-09-09 11:33:04 -07:00
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
.done
|
2015-12-22 15:03:00 -08:00
|
|
|
ld hl, wSGBPals
|
2020-10-04 15:32:33 -07:00
|
|
|
ld de, BlkPacket_AllPal0
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2020-10-28 10:35:39 -07:00
|
|
|
.SGB_Unused0D:
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_TrainerCard:
|
2018-01-17 21:16:03 -08:00
|
|
|
ld hl, PalPacket_Diploma
|
2020-10-04 15:32:33 -07:00
|
|
|
ld de, BlkPacket_AllPal0
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_UnownPuzzle:
|
2018-01-17 21:16:03 -08:00
|
|
|
ld hl, PalPacket_UnownPuzzle
|
2020-10-04 15:32:33 -07:00
|
|
|
ld de, BlkPacket_AllPal0
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-09-16 10:40:47 -07:00
|
|
|
.SGB_Pokepic:
|
2020-10-04 16:43:28 -07:00
|
|
|
ld hl, PalPacket_AllPal0
|
2015-12-22 15:03:00 -08:00
|
|
|
ld de, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-09 11:33:04 -07:00
|
|
|
call CopyBytes
|
2020-10-04 15:32:33 -07:00
|
|
|
ld hl, BlkPacket_AllPal0
|
2018-01-17 21:16:03 -08:00
|
|
|
ld de, wSGBPals + PALPACKET_LENGTH
|
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-09 11:33:04 -07:00
|
|
|
call CopyBytes
|
2015-12-22 15:03:00 -08:00
|
|
|
call .GetMapPalsIndex
|
|
|
|
ld hl, wSGBPals + 1
|
2013-09-09 11:33:04 -07:00
|
|
|
ld [hl], a
|
2015-12-22 15:03:00 -08:00
|
|
|
ld hl, wSGBPals + 3
|
2013-09-09 11:33:04 -07:00
|
|
|
ld [hl], $2e
|
2015-12-22 15:03:00 -08:00
|
|
|
ld hl, wSGBPals + $13
|
|
|
|
ld a, 5
|
2013-09-09 11:33:04 -07:00
|
|
|
ld [hli], a
|
2015-10-24 07:34:19 -07:00
|
|
|
ld a, [wMenuBorderLeftCoord]
|
2013-09-09 11:33:04 -07:00
|
|
|
ld [hli], a
|
2015-10-24 07:34:19 -07:00
|
|
|
ld a, [wMenuBorderTopCoord]
|
2013-09-09 11:33:04 -07:00
|
|
|
ld [hli], a
|
2015-10-24 07:34:19 -07:00
|
|
|
ld a, [wMenuBorderRightCoord]
|
2013-09-09 11:33:04 -07:00
|
|
|
ld [hli], a
|
2015-10-24 07:34:19 -07:00
|
|
|
ld a, [wMenuBorderBottomCoord]
|
2013-09-09 11:33:04 -07:00
|
|
|
ld [hl], a
|
2015-12-22 15:03:00 -08:00
|
|
|
ld hl, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld de, wSGBPals + PALPACKET_LENGTH
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2020-10-28 10:35:39 -07:00
|
|
|
.SGB_Unused1E:
|
2020-10-04 15:32:33 -07:00
|
|
|
ld hl, PalPacket_Pal01
|
2015-12-22 15:03:00 -08:00
|
|
|
ld de, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-09 11:33:04 -07:00
|
|
|
call CopyBytes
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
2013-09-09 11:33:04 -07:00
|
|
|
ld l, a
|
2014-03-02 13:02:55 -08:00
|
|
|
ld h, 0
|
2013-09-09 11:33:04 -07:00
|
|
|
add hl, hl
|
2016-05-10 09:31:49 -07:00
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
2014-04-12 21:03:21 -07:00
|
|
|
ld de, PokemonPalettes
|
2013-09-09 11:33:04 -07:00
|
|
|
add hl, de
|
2020-10-28 10:35:39 -07:00
|
|
|
ld a, [wUnusedSGB1eColorOffset]
|
2014-03-02 13:02:55 -08:00
|
|
|
and 3
|
2013-09-09 11:33:04 -07:00
|
|
|
sla a
|
|
|
|
sla a
|
|
|
|
ld c, a
|
2014-03-02 13:02:55 -08:00
|
|
|
ld b, 0
|
2013-09-09 11:33:04 -07:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 3], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 4], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 5], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hl]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 6], a
|
|
|
|
ld hl, wSGBPals
|
2020-10-04 15:32:33 -07:00
|
|
|
ld de, BlkPacket_AllPal0
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_GamefreakLogo:
|
2018-01-17 21:16:03 -08:00
|
|
|
ld hl, PalPacket_GamefreakLogo
|
2020-10-04 15:32:33 -07:00
|
|
|
ld de, BlkPacket_AllPal0
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_PlayerOrMonFrontpicPals:
|
2020-10-04 15:32:33 -07:00
|
|
|
ld hl, PalPacket_Pal01
|
2015-12-22 15:03:00 -08:00
|
|
|
ld de, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-09 11:33:04 -07:00
|
|
|
call CopyBytes
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
|
|
|
ld bc, wTempMonDVs
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetPlayerOrMonPalettePointer
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 3], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 4], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 5], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hl]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 6], a
|
|
|
|
ld hl, wSGBPals
|
2020-10-04 15:32:33 -07:00
|
|
|
ld de, BlkPacket_AllPal0
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_TradeTube:
|
2018-01-17 21:16:03 -08:00
|
|
|
ld hl, PalPacket_TradeTube
|
2020-10-04 15:32:33 -07:00
|
|
|
ld de, BlkPacket_AllPal0
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.SGB_TrainerOrMonFrontpicPals:
|
2020-10-04 15:32:33 -07:00
|
|
|
ld hl, PalPacket_Pal01
|
2015-12-22 15:03:00 -08:00
|
|
|
ld de, wSGBPals
|
2018-01-17 21:16:03 -08:00
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-09 11:33:04 -07:00
|
|
|
call CopyBytes
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
|
|
|
ld bc, wTempMonDVs
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetFrontpicPalettePointer
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 3], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 4], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 5], a
|
2013-09-09 11:33:04 -07:00
|
|
|
ld a, [hl]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 6], a
|
|
|
|
ld hl, wSGBPals
|
2020-10-04 15:32:33 -07:00
|
|
|
ld de, BlkPacket_AllPal0
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.GetMapPalsIndex:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wTimeOfDayPal]
|
2017-12-10 22:02:28 -08:00
|
|
|
cp NITE_F
|
2015-12-22 15:03:00 -08:00
|
|
|
jr c, .morn_day
|
2018-01-17 19:48:57 -08:00
|
|
|
ld a, PREDEFPAL_NITE
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2015-12-22 15:03:00 -08:00
|
|
|
.morn_day
|
2017-12-24 10:08:38 -08:00
|
|
|
ld a, [wEnvironment]
|
2015-12-22 15:03:00 -08:00
|
|
|
cp ROUTE
|
|
|
|
jr z, .route
|
|
|
|
cp CAVE
|
|
|
|
jr z, .cave
|
|
|
|
cp DUNGEON
|
|
|
|
jr z, .cave
|
2017-12-24 10:08:38 -08:00
|
|
|
cp ENVIRONMENT_5
|
2018-09-16 10:40:47 -07:00
|
|
|
jr z, .env5
|
2015-12-22 15:03:00 -08:00
|
|
|
cp GATE
|
|
|
|
jr z, .gate
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wMapGroup]
|
2013-09-09 11:33:04 -07:00
|
|
|
ld e, a
|
2014-03-02 13:02:55 -08:00
|
|
|
ld d, 0
|
2018-01-10 22:45:27 -08:00
|
|
|
ld hl, MapGroupRoofSGBPalInds
|
2013-09-09 11:33:04 -07:00
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
|
|
|
ret
|
|
|
|
|
2015-12-22 15:03:00 -08:00
|
|
|
.route
|
2020-04-30 08:27:32 -07:00
|
|
|
ld a, PREDEFPAL_ROUTES
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2015-12-22 15:03:00 -08:00
|
|
|
.cave
|
2018-01-17 19:48:57 -08:00
|
|
|
ld a, PREDEFPAL_DUNGEONS
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-09-16 10:40:47 -07:00
|
|
|
.env5
|
2018-01-17 19:48:57 -08:00
|
|
|
ld a, PREDEFPAL_VERMILION
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2015-12-22 15:03:00 -08:00
|
|
|
.gate
|
2018-01-17 19:48:57 -08:00
|
|
|
ld a, PREDEFPAL_PEWTER
|
2013-09-09 11:33:04 -07:00
|
|
|
ret
|
|
|
|
|
2018-01-18 08:16:24 -08:00
|
|
|
INCLUDE "data/maps/sgb_roof_pal_inds.asm"
|
2018-01-10 22:45:27 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
_LoadSGBLayout_ReturnFromJumpTable:
|
2013-09-09 11:33:04 -07:00
|
|
|
push de
|
2018-07-22 21:13:43 -07:00
|
|
|
call PushSGBPals
|
2013-09-09 11:33:04 -07:00
|
|
|
pop hl
|
2018-07-22 21:13:43 -07:00
|
|
|
jp PushSGBPals
|