pokecrystal/engine/sgb_layouts.asm

606 lines
10 KiB
NASM
Raw Normal View History

LoadSGBLayout: ; 864c
2013-09-09 18:33:04 +00:00
call CheckCGB
2018-01-02 14:05:14 +00:00
jp nz, 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
ld de, .Jumptable
2013-09-09 18:33:04 +00:00
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
2018-01-11 06:45:27 +00:00
ld de, _LoadSGBLayout_ReturnFromJumpTable
2013-09-09 18:33:04 +00:00
push de
jp hl
2013-09-09 18:33:04 +00:00
; 866f
.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
dw .SGB06
2018-01-18 05:16:03 +00:00
dw .SGB_GSIntro
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
2018-01-18 05:16:03 +00:00
dw .SGB_GSTitleScreen
2015-11-13 05:49:27 +00:00
dw .SGB0d
2016-06-06 22:23:00 +00:00
dw .SGB_MoveList
dw .SGB0f
2016-01-10 03:56:37 +00:00
dw .SGB_PokedexSearchOption
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
2018-01-18 05:16:03 +00:00
dw .SGB_GamefreakLogo
dw .SGB_PlayerOrMonFrontpicPals
dw .SGB_TradeTube
dw .SGB_TrainerOrMonFrontpicPals
2016-06-06 22:23:00 +00:00
dw .SGB_MysteryGift
dw .SGB1e
2013-09-09 18:33:04 +00:00
; 86ad
2015-12-28 15:57:04 +00:00
.SGB_BattleGrayscale: ; 86ad
2018-01-18 05:16:03 +00:00
ld hl, PalPacket_BattleGrayscale
ld de, BlkPacket_Battle
2013-09-09 18:33:04 +00:00
ret
; 86b4
2015-12-28 15:57:04 +00:00
.SGB_BattleColors: ; 86b4
2018-01-18 05:16:03 +00:00
ld hl, BlkPacket_Battle
call PushSGBPals_
2015-11-13 05:49:27 +00:00
ld hl, PalPacket_9ce6
ld de, wSGBPals
2018-01-18 05:16:03 +00:00
ld bc, PALPACKET_LENGTH
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
ld h, 0
2013-09-09 18:33:04 +00:00
add hl, hl
add hl, hl
2017-12-16 03:36:33 +00:00
ld de, HPBarPals
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]
ld [wSGBPals + 3], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 4], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 5], a
2013-09-09 18:33:04 +00:00
ld a, [hl]
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
ld h, 0
2013-09-09 18:33:04 +00:00
add hl, hl
add hl, hl
2015-11-13 05:49:27 +00:00
2017-12-16 03:36:33 +00:00
ld de, HPBarPals
2013-09-09 18:33:04 +00:00
add hl, de
ld a, [hli]
ld [wSGBPals + 9], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 10], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 11], a
2013-09-09 18:33:04 +00:00
ld a, [hl]
ld [wSGBPals + 12], a
2015-11-13 05:49:27 +00:00
ld hl, PalPacket_9cf6
2018-01-18 05:16:03 +00:00
ld de, wSGBPals + PALPACKET_LENGTH
ld bc, PALPACKET_LENGTH
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]
ld [wSGBPals + 19], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 20], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 21], a
2013-09-09 18:33:04 +00:00
ld a, [hl]
ld [wSGBPals + 22], a
2015-12-17 02:57:42 +00:00
call GetEnemyFrontpicPalettePointer
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 25], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 26], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 27], a
2013-09-09 18:33:04 +00:00
ld a, [hl]
ld [wSGBPals + 28], a
2015-11-13 05:49:27 +00:00
ld hl, wSGBPals
2018-01-18 05:16:03 +00:00
ld de, wSGBPals + PALPACKET_LENGTH
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
ld hl, PalPacket_9bd6
ld de, wSGBPals
2018-01-18 05:16:03 +00:00
ld bc, PALPACKET_LENGTH
2013-09-09 18:33:04 +00:00
call CopyBytes
2015-11-13 05:49:27 +00:00
ld hl, wSGBPals + 1
2013-09-09 18:33:04 +00:00
ld [hl], $10
inc hl
inc hl
2015-11-13 05:49:27 +00:00
2013-09-09 18:33:04 +00:00
ld a, [PlayerHPPal]
2018-01-18 05:16:03 +00:00
add PREDEFPAL_HP_GREEN
2013-09-09 18:33:04 +00:00
ld [hl], a
ld hl, wSGBPals
2018-01-18 05:16:03 +00:00
ld de, BlkPacket_MoveList
2013-09-09 18:33:04 +00:00
ret
; 875c
2015-12-28 15:57:04 +00:00
.SGB_PokegearPals: ; 875c
2018-01-18 05:16:03 +00:00
ld hl, PalPacket_Pokegear
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
ld hl, PalPacket_9ce6
ld de, wSGBPals
2018-01-18 05:16:03 +00:00
ld bc, PALPACKET_LENGTH
2013-09-09 18:33:04 +00:00
call CopyBytes
2017-12-10 00:41:03 +00:00
ld a, [wCurHPPal]
2013-09-09 18:33:04 +00:00
ld l, a
ld h, 0
2013-09-09 18:33:04 +00:00
add hl, hl
add hl, hl
2017-12-16 03:36:33 +00:00
ld de, HPBarPals
2013-09-09 18:33:04 +00:00
add hl, de
ld a, [hli]
ld [wSGBPals + 3], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 4], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 5], a
2013-09-09 18:33:04 +00:00
ld a, [hl]
ld [wSGBPals + 6], a
2013-09-09 18:33:04 +00:00
ld a, [CurPartySpecies]
ld bc, TempMonDVs
2015-12-17 02:57:42 +00:00
call GetPlayerOrMonPalettePointer
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 9], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 10], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 11], a
2013-09-09 18:33:04 +00:00
ld a, [hl]
ld [wSGBPals + 12], a
ld hl, wSGBPals
2018-01-18 05:16:03 +00:00
ld de, BlkPacket_StatsScreen
2013-09-09 18:33:04 +00:00
ret
; 87ab
2016-06-06 22:23:00 +00:00
.SGB_PartyMenu: ; 87ab
2018-01-18 05:16:03 +00:00
ld hl, PalPacket_PartyMenu
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
ld hl, PalPacket_9ce6
ld de, wSGBPals
2018-01-18 05:16:03 +00:00
ld bc, PALPACKET_LENGTH
2013-09-09 18:33:04 +00:00
call CopyBytes
ld hl, wSGBPals + 3
ld [hl], LOW(palred 31 + palgreen 20 + palblue 10)
2013-09-09 18:33:04 +00:00
inc hl
ld [hl], HIGH(palred 31 + palgreen 20 + palblue 10)
2013-09-09 18:33:04 +00:00
inc hl
ld [hl], LOW(palred 26 + palgreen 10 + palblue 6)
2013-09-09 18:33:04 +00:00
inc hl
ld [hl], HIGH(palred 26 + palgreen 10 + palblue 6)
2013-09-09 18:33:04 +00:00
ld a, [CurPartySpecies]
2015-12-17 02:57:42 +00:00
call GetMonPalettePointer_
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 9], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 10], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 11], a
2013-09-09 18:33:04 +00:00
ld a, [hl]
ld [wSGBPals + 12], a
ld hl, wSGBPals
2018-01-18 05:16:03 +00:00
ld de, BlkPacket_Pokedex_PC
2013-09-09 18:33:04 +00:00
ret
; 87e9
2016-06-06 22:23:00 +00:00
.SGB_BillsPC: ; 87e9
ld hl, PalPacket_9ce6
ld de, wSGBPals
2018-01-18 05:16:03 +00:00
ld bc, PALPACKET_LENGTH
2013-09-09 18:33:04 +00:00
call CopyBytes
ld hl, wSGBPals + 3
ld [hl], LOW(palred 31 + palgreen 20 + palblue 10)
2013-09-09 18:33:04 +00:00
inc hl
ld [hl], HIGH(palred 31 + palgreen 20 + palblue 10)
2013-09-09 18:33:04 +00:00
inc hl
ld [hl], LOW(palred 26 + palgreen 10 + palblue 6)
2013-09-09 18:33:04 +00:00
inc hl
ld [hl], HIGH(palred 26 + palgreen 10 + palblue 6)
2013-09-09 18:33:04 +00:00
ld a, [CurPartySpecies]
ld bc, TempMonDVs
2015-12-17 02:57:42 +00:00
call GetPlayerOrMonPalettePointer
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 9], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 10], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 11], a
2013-09-09 18:33:04 +00:00
ld a, [hl]
ld [wSGBPals + 12], a
ld hl, wSGBPals
2018-01-18 05:16:03 +00:00
ld de, BlkPacket_Pokedex_PC
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
2018-01-18 05:16:03 +00:00
ld de, BlkPacket_PokedexUnownMode
2013-09-09 18:33:04 +00:00
ret
; 882a
2016-01-10 03:56:37 +00:00
.SGB_PokedexSearchOption: ; 882a
ld hl, PalPacket_9ce6
ld de, wSGBPals
2018-01-18 05:16:03 +00:00
ld bc, PALPACKET_LENGTH
2013-09-09 18:33:04 +00:00
call CopyBytes
ld hl, wSGBPals + 3
ld [hl], LOW(palred 31 + palgreen 20 + palblue 10)
2013-09-09 18:33:04 +00:00
inc hl
ld [hl], HIGH(palred 31 + palgreen 20 + palblue 10)
2013-09-09 18:33:04 +00:00
inc hl
ld [hl], LOW(palred 26 + palgreen 10 + palblue 6)
2013-09-09 18:33:04 +00:00
inc hl
ld [hl], HIGH(palred 26 + palgreen 10 + palblue 6)
ld hl, wSGBPals
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
2018-01-18 05:16:03 +00:00
ld hl, PalPacket_Pack
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
2018-01-18 05:16:03 +00:00
ld hl, PalPacket_SlotMachine
ld de, BlkPacket_SlotMachine
2013-09-09 18:33:04 +00:00
ret
; 8859
.SGB06: ; 8859
2018-01-18 05:16:03 +00:00
ld hl, PalPacket_SCGB_06
ld de, BlkPacket_SCGB_06
2013-09-09 18:33:04 +00:00
ret
; 8860
2016-06-06 22:23:00 +00:00
.SGB_Diploma:
.SGB_MysteryGift: ; 8860
2018-01-18 05:16:03 +00:00
ld hl, PalPacket_Diploma
ld de, BlkPacket_9a86
2013-09-09 18:33:04 +00:00
ret
; 8867
2018-01-18 05:16:03 +00:00
.SGB_GSIntro: ; 8867
ld b, 0
2018-01-18 05:16:03 +00:00
ld hl, .BlkPacketTable_GSIntro
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
2018-01-18 05:16:03 +00:00
.BlkPacketTable_GSIntro: ; 8878
dw BlkPacket_9a86, PalPacket_GSIntroShellderLapras
dw BlkPacket_GSIntroJigglypuffPikachu, PalPacket_GSIntroJigglypuffPikachu
2018-01-18 20:06:43 +00:00
dw BlkPacket_9a86, PalPacket_GSIntroStartersTransition
; 8884
2013-09-09 18:33:04 +00:00
2018-01-18 05:16:03 +00:00
.SGB_GSTitleScreen: ; 8884
ld hl, PalPacket_GSTitleScreen
ld de, BlkPacket_GSTitleScreen
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
.SGB13: ; 8890
2018-01-18 05:16:03 +00:00
ld hl, PalPacket_SCGB_13
ld de, BlkPacket_SCGB_13
2013-09-09 18:33:04 +00:00
ret
; 8897
.SGB0f: ; 8897
2018-01-18 05:16:03 +00:00
ld hl, PalPacket_SCGB_0F
ld de, BlkPacket_9a86
2013-09-09 18:33:04 +00:00
ret
; 889e
.SGB11: ; 889e
ld hl, BlkPacket_9a86
2018-01-18 05:16:03 +00:00
ld de, PlayerLightScreenCount ; ???
ld bc, PALPACKET_LENGTH
2013-09-09 18:33:04 +00:00
call CopyBytes
2018-01-18 05:16:03 +00:00
ld hl, PalPacket_SCGB_11
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
ld hl, PalPacket_9bd6
ld de, wSGBPals
2018-01-18 05:16:03 +00:00
ld bc, PALPACKET_LENGTH
2013-09-09 18:33:04 +00:00
call CopyBytes
call .GetMapPalsIndex
ld hl, wSGBPals + 1
2013-09-09 18:33:04 +00:00
ld [hld], a
ld de, BlkPacket_9a86
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
ld hl, PalPacket_9ce6
ld de, wSGBPals
2018-01-18 05:16:03 +00:00
ld bc, PALPACKET_LENGTH
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
ld hl, wSGBPals + 3
2018-01-11 06:45:27 +00:00
ld [hl], LOW(palred 7 + palgreen 7 + palblue 7)
2013-09-09 18:33:04 +00:00
inc hl
2018-01-11 06:45:27 +00:00
ld [hl], HIGH(palred 7 + palgreen 7 + palblue 7)
2013-09-09 18:33:04 +00:00
inc hl
2018-01-11 06:45:27 +00:00
ld [hl], LOW(palred 2 + palgreen 3 + palblue 3)
2013-09-09 18:33:04 +00:00
inc hl
2018-01-11 06:45:27 +00:00
ld [hl], HIGH(palred 2 + palgreen 3 + palblue 3)
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]
ld [wSGBPals + 3], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 4], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 5], a
2013-09-09 18:33:04 +00:00
ld a, [hl]
ld [wSGBPals + 6], a
2013-09-09 18:33:04 +00:00
2015-12-23 03:19:33 +00:00
.done
ld hl, wSGBPals
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
2018-01-18 05:16:03 +00:00
ld hl, PalPacket_Diploma
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
2018-01-18 05:16:03 +00:00
ld hl, PalPacket_UnownPuzzle
ld de, BlkPacket_9a86
2013-09-09 18:33:04 +00:00
ret
; 8928
.SGB12: ; 8928
ld hl, PalPacket_9bd6
ld de, wSGBPals
2018-01-18 05:16:03 +00:00
ld bc, PALPACKET_LENGTH
2013-09-09 18:33:04 +00:00
call CopyBytes
ld hl, BlkPacket_9a86
2018-01-18 05:16:03 +00:00
ld de, wSGBPals + PALPACKET_LENGTH
ld bc, PALPACKET_LENGTH
2013-09-09 18:33:04 +00:00
call CopyBytes
call .GetMapPalsIndex
ld hl, wSGBPals + 1
2013-09-09 18:33:04 +00:00
ld [hl], a
ld hl, wSGBPals + 3
2013-09-09 18:33:04 +00:00
ld [hl], $2e
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
ld hl, wSGBPals
2018-01-18 05:16:03 +00:00
ld de, wSGBPals + PALPACKET_LENGTH
2013-09-09 18:33:04 +00:00
ret
; 8969
.SGB1e: ; 8969
ld hl, PalPacket_9ce6
ld de, wSGBPals
2018-01-18 05:16:03 +00:00
ld bc, PALPACKET_LENGTH
2013-09-09 18:33:04 +00:00
call CopyBytes
ld a, [CurPartySpecies]
ld l, a
ld h, 0
2013-09-09 18:33:04 +00:00
add hl, hl
add hl, hl
add hl, hl
ld de, PokemonPalettes
2013-09-09 18:33:04 +00:00
add hl, de
ld a, [wcf65]
and 3
2013-09-09 18:33:04 +00:00
sla a
sla a
ld c, a
ld b, 0
2013-09-09 18:33:04 +00:00
add hl, bc
ld a, [hli]
ld [wSGBPals + 3], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 4], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 5], a
2013-09-09 18:33:04 +00:00
ld a, [hl]
ld [wSGBPals + 6], a
ld hl, wSGBPals
ld de, BlkPacket_9a86
2013-09-09 18:33:04 +00:00
ret
; 89a6
2018-01-18 05:16:03 +00:00
.SGB_GamefreakLogo: ; 89a6
ld hl, PalPacket_GamefreakLogo
ld de, BlkPacket_9a86
2013-09-09 18:33:04 +00:00
ret
; 89ad
.SGB_PlayerOrMonFrontpicPals: ; 89ad
ld hl, PalPacket_9ce6
ld de, wSGBPals
2018-01-18 05:16:03 +00:00
ld bc, PALPACKET_LENGTH
2013-09-09 18:33:04 +00:00
call CopyBytes
ld a, [CurPartySpecies]
ld bc, TempMonDVs
2015-12-17 02:57:42 +00:00
call GetPlayerOrMonPalettePointer
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 3], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 4], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 5], a
2013-09-09 18:33:04 +00:00
ld a, [hl]
ld [wSGBPals + 6], a
ld hl, wSGBPals
ld de, BlkPacket_9a86
2013-09-09 18:33:04 +00:00
ret
; 89d9
.SGB_TradeTube: ; 89d9
2018-01-18 05:16:03 +00:00
ld hl, PalPacket_TradeTube
ld de, BlkPacket_9a86
2013-09-09 18:33:04 +00:00
ret
; 89e0
.SGB_TrainerOrMonFrontpicPals: ; 89e0
ld hl, PalPacket_9ce6
ld de, wSGBPals
2018-01-18 05:16:03 +00:00
ld bc, PALPACKET_LENGTH
2013-09-09 18:33:04 +00:00
call CopyBytes
ld a, [CurPartySpecies]
ld bc, TempMonDVs
2015-12-17 02:57:42 +00:00
call GetFrontpicPalettePointer
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 3], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 4], a
2013-09-09 18:33:04 +00:00
ld a, [hli]
ld [wSGBPals + 5], a
2013-09-09 18:33:04 +00:00
ld a, [hl]
ld [wSGBPals + 6], a
ld hl, wSGBPals
ld de, BlkPacket_9a86
2013-09-09 18:33:04 +00:00
ret
; 8a0c
.GetMapPalsIndex: ; 8a0c
2013-09-09 18:33:04 +00:00
ld a, [TimeOfDayPal]
cp NITE_F
jr c, .morn_day
2018-01-18 03:48:57 +00:00
ld a, PREDEFPAL_NITE
2013-09-09 18:33:04 +00:00
ret
.morn_day
ld a, [wEnvironment]
cp ROUTE
jr z, .route
cp CAVE
jr z, .cave
cp DUNGEON
jr z, .cave
cp ENVIRONMENT_5
jr z, .perm5
cp GATE
jr z, .gate
2013-09-09 18:33:04 +00:00
ld a, [MapGroup]
ld e, a
ld d, 0
2018-01-11 06:45:27 +00:00
ld hl, MapGroupRoofSGBPalInds
2013-09-09 18:33:04 +00:00
add hl, de
ld a, [hl]
ret
.route
ld a, PREDEFPAL_00
2013-09-09 18:33:04 +00:00
ret
.cave
2018-01-18 03:48:57 +00:00
ld a, PREDEFPAL_DUNGEONS
2013-09-09 18:33:04 +00:00
ret
.perm5
2018-01-18 03:48:57 +00:00
ld a, PREDEFPAL_VERMILION
2013-09-09 18:33:04 +00:00
ret
.gate
2018-01-18 03:48:57 +00:00
ld a, PREDEFPAL_PEWTER
2013-09-09 18:33:04 +00:00
ret
; 8a45
INCLUDE "data/maps/sgb_roof_pal_inds.asm"
2018-01-11 06:45:27 +00:00
_LoadSGBLayout_ReturnFromJumpTable: ; 8a60
2013-09-09 18:33:04 +00:00
push de
call PushSGBPals_
2013-09-09 18:33:04 +00:00
pop hl
jp PushSGBPals_
2013-09-09 18:33:04 +00:00
; 8a68