2022-10-12 21:41:08 -04:00
|
|
|
DEF SHINY_ATK_MASK EQU %0010
|
|
|
|
DEF SHINY_DEF_DV EQU 10
|
|
|
|
DEF SHINY_SPD_DV EQU 10
|
|
|
|
DEF SHINY_SPC_DV EQU 10
|
2013-09-15 18:02:02 -04:00
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
CheckShininess:
|
2013-09-15 18:02:02 -04:00
|
|
|
; Check if a mon is shiny by DVs at bc.
|
|
|
|
; Return carry if shiny.
|
|
|
|
|
|
|
|
ld l, c
|
|
|
|
ld h, b
|
|
|
|
|
|
|
|
; Attack
|
|
|
|
ld a, [hl]
|
2022-10-12 21:41:08 -04:00
|
|
|
and SHINY_ATK_MASK << 4
|
2020-10-26 15:45:57 -04:00
|
|
|
jr z, .not_shiny
|
2013-09-15 18:02:02 -04:00
|
|
|
|
|
|
|
; Defense
|
|
|
|
ld a, [hli]
|
2022-10-12 21:41:08 -04:00
|
|
|
and %1111
|
|
|
|
cp SHINY_DEF_DV
|
2020-10-26 15:45:57 -04:00
|
|
|
jr nz, .not_shiny
|
2013-09-15 18:02:02 -04:00
|
|
|
|
|
|
|
; Speed
|
|
|
|
ld a, [hl]
|
2022-10-12 21:41:08 -04:00
|
|
|
and %1111 << 4
|
|
|
|
cp SHINY_SPD_DV << 4
|
2020-10-26 15:45:57 -04:00
|
|
|
jr nz, .not_shiny
|
2013-09-15 18:02:02 -04:00
|
|
|
|
|
|
|
; Special
|
|
|
|
ld a, [hl]
|
2022-10-12 21:41:08 -04:00
|
|
|
and %1111
|
|
|
|
cp SHINY_SPC_DV
|
2020-10-26 15:45:57 -04:00
|
|
|
jr nz, .not_shiny
|
2013-09-15 18:02:02 -04:00
|
|
|
|
2020-10-26 15:45:57 -04:00
|
|
|
; shiny
|
2013-09-15 18:02:02 -04:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2020-10-26 15:45:57 -04:00
|
|
|
.not_shiny
|
2013-09-15 18:02:02 -04:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-04 23:36:27 -04:00
|
|
|
Unused_CheckShininess:
|
|
|
|
; Return carry if the DVs at hl are all 10 or higher.
|
2013-09-15 18:02:02 -04:00
|
|
|
|
|
|
|
; Attack
|
|
|
|
ld a, [hl]
|
|
|
|
cp 10 << 4
|
2020-10-26 15:45:57 -04:00
|
|
|
jr c, .not_shiny
|
2013-09-15 18:02:02 -04:00
|
|
|
|
|
|
|
; Defense
|
|
|
|
ld a, [hli]
|
2022-10-12 21:41:08 -04:00
|
|
|
and %1111
|
2013-09-15 18:02:02 -04:00
|
|
|
cp 10
|
2020-10-26 15:45:57 -04:00
|
|
|
jr c, .not_shiny
|
2013-09-15 18:02:02 -04:00
|
|
|
|
|
|
|
; Speed
|
|
|
|
ld a, [hl]
|
|
|
|
cp 10 << 4
|
2020-10-26 15:45:57 -04:00
|
|
|
jr c, .not_shiny
|
2013-09-15 18:02:02 -04:00
|
|
|
|
|
|
|
; Special
|
|
|
|
ld a, [hl]
|
2022-10-12 21:41:08 -04:00
|
|
|
and %1111
|
2013-09-15 18:02:02 -04:00
|
|
|
cp 10
|
2020-10-26 15:45:57 -04:00
|
|
|
jr c, .not_shiny
|
2013-09-15 18:02:02 -04:00
|
|
|
|
2020-10-26 15:45:57 -04:00
|
|
|
; shiny
|
2013-09-15 18:02:02 -04:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2020-10-26 15:45:57 -04:00
|
|
|
.not_shiny
|
2013-09-15 18:02:02 -04:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
InitPartyMenuPalettes:
|
2023-07-26 17:01:20 +02:00
|
|
|
ld hl, FourPals_PartyMenu
|
2015-10-21 10:43:42 -04:00
|
|
|
call CopyFourPalettes
|
2015-12-28 10:57:04 -05:00
|
|
|
call InitPartyMenuOBPals
|
2020-02-13 18:30:13 +01:00
|
|
|
call WipeAttrmap
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2016-05-11 09:49:03 -04:00
|
|
|
LoadTrainerClassPaletteAsNthBGPal:
|
2018-01-23 17:39:09 -05:00
|
|
|
ld a, [wTrainerClass]
|
2015-12-16 21:57:42 -05:00
|
|
|
call GetTrainerPalettePointer
|
2013-09-15 18:02:02 -04:00
|
|
|
ld a, e
|
2020-04-04 17:46:36 -04:00
|
|
|
jr LoadNthMiddleBGPal
|
2013-09-15 18:02:02 -04:00
|
|
|
|
2016-05-11 09:49:03 -04:00
|
|
|
LoadMonPaletteAsNthBGPal:
|
2018-01-23 17:39:09 -05:00
|
|
|
ld a, [wCurPartySpecies]
|
2018-07-23 00:13:43 -04:00
|
|
|
call _GetMonPalettePointer
|
2013-09-15 18:02:02 -04:00
|
|
|
ld a, e
|
|
|
|
bit 7, a
|
2020-04-04 17:46:36 -04:00
|
|
|
jr z, LoadNthMiddleBGPal
|
2013-09-15 18:02:02 -04:00
|
|
|
and $7f
|
|
|
|
inc hl
|
2016-05-11 09:49:03 -04:00
|
|
|
inc hl
|
|
|
|
inc hl
|
|
|
|
inc hl
|
2015-02-05 23:59:50 -08:00
|
|
|
|
2020-04-04 17:46:36 -04:00
|
|
|
LoadNthMiddleBGPal:
|
2013-09-15 18:02:02 -04:00
|
|
|
push hl
|
2018-01-01 15:08:21 +01:00
|
|
|
ld hl, wBGPals1
|
2016-05-11 09:49:03 -04:00
|
|
|
ld de, 1 palettes
|
|
|
|
.loop
|
2013-09-15 18:02:02 -04:00
|
|
|
and a
|
2016-05-11 09:49:03 -04:00
|
|
|
jr z, .got_addr
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, de
|
|
|
|
dec a
|
2016-05-11 09:49:03 -04:00
|
|
|
jr .loop
|
2013-09-15 18:02:02 -04:00
|
|
|
|
2016-05-11 09:49:03 -04:00
|
|
|
.got_addr
|
2013-09-15 18:02:02 -04:00
|
|
|
ld e, l
|
|
|
|
ld d, h
|
|
|
|
pop hl
|
2015-12-16 21:57:42 -05:00
|
|
|
call LoadPalette_White_Col1_Col2_Black
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2020-10-04 22:34:50 -04:00
|
|
|
LoadBetaPokerPalettes: ; unreferenced
|
2020-05-17 20:59:15 -04:00
|
|
|
ld a, [wBetaPokerSGBCol]
|
2013-09-15 18:02:02 -04:00
|
|
|
ld c, a
|
2020-05-17 20:59:15 -04:00
|
|
|
ld a, [wBetaPokerSGBRow]
|
2020-02-13 18:30:13 +01:00
|
|
|
hlcoord 0, 0, wAttrmap
|
2016-05-11 09:49:03 -04:00
|
|
|
ld de, SCREEN_WIDTH
|
|
|
|
.loop
|
2013-09-15 18:02:02 -04:00
|
|
|
and a
|
2016-05-11 09:49:03 -04:00
|
|
|
jr z, .done
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, de
|
|
|
|
dec a
|
2016-05-11 09:49:03 -04:00
|
|
|
jr .loop
|
2013-09-15 18:02:02 -04:00
|
|
|
|
2016-05-11 09:49:03 -04:00
|
|
|
.done
|
2020-05-17 20:59:15 -04:00
|
|
|
ld b, 0
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, bc
|
2015-10-21 10:43:42 -04:00
|
|
|
lb bc, 6, 4
|
2020-05-17 20:59:15 -04:00
|
|
|
ld a, [wBetaPokerSGBAttr]
|
2013-09-15 18:02:02 -04:00
|
|
|
and $3
|
2015-11-13 00:49:27 -05:00
|
|
|
call FillBoxCGB
|
2017-12-24 18:11:17 -05:00
|
|
|
call CopyTilemapAtOnce
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
ApplyMonOrTrainerPals:
|
2013-09-15 18:02:02 -04:00
|
|
|
ld a, e
|
|
|
|
and a
|
2015-12-26 18:11:55 -05:00
|
|
|
jr z, .get_trainer
|
2018-01-23 17:39:09 -05:00
|
|
|
ld a, [wCurPartySpecies]
|
2018-07-23 00:13:43 -04:00
|
|
|
call GetMonPalettePointer
|
2015-12-26 18:11:55 -05:00
|
|
|
jr .load_palettes
|
2013-09-15 18:02:02 -04:00
|
|
|
|
2015-12-26 18:11:55 -05:00
|
|
|
.get_trainer
|
2018-01-23 17:39:09 -05:00
|
|
|
ld a, [wTrainerClass]
|
2015-12-16 21:57:42 -05:00
|
|
|
call GetTrainerPalettePointer
|
2013-09-15 18:02:02 -04:00
|
|
|
|
2015-12-26 18:11:55 -05:00
|
|
|
.load_palettes
|
2018-01-01 15:08:21 +01:00
|
|
|
ld de, wBGPals1
|
2015-12-16 21:57:42 -05:00
|
|
|
call LoadPalette_White_Col1_Col2_Black
|
2020-02-13 18:30:13 +01:00
|
|
|
call WipeAttrmap
|
|
|
|
call ApplyAttrmap
|
2015-12-16 21:57:42 -05:00
|
|
|
call ApplyPals
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
ApplyHPBarPals:
|
2015-12-26 18:11:55 -05:00
|
|
|
ld a, [wWhichHPBar]
|
2013-09-15 18:02:02 -04:00
|
|
|
and a
|
2015-12-26 18:11:55 -05:00
|
|
|
jr z, .Enemy
|
2013-09-15 18:02:02 -04:00
|
|
|
cp $1
|
2015-12-26 18:11:55 -05:00
|
|
|
jr z, .Player
|
2013-09-15 18:02:02 -04:00
|
|
|
cp $2
|
2015-12-26 18:11:55 -05:00
|
|
|
jr z, .PartyMenu
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2016-04-10 14:42:14 -04:00
|
|
|
.Enemy:
|
2018-01-22 19:40:17 -05:00
|
|
|
ld de, wBGPals2 palette PAL_BATTLE_BG_ENEMY_HP color 1
|
2015-12-26 18:11:55 -05:00
|
|
|
jr .okay
|
2013-09-15 18:02:02 -04:00
|
|
|
|
2016-04-10 14:42:14 -04:00
|
|
|
.Player:
|
2018-01-22 19:40:17 -05:00
|
|
|
ld de, wBGPals2 palette PAL_BATTLE_BG_PLAYER_HP color 1
|
2013-09-15 18:02:02 -04:00
|
|
|
|
2015-12-26 18:11:55 -05:00
|
|
|
.okay
|
2013-09-15 18:02:02 -04:00
|
|
|
ld l, c
|
|
|
|
ld h, $0
|
|
|
|
add hl, hl
|
2015-12-26 21:59:03 -05:00
|
|
|
add hl, hl
|
2017-12-15 22:36:33 -05:00
|
|
|
ld bc, HPBarPals
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, bc
|
2015-12-26 18:11:55 -05:00
|
|
|
ld bc, 4
|
2018-01-04 14:53:50 -05:00
|
|
|
ld a, BANK(wBGPals2)
|
2013-09-15 18:02:02 -04:00
|
|
|
call FarCopyWRAM
|
2020-08-03 23:41:01 +02:00
|
|
|
ld a, TRUE
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [hCGBPalUpdate], a
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2016-04-10 14:42:14 -04:00
|
|
|
.PartyMenu:
|
2013-09-15 18:02:02 -04:00
|
|
|
ld e, c
|
|
|
|
inc e
|
2020-02-13 18:30:13 +01:00
|
|
|
hlcoord 11, 1, wAttrmap
|
2015-12-26 18:11:55 -05:00
|
|
|
ld bc, 2 * SCREEN_WIDTH
|
2018-01-23 17:39:09 -05:00
|
|
|
ld a, [wCurPartyMon]
|
2015-12-26 18:11:55 -05:00
|
|
|
.loop
|
2013-09-15 18:02:02 -04:00
|
|
|
and a
|
2015-12-26 18:11:55 -05:00
|
|
|
jr z, .done
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, bc
|
|
|
|
dec a
|
2015-12-26 18:11:55 -05:00
|
|
|
jr .loop
|
2013-09-15 18:02:02 -04:00
|
|
|
|
2015-12-26 18:11:55 -05:00
|
|
|
.done
|
2015-10-21 10:43:42 -04:00
|
|
|
lb bc, 2, 8
|
2013-09-15 18:02:02 -04:00
|
|
|
ld a, e
|
2015-11-13 00:49:27 -05:00
|
|
|
call FillBoxCGB
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
LoadStatsScreenPals:
|
2015-12-22 22:19:33 -05:00
|
|
|
ld hl, StatsScreenPals
|
2014-03-02 16:02:55 -05:00
|
|
|
ld b, 0
|
2013-09-15 18:02:02 -04:00
|
|
|
dec c
|
|
|
|
add hl, bc
|
2015-12-26 21:59:03 -05:00
|
|
|
add hl, bc
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh a, [rSVBK]
|
2013-09-15 18:02:02 -04:00
|
|
|
push af
|
2018-01-03 19:12:45 -05:00
|
|
|
ld a, BANK(wBGPals1)
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rSVBK], a
|
2013-09-15 18:02:02 -04:00
|
|
|
ld a, [hli]
|
2018-01-01 15:08:21 +01:00
|
|
|
ld [wBGPals1 palette 0], a
|
|
|
|
ld [wBGPals1 palette 2], a
|
2013-09-15 18:02:02 -04:00
|
|
|
ld a, [hl]
|
2018-01-01 15:08:21 +01:00
|
|
|
ld [wBGPals1 palette 0 + 1], a
|
|
|
|
ld [wBGPals1 palette 2 + 1], a
|
2013-09-15 18:02:02 -04:00
|
|
|
pop af
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rSVBK], a
|
2015-12-16 21:57:42 -05:00
|
|
|
call ApplyPals
|
2013-09-15 18:02:02 -04:00
|
|
|
ld a, $1
|
|
|
|
ret
|
|
|
|
|
2016-05-11 09:49:03 -04:00
|
|
|
LoadMailPalettes:
|
2013-09-15 18:02:02 -04:00
|
|
|
ld l, e
|
2014-03-02 16:02:55 -05:00
|
|
|
ld h, 0
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, hl
|
2016-05-10 12:31:49 -04:00
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
2016-05-11 09:49:03 -04:00
|
|
|
ld de, .MailPals
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, de
|
2018-01-01 15:08:21 +01:00
|
|
|
ld de, wBGPals1
|
2015-12-09 18:25:44 -05:00
|
|
|
ld bc, 1 palettes
|
2018-01-04 14:53:50 -05:00
|
|
|
ld a, BANK(wBGPals1)
|
2013-09-15 18:02:02 -04:00
|
|
|
call FarCopyWRAM
|
2015-12-16 21:57:42 -05:00
|
|
|
call ApplyPals
|
2020-02-13 18:30:13 +01:00
|
|
|
call WipeAttrmap
|
|
|
|
call ApplyAttrmap
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2016-05-11 09:49:03 -04:00
|
|
|
.MailPals:
|
2018-01-09 23:21:32 -05:00
|
|
|
INCLUDE "gfx/mail/mail.pal"
|
2015-12-09 18:25:44 -05:00
|
|
|
|
2018-03-13 13:07:16 +01:00
|
|
|
INCLUDE "engine/gfx/cgb_layouts.asm"
|
2013-09-15 18:02:02 -04:00
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
CopyFourPalettes:
|
2018-01-01 15:08:21 +01:00
|
|
|
ld de, wBGPals1
|
2018-01-15 01:10:56 -05:00
|
|
|
ld c, 4
|
2013-12-24 17:11:52 -05:00
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
CopyPalettes:
|
2015-10-21 10:43:42 -04:00
|
|
|
.loop
|
2013-09-15 18:02:02 -04:00
|
|
|
push bc
|
|
|
|
ld a, [hli]
|
|
|
|
push hl
|
2015-12-22 18:03:00 -05:00
|
|
|
call GetPredefPal
|
2015-10-21 10:43:42 -04:00
|
|
|
call LoadHLPaletteIntoDE
|
2013-09-15 18:02:02 -04:00
|
|
|
pop hl
|
|
|
|
inc hl
|
|
|
|
pop bc
|
|
|
|
dec c
|
2015-10-21 10:43:42 -04:00
|
|
|
jr nz, .loop
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
GetPredefPal:
|
2013-09-15 18:02:02 -04:00
|
|
|
ld l, a
|
2020-11-09 15:17:03 -05:00
|
|
|
ld h, 0
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, hl
|
2016-05-05 15:07:37 -04:00
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
2017-12-15 22:36:33 -05:00
|
|
|
ld bc, PredefPals
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, bc
|
|
|
|
ret
|
|
|
|
|
2023-07-26 17:01:20 +02:00
|
|
|
PredefPals:
|
|
|
|
table_width PALETTE_SIZE, PredefPals
|
|
|
|
INCLUDE "gfx/predef/predef.pal"
|
|
|
|
assert_table_length NUM_PREDEF_PALS
|
|
|
|
|
|
|
|
INCLUDE "gfx/predef/four_pals.asm"
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
LoadHLPaletteIntoDE:
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh a, [rSVBK]
|
2013-09-15 18:02:02 -04:00
|
|
|
push af
|
2018-01-03 19:12:45 -05:00
|
|
|
ld a, BANK(wOBPals1)
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rSVBK], a
|
2018-01-26 21:25:49 -05:00
|
|
|
ld c, 1 palettes
|
2015-10-21 10:43:42 -04:00
|
|
|
.loop
|
2013-09-15 18:02:02 -04:00
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
dec c
|
2015-10-21 10:43:42 -04:00
|
|
|
jr nz, .loop
|
2013-09-15 18:02:02 -04:00
|
|
|
pop af
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rSVBK], a
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
LoadPalette_White_Col1_Col2_Black:
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh a, [rSVBK]
|
2013-09-15 18:02:02 -04:00
|
|
|
push af
|
2018-01-03 19:12:45 -05:00
|
|
|
ld a, BANK(wBGPals1)
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rSVBK], a
|
2015-12-16 21:57:42 -05:00
|
|
|
|
2018-01-18 11:16:24 -05:00
|
|
|
ld a, LOW(PALRGB_WHITE)
|
2013-09-15 18:02:02 -04:00
|
|
|
ld [de], a
|
|
|
|
inc de
|
2018-01-18 11:16:24 -05:00
|
|
|
ld a, HIGH(PALRGB_WHITE)
|
2013-09-15 18:02:02 -04:00
|
|
|
ld [de], a
|
|
|
|
inc de
|
2015-12-16 21:57:42 -05:00
|
|
|
|
2018-01-22 19:40:17 -05:00
|
|
|
ld c, 2 * PAL_COLOR_SIZE
|
2015-10-21 10:43:42 -04:00
|
|
|
.loop
|
2013-09-15 18:02:02 -04:00
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
dec c
|
2015-10-21 10:43:42 -04:00
|
|
|
jr nz, .loop
|
2015-12-16 21:57:42 -05:00
|
|
|
|
2013-09-15 18:02:02 -04:00
|
|
|
xor a
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
2015-12-16 21:57:42 -05:00
|
|
|
|
2013-09-15 18:02:02 -04:00
|
|
|
pop af
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rSVBK], a
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
FillBoxCGB:
|
2015-10-21 10:43:42 -04:00
|
|
|
.row
|
2013-09-15 18:02:02 -04:00
|
|
|
push bc
|
|
|
|
push hl
|
2015-10-21 10:43:42 -04:00
|
|
|
.col
|
2013-09-15 18:02:02 -04:00
|
|
|
ld [hli], a
|
|
|
|
dec c
|
2015-10-21 10:43:42 -04:00
|
|
|
jr nz, .col
|
2013-09-15 18:02:02 -04:00
|
|
|
pop hl
|
2015-10-21 10:43:42 -04:00
|
|
|
ld bc, SCREEN_WIDTH
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
dec b
|
2015-10-21 10:43:42 -04:00
|
|
|
jr nz, .row
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2016-05-11 09:49:03 -04:00
|
|
|
ResetBGPals:
|
2013-09-15 18:02:02 -04:00
|
|
|
push af
|
|
|
|
push bc
|
|
|
|
push de
|
|
|
|
push hl
|
2016-05-11 09:49:03 -04:00
|
|
|
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh a, [rSVBK]
|
2013-09-15 18:02:02 -04:00
|
|
|
push af
|
2018-01-03 19:12:45 -05:00
|
|
|
ld a, BANK(wBGPals1)
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rSVBK], a
|
2016-05-11 09:49:03 -04:00
|
|
|
|
2018-01-01 15:08:21 +01:00
|
|
|
ld hl, wBGPals1
|
2017-12-25 12:41:31 -05:00
|
|
|
ld c, 1 palettes
|
2015-11-20 15:15:32 -05:00
|
|
|
.loop
|
2013-09-15 18:02:02 -04:00
|
|
|
ld a, $ff
|
|
|
|
ld [hli], a
|
2016-05-11 09:49:03 -04:00
|
|
|
ld [hli], a
|
|
|
|
ld [hli], a
|
|
|
|
ld [hli], a
|
2013-09-15 18:02:02 -04:00
|
|
|
xor a
|
|
|
|
ld [hli], a
|
2016-05-11 09:49:03 -04:00
|
|
|
ld [hli], a
|
|
|
|
ld [hli], a
|
|
|
|
ld [hli], a
|
2013-09-15 18:02:02 -04:00
|
|
|
dec c
|
2015-11-20 15:15:32 -05:00
|
|
|
jr nz, .loop
|
2016-05-11 09:49:03 -04:00
|
|
|
|
2013-09-15 18:02:02 -04:00
|
|
|
pop af
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rSVBK], a
|
2016-05-11 09:49:03 -04:00
|
|
|
|
2013-09-15 18:02:02 -04:00
|
|
|
pop hl
|
|
|
|
pop de
|
|
|
|
pop bc
|
|
|
|
pop af
|
|
|
|
ret
|
|
|
|
|
2020-02-13 18:30:13 +01:00
|
|
|
WipeAttrmap:
|
|
|
|
hlcoord 0, 0, wAttrmap
|
2015-07-22 15:57:02 -04:00
|
|
|
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
2013-09-15 18:02:02 -04:00
|
|
|
xor a
|
|
|
|
call ByteFill
|
|
|
|
ret
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
ApplyPals:
|
2018-01-01 15:08:21 +01:00
|
|
|
ld hl, wBGPals1
|
|
|
|
ld de, wBGPals2
|
2015-12-09 18:25:44 -05:00
|
|
|
ld bc, 16 palettes
|
2018-01-30 14:05:25 -05:00
|
|
|
ld a, BANK(wGBCPalettes)
|
2013-09-15 18:02:02 -04:00
|
|
|
call FarCopyWRAM
|
|
|
|
ret
|
|
|
|
|
2020-02-13 18:30:13 +01:00
|
|
|
ApplyAttrmap:
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh a, [rLCDC]
|
2017-12-29 18:53:21 +01:00
|
|
|
bit rLCDC_ENABLE, a
|
2015-12-16 21:57:42 -05:00
|
|
|
jr z, .UpdateVBank1
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh a, [hBGMapMode]
|
2013-09-15 18:02:02 -04:00
|
|
|
push af
|
|
|
|
ld a, $2
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [hBGMapMode], a
|
2013-09-15 18:02:02 -04:00
|
|
|
call DelayFrame
|
|
|
|
call DelayFrame
|
|
|
|
call DelayFrame
|
|
|
|
call DelayFrame
|
|
|
|
pop af
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [hBGMapMode], a
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2016-04-10 14:42:14 -04:00
|
|
|
.UpdateVBank1:
|
2020-02-13 18:30:13 +01:00
|
|
|
hlcoord 0, 0, wAttrmap
|
2015-11-20 11:47:52 -05:00
|
|
|
debgcoord 0, 0
|
2015-12-16 21:57:42 -05:00
|
|
|
ld b, SCREEN_HEIGHT
|
2013-09-15 18:02:02 -04:00
|
|
|
ld a, $1
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rVBK], a
|
2015-12-16 21:57:42 -05:00
|
|
|
.row
|
|
|
|
ld c, SCREEN_WIDTH
|
|
|
|
.col
|
2013-09-15 18:02:02 -04:00
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
dec c
|
2015-12-16 21:57:42 -05:00
|
|
|
jr nz, .col
|
|
|
|
ld a, BG_MAP_WIDTH - SCREEN_WIDTH
|
2013-09-15 18:02:02 -04:00
|
|
|
add e
|
2015-12-16 21:57:42 -05:00
|
|
|
jr nc, .okay
|
2013-09-15 18:02:02 -04:00
|
|
|
inc d
|
2015-12-16 21:57:42 -05:00
|
|
|
.okay
|
2013-09-15 18:02:02 -04:00
|
|
|
ld e, a
|
|
|
|
dec b
|
2015-12-16 21:57:42 -05:00
|
|
|
jr nz, .row
|
2013-09-15 18:02:02 -04:00
|
|
|
ld a, $0
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rVBK], a
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2023-07-26 17:01:20 +02:00
|
|
|
; CGB layout for CGB_PARTY_MENU_HP_BARS
|
2018-06-24 16:09:41 +02:00
|
|
|
CGB_ApplyPartyMenuHPPals:
|
2015-12-22 22:19:33 -05:00
|
|
|
ld hl, wHPPals
|
2023-07-26 17:01:20 +02:00
|
|
|
ld a, [wWhichPartyMonHPPal]
|
2013-09-15 18:02:02 -04:00
|
|
|
ld e, a
|
2020-11-09 15:17:03 -05:00
|
|
|
ld d, 0
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, de
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
|
|
|
ld a, [de]
|
|
|
|
inc a
|
|
|
|
ld e, a
|
2020-02-13 18:30:13 +01:00
|
|
|
hlcoord 11, 2, wAttrmap
|
2015-12-22 22:19:33 -05:00
|
|
|
ld bc, 2 * SCREEN_WIDTH
|
2023-07-26 17:01:20 +02:00
|
|
|
ld a, [wWhichPartyMonHPPal]
|
2015-12-22 22:19:33 -05:00
|
|
|
.loop
|
2013-09-15 18:02:02 -04:00
|
|
|
and a
|
2015-12-22 22:19:33 -05:00
|
|
|
jr z, .done
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, bc
|
|
|
|
dec a
|
2015-12-22 22:19:33 -05:00
|
|
|
jr .loop
|
|
|
|
.done
|
2015-10-21 10:43:42 -04:00
|
|
|
lb bc, 2, 8
|
2013-09-15 18:02:02 -04:00
|
|
|
ld a, e
|
2015-11-13 00:49:27 -05:00
|
|
|
call FillBoxCGB
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
InitPartyMenuOBPals:
|
2017-12-15 22:36:33 -05:00
|
|
|
ld hl, PartyMenuOBPals
|
2018-01-01 15:08:21 +01:00
|
|
|
ld de, wOBPals1
|
2015-12-09 18:25:44 -05:00
|
|
|
ld bc, 2 palettes
|
2018-01-04 14:53:50 -05:00
|
|
|
ld a, BANK(wOBPals1)
|
2013-09-15 18:02:02 -04:00
|
|
|
call FarCopyWRAM
|
|
|
|
ret
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
GetBattlemonBackpicPalettePointer:
|
2013-09-15 18:02:02 -04:00
|
|
|
push de
|
2017-12-24 12:47:30 -05:00
|
|
|
farcall GetPartyMonDVs
|
2013-09-15 18:02:02 -04:00
|
|
|
ld c, l
|
|
|
|
ld b, h
|
2018-01-23 17:39:09 -05:00
|
|
|
ld a, [wTempBattleMonSpecies]
|
2015-12-16 21:57:42 -05:00
|
|
|
call GetPlayerOrMonPalettePointer
|
2013-09-15 18:02:02 -04:00
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
GetEnemyFrontpicPalettePointer:
|
2013-09-15 18:02:02 -04:00
|
|
|
push de
|
2017-12-24 12:47:30 -05:00
|
|
|
farcall GetEnemyMonDVs
|
2013-09-15 18:02:02 -04:00
|
|
|
ld c, l
|
|
|
|
ld b, h
|
2018-01-23 17:39:09 -05:00
|
|
|
ld a, [wTempEnemyMonSpecies]
|
2015-12-16 21:57:42 -05:00
|
|
|
call GetFrontpicPalettePointer
|
2013-09-15 18:02:02 -04:00
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
GetPlayerOrMonPalettePointer:
|
2013-09-15 18:02:02 -04:00
|
|
|
and a
|
2015-12-16 21:57:42 -05:00
|
|
|
jp nz, GetMonNormalOrShinyPalettePointer
|
2015-10-24 10:34:19 -04:00
|
|
|
ld a, [wPlayerSpriteSetupFlags]
|
2018-01-22 14:34:55 -05:00
|
|
|
bit PLAYERSPRITESETUP_FEMALE_TO_MALE_F, a
|
2015-10-24 10:34:19 -04:00
|
|
|
jr nz, .male
|
2017-12-28 13:15:46 +01:00
|
|
|
ld a, [wPlayerGender]
|
2013-09-15 18:02:02 -04:00
|
|
|
and a
|
2015-10-24 10:34:19 -04:00
|
|
|
jr z, .male
|
2014-03-01 21:43:16 -05:00
|
|
|
ld hl, KrisPalette
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2015-10-24 10:34:19 -04:00
|
|
|
.male
|
2018-02-04 22:45:04 -05:00
|
|
|
ld hl, PlayerPalette
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
GetFrontpicPalettePointer:
|
2013-09-15 18:02:02 -04:00
|
|
|
and a
|
2015-12-16 21:57:42 -05:00
|
|
|
jp nz, GetMonNormalOrShinyPalettePointer
|
2018-01-23 17:39:09 -05:00
|
|
|
ld a, [wTrainerClass]
|
2013-09-15 18:02:02 -04:00
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
GetTrainerPalettePointer:
|
2013-09-15 18:02:02 -04:00
|
|
|
ld l, a
|
2014-03-01 21:43:16 -05:00
|
|
|
ld h, 0
|
2016-05-11 09:49:03 -04:00
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
2014-03-01 21:43:16 -05:00
|
|
|
ld bc, TrainerPalettes
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, bc
|
|
|
|
ret
|
|
|
|
|
2018-07-23 00:13:43 -04:00
|
|
|
GetMonPalettePointer:
|
|
|
|
call _GetMonPalettePointer
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2017-12-25 12:41:31 -05:00
|
|
|
BattleObjectPals:
|
2018-01-09 23:21:32 -05:00
|
|
|
INCLUDE "gfx/battle_anims/battle_anims.pal"
|
2015-12-09 18:25:44 -05:00
|
|
|
|
2018-07-23 00:13:43 -04:00
|
|
|
_GetMonPalettePointer:
|
2013-09-15 18:02:02 -04:00
|
|
|
ld l, a
|
2020-11-09 15:17:03 -05:00
|
|
|
ld h, 0
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, hl
|
2016-05-10 12:31:49 -04:00
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
2015-02-06 21:07:35 -08:00
|
|
|
ld bc, PokemonPalettes
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, bc
|
|
|
|
ret
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
GetMonNormalOrShinyPalettePointer:
|
2013-09-15 18:02:02 -04:00
|
|
|
push bc
|
2018-07-23 00:13:43 -04:00
|
|
|
call _GetMonPalettePointer
|
2013-09-15 18:02:02 -04:00
|
|
|
pop bc
|
|
|
|
push hl
|
|
|
|
call CheckShininess
|
|
|
|
pop hl
|
|
|
|
ret nc
|
2015-07-20 22:18:18 -04:00
|
|
|
rept 4
|
2013-09-15 18:02:02 -04:00
|
|
|
inc hl
|
2015-07-20 22:18:18 -04:00
|
|
|
endr
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2016-05-05 15:07:37 -04:00
|
|
|
InitCGBPals::
|
2023-07-26 17:01:20 +02:00
|
|
|
ldh a, [hCGB]
|
|
|
|
and a
|
2013-09-15 18:02:02 -04:00
|
|
|
ret z
|
2020-10-28 13:35:39 -04:00
|
|
|
|
2016-05-05 15:07:37 -04:00
|
|
|
; CGB only
|
2018-01-18 01:25:19 -05:00
|
|
|
ld a, BANK(vTiles3)
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rVBK], a
|
2018-01-18 01:25:19 -05:00
|
|
|
ld hl, vTiles3
|
2016-01-04 08:43:55 -05:00
|
|
|
ld bc, $200 tiles
|
2013-09-15 18:02:02 -04:00
|
|
|
xor a
|
|
|
|
call ByteFill
|
2018-01-18 01:25:19 -05:00
|
|
|
ld a, BANK(vTiles0)
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rVBK], a
|
2018-01-01 13:43:02 -05:00
|
|
|
ld a, 1 << rBGPI_AUTO_INCREMENT
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rBGPI], a
|
2023-07-26 20:50:16 -04:00
|
|
|
ld c, 4 * TILE_WIDTH
|
2016-01-04 08:43:55 -05:00
|
|
|
.bgpals_loop
|
2018-01-18 11:16:24 -05:00
|
|
|
ld a, LOW(PALRGB_WHITE)
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rBGPD], a
|
2018-01-18 11:16:24 -05:00
|
|
|
ld a, HIGH(PALRGB_WHITE)
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rBGPD], a
|
2013-09-15 18:02:02 -04:00
|
|
|
dec c
|
2016-01-04 08:43:55 -05:00
|
|
|
jr nz, .bgpals_loop
|
2018-01-01 13:43:02 -05:00
|
|
|
ld a, 1 << rOBPI_AUTO_INCREMENT
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rOBPI], a
|
2023-07-26 20:50:16 -04:00
|
|
|
ld c, 4 * TILE_WIDTH
|
2016-01-04 08:43:55 -05:00
|
|
|
.obpals_loop
|
2018-01-18 11:16:24 -05:00
|
|
|
ld a, LOW(PALRGB_WHITE)
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rOBPD], a
|
2018-01-18 11:16:24 -05:00
|
|
|
ld a, HIGH(PALRGB_WHITE)
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rOBPD], a
|
2013-09-15 18:02:02 -04:00
|
|
|
dec c
|
2016-01-04 08:43:55 -05:00
|
|
|
jr nz, .obpals_loop
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh a, [rSVBK]
|
2013-09-15 18:02:02 -04:00
|
|
|
push af
|
2018-01-03 19:12:45 -05:00
|
|
|
ld a, BANK(wBGPals1)
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rSVBK], a
|
2018-01-01 15:08:21 +01:00
|
|
|
ld hl, wBGPals1
|
2016-01-04 08:43:55 -05:00
|
|
|
call .LoadWhitePals
|
2018-01-01 15:08:21 +01:00
|
|
|
ld hl, wBGPals2
|
2016-01-04 08:43:55 -05:00
|
|
|
call .LoadWhitePals
|
2013-09-15 18:02:02 -04:00
|
|
|
pop af
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rSVBK], a
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2016-04-10 14:42:14 -04:00
|
|
|
.LoadWhitePals:
|
2016-01-04 08:43:55 -05:00
|
|
|
ld c, 4 * 16
|
2015-11-20 15:15:32 -05:00
|
|
|
.loop
|
2018-01-18 11:16:24 -05:00
|
|
|
ld a, LOW(PALRGB_WHITE)
|
2013-09-15 18:02:02 -04:00
|
|
|
ld [hli], a
|
2018-01-18 11:16:24 -05:00
|
|
|
ld a, HIGH(PALRGB_WHITE)
|
2013-09-15 18:02:02 -04:00
|
|
|
ld [hli], a
|
|
|
|
dec c
|
2015-11-20 15:15:32 -05:00
|
|
|
jr nz, .loop
|
2013-09-15 18:02:02 -04:00
|
|
|
ret
|
|
|
|
|
2017-12-15 22:36:33 -05:00
|
|
|
HPBarPals:
|
2018-01-09 23:21:32 -05:00
|
|
|
INCLUDE "gfx/battle/hp_bar.pal"
|
2014-03-01 21:43:16 -05:00
|
|
|
|
2017-12-15 22:36:33 -05:00
|
|
|
ExpBarPalette:
|
2018-01-09 23:21:32 -05:00
|
|
|
INCLUDE "gfx/battle/exp_bar.pal"
|
2014-03-01 21:43:16 -05:00
|
|
|
|
2017-12-27 01:29:15 -05:00
|
|
|
INCLUDE "data/pokemon/palettes.asm"
|
2017-12-26 18:45:04 -05:00
|
|
|
|
2017-12-27 01:29:15 -05:00
|
|
|
INCLUDE "data/trainers/palettes.asm"
|
2013-09-15 18:02:02 -04:00
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
LoadMapPals:
|
2023-10-07 12:47:37 +02:00
|
|
|
call LoadDarknessPaletteIfDark
|
2015-12-22 18:03:00 -05:00
|
|
|
jr c, .got_pals
|
2015-06-23 10:46:51 -07:00
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
; Which palette group is based on whether we're outside or inside
|
2017-12-24 13:08:38 -05:00
|
|
|
ld a, [wEnvironment]
|
2023-08-07 13:23:57 +02:00
|
|
|
maskbits NUM_ENVIRONMENTS
|
2013-09-15 18:02:02 -04:00
|
|
|
ld e, a
|
2014-03-02 01:22:33 -05:00
|
|
|
ld d, 0
|
2017-12-25 12:41:31 -05:00
|
|
|
ld hl, EnvironmentColorsPointers
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, de
|
2015-12-26 21:59:03 -05:00
|
|
|
add hl, de
|
2013-09-15 18:02:02 -04:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2016-04-02 09:28:46 -04:00
|
|
|
; Futher refine by time of day
|
2018-01-23 17:39:09 -05:00
|
|
|
ld a, [wTimeOfDayPal]
|
2018-01-16 17:27:50 -05:00
|
|
|
maskbits NUM_DAYTIMES
|
2013-09-15 18:02:02 -04:00
|
|
|
add a
|
2016-04-02 09:28:46 -04:00
|
|
|
add a
|
|
|
|
add a
|
2013-09-15 18:02:02 -04:00
|
|
|
ld e, a
|
2014-03-02 01:22:33 -05:00
|
|
|
ld d, 0
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, de
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh a, [rSVBK]
|
2013-09-15 18:02:02 -04:00
|
|
|
push af
|
2018-01-03 19:12:45 -05:00
|
|
|
ld a, BANK(wBGPals1)
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rSVBK], a
|
2018-01-01 15:08:21 +01:00
|
|
|
ld hl, wBGPals1
|
2015-12-22 18:03:00 -05:00
|
|
|
ld b, 8
|
|
|
|
.outer_loop
|
2016-04-02 09:28:46 -04:00
|
|
|
ld a, [de] ; lookup index for TilesetBGPalette
|
2013-09-15 18:02:02 -04:00
|
|
|
push de
|
|
|
|
push hl
|
|
|
|
ld l, a
|
2014-03-02 01:22:33 -05:00
|
|
|
ld h, 0
|
2016-04-02 09:28:46 -04:00
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
2015-06-23 10:46:51 -07:00
|
|
|
ld de, TilesetBGPalette
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, de
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
|
|
|
pop hl
|
2015-12-22 18:03:00 -05:00
|
|
|
ld c, 1 palettes
|
|
|
|
.inner_loop
|
2013-09-15 18:02:02 -04:00
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
ld [hli], a
|
|
|
|
dec c
|
2015-12-22 18:03:00 -05:00
|
|
|
jr nz, .inner_loop
|
2013-09-15 18:02:02 -04:00
|
|
|
pop de
|
|
|
|
inc de
|
|
|
|
dec b
|
2015-12-22 18:03:00 -05:00
|
|
|
jr nz, .outer_loop
|
2013-09-15 18:02:02 -04:00
|
|
|
pop af
|
2018-08-25 14:28:22 -04:00
|
|
|
ldh [rSVBK], a
|
2013-09-15 18:02:02 -04:00
|
|
|
|
2015-12-22 18:03:00 -05:00
|
|
|
.got_pals
|
2023-07-31 12:27:53 +02:00
|
|
|
; BG pals done. Now do OBJ pals.
|
|
|
|
call GetMapTimeOfDay
|
|
|
|
bit IN_DARKNESS_F, a
|
|
|
|
jr z, .not_darkness
|
|
|
|
ld a, [wStatusFlags]
|
|
|
|
bit STATUSFLAGS_FLASH_F, a
|
|
|
|
jr nz, .not_darkness
|
|
|
|
ld a, BANK(wOBPals1)
|
|
|
|
ld de, wOBPals1
|
2023-10-07 12:47:37 +02:00
|
|
|
ld hl, MapObjectDarknessPals
|
2023-10-07 19:08:54 +02:00
|
|
|
ld bc, 7 palettes ; all but PAL_OW_MISC
|
2023-07-31 12:27:53 +02:00
|
|
|
jp FarCopyWRAM
|
|
|
|
|
|
|
|
.not_darkness
|
2018-01-23 17:39:09 -05:00
|
|
|
ld a, [wTimeOfDayPal]
|
2018-01-16 17:27:50 -05:00
|
|
|
maskbits NUM_DAYTIMES
|
2015-12-22 18:03:00 -05:00
|
|
|
ld bc, 8 palettes
|
2015-06-23 10:46:51 -07:00
|
|
|
ld hl, MapObjectPals
|
2013-09-15 18:02:02 -04:00
|
|
|
call AddNTimes
|
2018-01-01 15:08:21 +01:00
|
|
|
ld de, wOBPals1
|
2023-10-07 19:08:54 +02:00
|
|
|
ld bc, 7 palettes ; all but PAL_OW_MISC
|
2018-01-01 15:08:21 +01:00
|
|
|
ld a, BANK(wOBPals1)
|
2013-09-15 18:02:02 -04:00
|
|
|
call FarCopyWRAM
|
2015-06-23 10:46:51 -07:00
|
|
|
|
2017-12-24 13:08:38 -05:00
|
|
|
ld a, [wEnvironment]
|
2023-08-04 18:45:50 +02:00
|
|
|
cp INDOOR_ENVIRONMENT
|
|
|
|
jr c, .outside
|
2013-09-15 18:02:02 -04:00
|
|
|
ret nz
|
2015-12-22 18:03:00 -05:00
|
|
|
.outside
|
2018-01-23 17:39:09 -05:00
|
|
|
ld a, [wMapGroup]
|
2023-07-31 12:27:53 +02:00
|
|
|
add a
|
|
|
|
add a
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
|
|
|
ld hl, RoofPals
|
|
|
|
rept NUM_DAYTIMES
|
2013-09-15 18:02:02 -04:00
|
|
|
add hl, de
|
2023-07-31 12:27:53 +02:00
|
|
|
endr
|
2018-01-23 17:39:09 -05:00
|
|
|
ld a, [wTimeOfDayPal]
|
2018-01-16 17:27:50 -05:00
|
|
|
maskbits NUM_DAYTIMES
|
2023-07-31 12:27:53 +02:00
|
|
|
add a
|
|
|
|
add a
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
|
|
|
add hl, de
|
2018-01-22 19:40:17 -05:00
|
|
|
ld de, wBGPals1 palette PAL_BG_ROOF color 1
|
2015-06-23 10:46:51 -07:00
|
|
|
ld bc, 4
|
2018-01-04 14:53:50 -05:00
|
|
|
ld a, BANK(wBGPals1)
|
2013-09-15 18:02:02 -04:00
|
|
|
call FarCopyWRAM
|
|
|
|
ret
|
2016-04-02 09:28:46 -04:00
|
|
|
|
2023-08-04 18:45:50 +02:00
|
|
|
LoadDarknessPaletteIfDark:
|
|
|
|
call GetMapTimeOfDay
|
|
|
|
bit IN_DARKNESS_F, a
|
|
|
|
jr z, .do_nothing
|
|
|
|
ld a, [wStatusFlags]
|
|
|
|
bit STATUSFLAGS_FLASH_F, a
|
|
|
|
jr nz, .do_nothing
|
|
|
|
|
|
|
|
.darkness
|
|
|
|
call LoadDarknessPalette
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.do_nothing
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
LoadDarknessPalette:
|
|
|
|
ld a, BANK(wBGPals1)
|
|
|
|
ld de, wBGPals1
|
2023-10-07 12:47:37 +02:00
|
|
|
ld hl, TilesetBGDarknessPalette
|
2023-08-04 18:45:50 +02:00
|
|
|
ld bc, 8 palettes
|
|
|
|
jp FarCopyWRAM
|
|
|
|
|
2017-12-25 12:41:31 -05:00
|
|
|
INCLUDE "data/maps/environment_colors.asm"
|
2014-03-02 01:22:33 -05:00
|
|
|
|
2018-01-18 11:37:05 -05:00
|
|
|
PartyMenuBGMobilePalette:
|
|
|
|
INCLUDE "gfx/stats/party_menu_bg_mobile.pal"
|
2015-12-09 18:25:44 -05:00
|
|
|
|
2018-01-18 11:37:05 -05:00
|
|
|
PartyMenuBGPalette:
|
|
|
|
INCLUDE "gfx/stats/party_menu_bg.pal"
|
2015-12-09 18:25:44 -05:00
|
|
|
|
2023-10-07 12:47:37 +02:00
|
|
|
TilesetBGDarknessPalette:
|
2023-08-04 18:45:50 +02:00
|
|
|
INCLUDE "gfx/tilesets/bg_tiles_darkness.pal"
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
TilesetBGPalette:
|
2018-01-09 23:21:32 -05:00
|
|
|
INCLUDE "gfx/tilesets/bg_tiles.pal"
|
2014-03-02 16:02:55 -05:00
|
|
|
|
2023-10-07 12:47:37 +02:00
|
|
|
MapObjectDarknessPals:
|
2023-07-31 12:27:53 +02:00
|
|
|
INCLUDE "gfx/overworld/npc_sprites_darkness.pal"
|
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
MapObjectPals::
|
2018-01-12 02:56:14 -05:00
|
|
|
INCLUDE "gfx/overworld/npc_sprites.pal"
|
2014-03-02 16:02:55 -05:00
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
RoofPals:
|
2023-07-31 12:27:53 +02:00
|
|
|
table_width PAL_COLOR_SIZE * 4 * 2, RoofPals
|
2018-01-09 23:21:32 -05:00
|
|
|
INCLUDE "gfx/tilesets/roofs.pal"
|
2021-03-03 22:22:41 -05:00
|
|
|
assert_table_length NUM_MAP_GROUPS + 1
|
2014-03-02 16:02:55 -05:00
|
|
|
|
2016-06-06 18:23:00 -04:00
|
|
|
DiplomaPalettes:
|
2018-01-09 23:21:32 -05:00
|
|
|
INCLUDE "gfx/diploma/diploma.pal"
|
2014-03-02 16:02:55 -05:00
|
|
|
|
2017-12-15 22:36:33 -05:00
|
|
|
PartyMenuOBPals:
|
2018-01-18 11:37:05 -05:00
|
|
|
INCLUDE "gfx/stats/party_menu_ob.pal"
|
2014-03-02 16:02:55 -05:00
|
|
|
|
2018-01-18 00:16:03 -05:00
|
|
|
UnusedGSTitleBGPals:
|
|
|
|
INCLUDE "gfx/title/unused_gs_bg.pal"
|
2014-03-02 16:02:55 -05:00
|
|
|
|
2018-01-18 00:16:03 -05:00
|
|
|
UnusedGSTitleOBPals:
|
|
|
|
INCLUDE "gfx/title/unused_gs_fg.pal"
|
2015-12-09 18:25:44 -05:00
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
MalePokegearPals:
|
2018-01-09 23:21:32 -05:00
|
|
|
INCLUDE "gfx/pokegear/pokegear.pal"
|
2015-12-09 18:25:44 -05:00
|
|
|
|
2016-04-02 09:28:46 -04:00
|
|
|
FemalePokegearPals:
|
2018-01-09 23:21:32 -05:00
|
|
|
INCLUDE "gfx/pokegear/pokegear_f.pal"
|
2015-12-09 18:25:44 -05:00
|
|
|
|
2018-06-01 02:11:44 -04:00
|
|
|
BetaPokerPals:
|
|
|
|
INCLUDE "gfx/beta_poker/beta_poker.pal"
|
2015-12-09 18:25:44 -05:00
|
|
|
|
2017-12-10 20:50:08 -05:00
|
|
|
SlotMachinePals:
|
2018-01-09 23:21:32 -05:00
|
|
|
INCLUDE "gfx/slots/slots.pal"
|
2023-08-18 20:19:34 +02:00
|
|
|
|
|
|
|
LevelSelectionMenuMalePals:
|
|
|
|
table_width PAL_COLOR_SIZE * 4 * 6, LevelSelectionMenuMalePals
|
|
|
|
INCLUDE "gfx/level_selection_menu/background_male.pal"
|
|
|
|
assert_table_length NUM_DAYTIMES
|
|
|
|
|
|
|
|
LevelSelectionMenuFemalePals:
|
|
|
|
table_width PAL_COLOR_SIZE * 4 * 6, LevelSelectionMenuFemalePals
|
|
|
|
INCLUDE "gfx/level_selection_menu/background_female.pal"
|
|
|
|
assert_table_length NUM_DAYTIMES
|
|
|
|
|
2023-08-27 13:11:42 +02:00
|
|
|
INCLUDE "engine/gfx/rgb_fade.asm"
|