summaryrefslogtreecommitdiff
path: root/engine/tilesets
diff options
context:
space:
mode:
Diffstat (limited to 'engine/tilesets')
-rw-r--r--engine/tilesets/tileset_anims.asm2
-rw-r--r--engine/tilesets/timeofday_pals.asm40
2 files changed, 22 insertions, 20 deletions
diff --git a/engine/tilesets/tileset_anims.asm b/engine/tilesets/tileset_anims.asm
index 33e956df0..5e673356d 100644
--- a/engine/tilesets/tileset_anims.asm
+++ b/engine/tilesets/tileset_anims.asm
@@ -925,7 +925,7 @@ FlickeringCaveEntrancePalette:
ret nz
; We only want to be here if we're in a dark cave.
ld a, [wTimeOfDayPalset]
- cp %11111111 ; 3,3,3,3
+ cp DARKNESS_PALSET
ret nz
ldh a, [rSVBK]
diff --git a/engine/tilesets/timeofday_pals.asm b/engine/tilesets/timeofday_pals.asm
index e890607d4..2f61f1930 100644
--- a/engine/tilesets/timeofday_pals.asm
+++ b/engine/tilesets/timeofday_pals.asm
@@ -190,7 +190,7 @@ ReplaceTimeOfDayPals:
ld a, [wMapTimeOfDay]
cp PALETTE_DARK
jr z, .NeedsFlash
- and $7
+ maskbits NUM_MAP_PALETTES
add l
ld l, a
ld a, 0
@@ -204,55 +204,57 @@ ReplaceTimeOfDayPals:
ld a, [wStatusFlags]
bit STATUSFLAGS_FLASH_F, a
jr nz, .UsedFlash
- ld a, %11111111 ; 3, 3, 3, 3
+ ld a, DARKNESS_PALSET
ld [wTimeOfDayPalset], a
ret
.UsedFlash:
- ld a, %10101010 ; 2, 2, 2, 2
+ ld a, (NITE_F << 6) | (NITE_F << 4) | (NITE_F << 2) | NITE_F
ld [wTimeOfDayPalset], a
ret
.BrightnessLevels:
- dc 3, 2, 1, 0
- dc 1, 1, 1, 1
- dc 2, 2, 2, 2
- dc 0, 0, 0, 0
- dc 3, 3, 3, 3
- dc 3, 2, 1, 0
- dc 3, 2, 1, 0
- dc 3, 2, 1, 0
+; actual palettes used when time is
+; DARKNESS_F, NITE_F, DAY_F, MORN_F
+ dc DARKNESS_F, NITE_F, DAY_F, MORN_F ; PALETTE_AUTO
+ dc DAY_F, DAY_F, DAY_F, DAY_F ; PALETTE_DAY
+ dc NITE_F, NITE_F, NITE_F, NITE_F ; PALETTE_NITE
+ dc MORN_F, MORN_F, MORN_F, MORN_F ; PALETTE_MORN
+ dc DARKNESS_F, DARKNESS_F, DARKNESS_F, DARKNESS_F ; PALETTE_DARK
+ dc DARKNESS_F, NITE_F, DAY_F, MORN_F
+ dc DARKNESS_F, NITE_F, DAY_F, MORN_F
+ dc DARKNESS_F, NITE_F, DAY_F, MORN_F
GetTimePalette:
jumptable .TimePalettes, wTimeOfDay
.TimePalettes:
- dw .MorningPalette
- dw .DayPalette
- dw .NitePalette
- dw .DarknessPalette
+ dw .MorningPalette ; MORN_F
+ dw .DayPalette ; DAY_F
+ dw .NitePalette ; NITE_F
+ dw .DarknessPalette ; DARKNESS_F
.MorningPalette:
ld a, [wTimeOfDayPalset]
- and %00000011 ; 0
+ and %00000011
ret
.DayPalette:
ld a, [wTimeOfDayPalset]
- and %00001100 ; 1
+ and %00001100
srl a
srl a
ret
.NitePalette:
ld a, [wTimeOfDayPalset]
- and %00110000 ; 2
+ and %00110000
swap a
ret
.DarknessPalette:
ld a, [wTimeOfDayPalset]
- and %11000000 ; 3
+ and %11000000
rlca
rlca
ret