diff --git a/ld_script.txt b/ld_script.txt index 4b2b4ee3a..c0b5d97eb 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -180,7 +180,7 @@ SECTIONS { src/wallclock.o(.text); asm/rom6.o(.text); src/pokeblock.o(.text); - src/fldeff_flash.o(.text); + src/fldeff_flash.o(.text); asm/post_battle_event_funcs.o(.text); src/time_events.o(.text); src/birch_pc.o(.text); diff --git a/src/fldeff_flash.c b/src/fldeff_flash.c index f31fe2b47..4f3a091ce 100644 --- a/src/fldeff_flash.c +++ b/src/fldeff_flash.c @@ -75,7 +75,7 @@ static const u8 gCaveTransitionTiles[] = INCBIN_U8("graphics/misc/cave_transitio // text bool8 SetUpFieldMove_Flash(void) { - if(ShouldDoBrailleFlyEffect()) + if (ShouldDoBrailleFlyEffect()) { gSpecialVar_Result = GetCursorSelectionMonId(); gUnknown_03005DB0 = FieldCallback_Teleport; diff --git a/src/fossil_specials.c b/src/fossil_specials.c index 926849cd9..95fafc17b 100644 --- a/src/fossil_specials.c +++ b/src/fossil_specials.c @@ -292,8 +292,7 @@ static void sub_81BED50(u8 taskId) } if(gUnknown_0203CF10[left].curr_buffer_index > (INNER_BUFFER_LENGTH - 1)) { - Free(gUnknown_0203CF10[left].buffer); - gUnknown_0203CF10[left].buffer = NULL; + FREE_AND_SET_NULL(gUnknown_0203CF10[left].buffer); gTasks[taskId].data[2]++; if((left % 2) == 1) gUnknown_0203CF14[1]--; @@ -313,14 +312,10 @@ static void sub_81BED50(u8 taskId) sub_81BEB90(); break; case 5: - Free(gUnknown_0203CF14); - gUnknown_0203CF14 = NULL; - Free(gUnknown_0203CF10); - gUnknown_0203CF10 = NULL; - Free(gUnknown_0203CF04); - gUnknown_0203CF04 = NULL; - Free(gUnknown_0203CF08); - gUnknown_0203CF08 = NULL; + FREE_AND_SET_NULL(gUnknown_0203CF14); + FREE_AND_SET_NULL(gUnknown_0203CF10); + FREE_AND_SET_NULL(gUnknown_0203CF04); + FREE_AND_SET_NULL(gUnknown_0203CF08); break; case 6: SetGpuRegBits(REG_OFFSET_BG2CNT, 0x2); @@ -742,14 +737,10 @@ static void sub_81BF028(u8 taskId) if(gSprites[gUnknown_0203CF0C->spriteId].callback != SpriteCallbackDummy) return; DestroySprite(&gSprites[gUnknown_0203CF0C->spriteId]); - Free(gUnknown_0203CF0C->unkC); - gUnknown_0203CF0C->unkC = NULL; - Free(gUnknown_0203CF0C->frameImage); - gUnknown_0203CF0C->frameImage = NULL; - Free(gUnknown_0203CF0C->frameImageTiles); - gUnknown_0203CF0C->frameImageTiles = NULL; - Free(gUnknown_0203CF0C); - gUnknown_0203CF0C = NULL; + FREE_AND_SET_NULL(gUnknown_0203CF0C->unkC);; + FREE_AND_SET_NULL(gUnknown_0203CF0C->frameImage); + FREE_AND_SET_NULL(gUnknown_0203CF0C->frameImageTiles); + FREE_AND_SET_NULL(gUnknown_0203CF0C); break; case 8: EnableBothScriptContexts();