Skip to content

Commit

Permalink
Fix make and make modern linking error.
Browse files Browse the repository at this point in the history
Edit `wild_encounter.c` to compile without `modern` flag.
  • Loading branch information
Michelleeby committed Feb 12, 2023
1 parent 4276e28 commit f0158ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions ld_script.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,7 @@ SECTIONS {
ALIGN(4)
{
src/graphics.o(.rodata);
src/tilesets.o(.data);
} =0

extra :
Expand Down
1 change: 1 addition & 0 deletions ld_script_modern.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ SECTIONS {
ALIGN(4)
{
src/graphics.o(.rodata);
src/tilesets.o(.data);

This comment has been minimized.

Copy link
@Michelleeby

Michelleeby Feb 12, 2023

Author Owner

Since headers.h references overrides.h in tilesets.c, we need to persist our data from src/tilesets.o. Otherwise, we get the following linking error:

gTilesetPalOverrides_* referenced in section .rodata of src/tilesets.o: 
defined in discarded section .data of src/tilesets.o
} =0

/* DWARF debug sections.
Expand Down
5 changes: 3 additions & 2 deletions src/wild_encounter.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,10 @@ static u8 ChooseWildMonLevel(const struct WildPokemon *wildPokemon)
static u16 GetCurrentMapWildMonHeaderId(void)
{
u16 i;

u8 timeOfDay;

RtcCalcLocalTime();
u8 timeOfDay = GetCurrentTimeOfDay();
timeOfDay = GetCurrentTimeOfDay();

for (i = 0; ; i++)
{
Expand Down

0 comments on commit f0158ac

Please sign in to comment.