Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify remainingBrightness #1840

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions ld_script.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ SECTIONS {
gflib/blit.o(.text);
gflib/window.o(.text);
gflib/text.o(.text);
gflib/sprite.o(.text);
gflib/string_util.o(.text);
src/sprite.o(.text);
src/string_util.o(.text);
src/link.o(.text);
src/AgbRfu_LinkManager.o(.text);
src/link_rfu_3.o(.text);
Expand Down Expand Up @@ -451,9 +451,9 @@ SECTIONS {
gflib/bg.o(.rodata);
gflib/window.o(.rodata);
gflib/text.o(.rodata);
gflib/sprite.o(.rodata);
src/sprite.o(.rodata);
gflib/io_reg.o(.rodata);
gflib/string_util.o(.rodata);
src/string_util.o(.rodata);
src/link.o(.rodata);
src/link.o(.rodata.str1.4);
src/AgbRfu_LinkManager.o(.rodata);
Expand Down
7 changes: 2 additions & 5 deletions src/field_weather.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ static void BuildColorMaps(void)
u16 brightnessDelta;
u16 colorMapIndex;
u16 baseBrightness;
u32 remainingBrightness;
s16 diff;

sPaletteColorMapTypes = sBasePaletteColorMapTypes;
Expand Down Expand Up @@ -305,11 +304,9 @@ static void BuildColorMaps(void)
}

baseBrightness = curBrightness;
remainingBrightness = 0x1f00 - curBrightness;
if ((0x1f00 - curBrightness) < 0)
remainingBrightness += 0xf;
brightnessDelta = (0x1f00 - curBrightness) / (NUM_WEATHER_COLOR_MAPS - 3);

brightnessDelta = remainingBrightness / (NUM_WEATHER_COLOR_MAPS - 3);

if (colorVal < 12)
{
// For shadows (color values < 12), the remaining color mappings are
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion sym_bss.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.include "gflib/gpu_regs.o"
.include "gflib/bg.o"
.include "gflib/text.o"
.include "gflib/sprite.o"
.include "src/sprite.o"
.include "src/link.o"
.include "src/AgbRfu_LinkManager.o"
.include "src/link_rfu_3.o"
Expand Down
2 changes: 1 addition & 1 deletion sym_common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ gCurGlyph:
.align 2
gTextFlags:
.space 4
@ ../gflib/sprite.o
@ ../src/sprite.o
.align 2
gOamMatrixAllocBitmap:
.space 4
Expand Down
4 changes: 2 additions & 2 deletions sym_ewram.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.include "src/main.o"
.include "gflib/window.o"
.include "gflib/text.o"
.include "gflib/sprite.o"
.include "gflib/string_util.o"
.include "src/sprite.o"
.include "src/string_util.o"
.include "src/link.o"
.include "src/AgbRfu_LinkManager.o"
.include "src/link_rfu_3.o"
Expand Down