From f98a95b8ee2bb14f8fdb675e37c9876b8163b509 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Mon, 6 Aug 2018 19:43:54 +0200 Subject: [PATCH] wWeeklyFlags -> wDailyFlags2 These are by far not always checked each week, and as such shouldn't be called that. Since they're almost always used through the `bit` instruction, it's very inconvenient to just make wDailyFlags a `dw` instead. --- constants/engine_flags.asm | 4 ++-- constants/wram_constants.asm | 36 +++++++++++++++++------------------ data/engine_flags.asm | 32 +++++++++++++++---------------- engine/events/fish.asm | 4 ++-- engine/events/fruit_trees.asm | 8 ++++---- engine/events/shuckle.asm | 4 ++-- engine/items/mart.asm | 4 ++-- engine/overworld/time.asm | 14 +++++++------- engine/pokegear/radio.asm | 20 +++++++++---------- mobile/mobile_45.asm | 12 ++++++------ wram.asm | 4 ++-- 11 files changed, 71 insertions(+), 71 deletions(-) diff --git a/constants/engine_flags.asm b/constants/engine_flags.asm index 518edf806..d6ef40b55 100644 --- a/constants/engine_flags.asm +++ b/constants/engine_flags.asm @@ -94,7 +94,7 @@ const ENGINE_LUCKY_NUMBER_SHOW ; wStatusFlags2 const ENGINE_4F -; wDailyFlags +; wDailyFlags1 const ENGINE_KURT_MAKING_BALLS ; 50 const ENGINE_DAILY_BUG_CONTEST const ENGINE_FISH_SWARM @@ -103,7 +103,7 @@ const ENGINE_GOT_SHUCKIE_TODAY const ENGINE_GOLDENROD_UNDERGROUND_MERCHANT_CLOSED const ENGINE_FOUGHT_IN_TRAINER_HALL_TODAY -; wWeeklyFlags +; wDailyFlags2 const ENGINE_MT_MOON_SQUARE_CLEFAIRY const ENGINE_UNION_CAVE_LAPRAS const ENGINE_GOLDENROD_UNDERGROUND_GOT_HAIRCUT diff --git a/constants/wram_constants.asm b/constants/wram_constants.asm index 5889ca7a6..c5bc47650 100644 --- a/constants/wram_constants.asm +++ b/constants/wram_constants.asm @@ -232,27 +232,27 @@ CELEBIEVENT_FOREST_IS_RESTLESS_F EQU 2 const BIKEFLAGS_ALWAYS_ON_BIKE_F ; 1 const BIKEFLAGS_DOWNHILL_F ; 2 -; wDailyFlags:: ; dc1e +; wDailyFlags1:: ; dc1e const_def - const DAILYFLAGS_KURT_MAKING_BALLS_F ; 0 - const DAILYFLAGS_BUG_CONTEST_F ; 1 - const DAILYFLAGS_FISH_SWARM_F ; 2 - const DAILYFLAGS_TIME_CAPSULE_F ; 3 - const DAILYFLAGS_ALL_FRUIT_TREES_F ; 4 - const DAILYFLAGS_GOT_SHUCKIE_TODAY_F ; 5 - const DAILYFLAGS_GOLDENROD_UNDERGROUND_BARGAIN_F ; 6 - const DAILYFLAGS_TRAINER_HOUSE_F ; 7 + const DAILYFLAGS1_KURT_MAKING_BALLS_F ; 0 + const DAILYFLAGS1_BUG_CONTEST_F ; 1 + const DAILYFLAGS1_FISH_SWARM_F ; 2 + const DAILYFLAGS1_TIME_CAPSULE_F ; 3 + const DAILYFLAGS1_ALL_FRUIT_TREES_F ; 4 + const DAILYFLAGS1_GOT_SHUCKIE_TODAY_F ; 5 + const DAILYFLAGS1_GOLDENROD_UNDERGROUND_BARGAIN_F ; 6 + const DAILYFLAGS1_TRAINER_HOUSE_F ; 7 -; wWeeklyFlags:: ; dc1f +; wDailyFlags2:: ; dc1f const_def - const WEEKLYFLAGS_MT_MOON_SQUARE_CLEFAIRY_F ; 0 - const WEEKLYFLAGS_UNION_CAVE_LAPRAS_F ; 1 - const WEEKLYFLAGS_GOLDENROD_UNDERGROUND_GOT_HAIRCUT_F ; 2 - const WEEKLYFLAGS_GOLDENROD_DEPT_STORE_TM27_RETURN_F ; 3 - const WEEKLYFLAGS_DAISYS_GROOMING_F ; 4 - const WEEKLYFLAGS_INDIGO_PLATEAU_RIVAL_FIGHT_F ; 5 - const WEEKLYFLAGS_DAILY_MOVE_TUTOR_F ; 6 - const WEEKLYFLAGS_BUENAS_PASSWORD_F ; 7 + const DAILYFLAGS2_MT_MOON_SQUARE_CLEFAIRY_F ; 0 + const DAILYFLAGS2_UNION_CAVE_LAPRAS_F ; 1 + const DAILYFLAGS2_GOLDENROD_UNDERGROUND_GOT_HAIRCUT_F ; 2 + const DAILYFLAGS2_GOLDENROD_DEPT_STORE_TM27_RETURN_F ; 3 + const DAILYFLAGS2_DAISYS_GROOMING_F ; 4 + const DAILYFLAGS2_INDIGO_PLATEAU_RIVAL_FIGHT_F ; 5 + const DAILYFLAGS2_MOVE_TUTOR_F ; 6 + const DAILYFLAGS2_BUENAS_PASSWORD_F ; 7 ; wSwarmFlags:: ; dc20 const_def diff --git a/data/engine_flags.asm b/data/engine_flags.asm index 21f8ca0fe..ab669acfc 100644 --- a/data/engine_flags.asm +++ b/data/engine_flags.asm @@ -104,23 +104,23 @@ EngineFlags: engine_flag wStatusFlags2, STATUSFLAGS2_UNUSED_3_F - engine_flag wDailyFlags, DAILYFLAGS_KURT_MAKING_BALLS_F ; $50 - engine_flag wDailyFlags, DAILYFLAGS_BUG_CONTEST_F - engine_flag wDailyFlags, DAILYFLAGS_FISH_SWARM_F - engine_flag wDailyFlags, DAILYFLAGS_TIME_CAPSULE_F - engine_flag wDailyFlags, DAILYFLAGS_ALL_FRUIT_TREES_F - engine_flag wDailyFlags, DAILYFLAGS_GOT_SHUCKIE_TODAY_F - engine_flag wDailyFlags, DAILYFLAGS_GOLDENROD_UNDERGROUND_BARGAIN_F - engine_flag wDailyFlags, DAILYFLAGS_TRAINER_HOUSE_F + engine_flag wDailyFlags1, DAILYFLAGS1_KURT_MAKING_BALLS_F ; $50 + engine_flag wDailyFlags1, DAILYFLAGS1_BUG_CONTEST_F + engine_flag wDailyFlags1, DAILYFLAGS1_FISH_SWARM_F + engine_flag wDailyFlags1, DAILYFLAGS1_TIME_CAPSULE_F + engine_flag wDailyFlags1, DAILYFLAGS1_ALL_FRUIT_TREES_F + engine_flag wDailyFlags1, DAILYFLAGS1_GOT_SHUCKIE_TODAY_F + engine_flag wDailyFlags1, DAILYFLAGS1_GOLDENROD_UNDERGROUND_BARGAIN_F + engine_flag wDailyFlags1, DAILYFLAGS1_TRAINER_HOUSE_F - engine_flag wWeeklyFlags, WEEKLYFLAGS_MT_MOON_SQUARE_CLEFAIRY_F ; $58 - engine_flag wWeeklyFlags, WEEKLYFLAGS_UNION_CAVE_LAPRAS_F - engine_flag wWeeklyFlags, WEEKLYFLAGS_GOLDENROD_UNDERGROUND_GOT_HAIRCUT_F - engine_flag wWeeklyFlags, WEEKLYFLAGS_GOLDENROD_DEPT_STORE_TM27_RETURN_F - engine_flag wWeeklyFlags, WEEKLYFLAGS_DAISYS_GROOMING_F - engine_flag wWeeklyFlags, WEEKLYFLAGS_INDIGO_PLATEAU_RIVAL_FIGHT_F - engine_flag wWeeklyFlags, WEEKLYFLAGS_DAILY_MOVE_TUTOR_F - engine_flag wWeeklyFlags, WEEKLYFLAGS_BUENAS_PASSWORD_F + engine_flag wDailyFlags2, DAILYFLAGS2_MT_MOON_SQUARE_CLEFAIRY_F ; $58 + engine_flag wDailyFlags2, DAILYFLAGS2_UNION_CAVE_LAPRAS_F + engine_flag wDailyFlags2, DAILYFLAGS2_GOLDENROD_UNDERGROUND_GOT_HAIRCUT_F + engine_flag wDailyFlags2, DAILYFLAGS2_GOLDENROD_DEPT_STORE_TM27_RETURN_F + engine_flag wDailyFlags2, DAILYFLAGS2_DAISYS_GROOMING_F + engine_flag wDailyFlags2, DAILYFLAGS2_INDIGO_PLATEAU_RIVAL_FIGHT_F + engine_flag wDailyFlags2, DAILYFLAGS2_MOVE_TUTOR_F + engine_flag wDailyFlags2, DAILYFLAGS2_BUENAS_PASSWORD_F engine_flag wSwarmFlags, SWARMFLAGS_BUENAS_PASSWORD_F ; $60 engine_flag wSwarmFlags, SWARMFLAGS_GOLDENROD_DEPT_STORE_SALE_F diff --git a/engine/events/fish.asm b/engine/events/fish.asm index a1df536bb..c1dde87d8 100644 --- a/engine/events/fish.asm +++ b/engine/events/fish.asm @@ -93,8 +93,8 @@ GetFishGroupIndex: ; Return the index of fishgroup d in de. push hl - ld hl, wDailyFlags - bit DAILYFLAGS_FISH_SWARM_F, [hl] + ld hl, wDailyFlags1 + bit DAILYFLAGS1_FISH_SWARM_F, [hl] pop hl jr z, .done diff --git a/engine/events/fruit_trees.asm b/engine/events/fruit_trees.asm index 6d5ca6a1d..15fa4f80f 100644 --- a/engine/events/fruit_trees.asm +++ b/engine/events/fruit_trees.asm @@ -41,8 +41,8 @@ GetCurTreeFruit: ret TryResetFruitTrees: - ld hl, wDailyFlags - bit DAILYFLAGS_ALL_FRUIT_TREES_F, [hl] + ld hl, wDailyFlags1 + bit DAILYFLAGS1_ALL_FRUIT_TREES_F, [hl] ret nz jp ResetFruitTrees @@ -65,8 +65,8 @@ ResetFruitTrees: ld [hli], a ld [hli], a ld [hl], a - ld hl, wDailyFlags - set DAILYFLAGS_ALL_FRUIT_TREES_F, [hl] + ld hl, wDailyFlags1 + set DAILYFLAGS1_ALL_FRUIT_TREES_F, [hl] ret GetFruitTreeFlag: diff --git a/engine/events/shuckle.asm b/engine/events/shuckle.asm index c6d909afe..b1c87f53a 100644 --- a/engine/events/shuckle.asm +++ b/engine/events/shuckle.asm @@ -54,8 +54,8 @@ GiveShuckle: call CopyName2 ; Engine flag for this event. - ld hl, wDailyFlags - set DAILYFLAGS_GOT_SHUCKIE_TODAY_F, [hl] + ld hl, wDailyFlags1 + set DAILYFLAGS1_GOT_SHUCKIE_TODAY_F, [hl] ld a, 1 ld [wScriptVar], a ret diff --git a/engine/items/mart.asm b/engine/items/mart.asm index 7e185662b..8afae541a 100644 --- a/engine/items/mart.asm +++ b/engine/items/mart.asm @@ -54,8 +54,8 @@ BargainShop: ld a, [hli] or [hl] jr z, .skip_set - ld hl, wDailyFlags - set DAILYFLAGS_GOLDENROD_UNDERGROUND_BARGAIN_F, [hl] + ld hl, wDailyFlags1 + set DAILYFLAGS1_GOLDENROD_UNDERGROUND_BARGAIN_F, [hl] .skip_set ld hl, Text_BargainShop_ComeAgain diff --git a/engine/overworld/time.asm b/engine/overworld/time.asm index abb12d87d..74bd1b6d9 100644 --- a/engine/overworld/time.asm +++ b/engine/overworld/time.asm @@ -91,9 +91,9 @@ CheckDailyResetTimer:: call CheckDayDependentEventHL ret nc xor a - ld hl, wDailyFlags - ld [hli], a ; wDailyFlags - ld [hli], a ; wWeeklyFlags + ld hl, wDailyFlags1 + ld [hli], a ; wDailyFlags1 + ld [hli], a ; wDailyFlags2 ld [hli], a ; wSwarmFlags ld [hl], a ; wSwarmFlags + 1 ld hl, wDailyRematchFlags @@ -207,14 +207,14 @@ CheckUnusedTwoDayTimer: ret ; unused - ld hl, wDailyFlags - set DAILYFLAGS_FISH_SWARM_F, [hl] + ld hl, wDailyFlags1 + set DAILYFLAGS1_FISH_SWARM_F, [hl] ret ; unused and a - ld hl, wDailyFlags - bit DAILYFLAGS_FISH_SWARM_F, [hl] + ld hl, wDailyFlags1 + bit DAILYFLAGS1_FISH_SWARM_F, [hl] ret nz scf ret diff --git a/engine/pokegear/radio.asm b/engine/pokegear/radio.asm index b76cad13e..390fef28e 100644 --- a/engine/pokegear/radio.asm +++ b/engine/pokegear/radio.asm @@ -1558,8 +1558,8 @@ BuenasPassword4: jp c, BuenasPassword8 ld a, [wBuenasPassword] ; If we already generated the password today, we don't need to generate a new one. - ld hl, wWeeklyFlags - bit WEEKLYFLAGS_BUENAS_PASSWORD_F, [hl] + ld hl, wDailyFlags2 + bit DAILYFLAGS2_BUENAS_PASSWORD_F, [hl] jr nz, .AlreadyGotIt ; There are only 11 groups to choose from. .greater_than_11 @@ -1580,8 +1580,8 @@ BuenasPassword4: add e ld [wBuenasPassword], a ; Set the flag so that we don't generate a new password this week. - ld hl, wWeeklyFlags - set WEEKLYFLAGS_BUENAS_PASSWORD_F, [hl] + ld hl, wDailyFlags2 + set DAILYFLAGS2_BUENAS_PASSWORD_F, [hl] .AlreadyGotIt: ld c, a call GetBuenasPassword @@ -1701,15 +1701,15 @@ BuenasPassword7: BuenasPasswordAfterMidnight: push hl - ld hl, wWeeklyFlags - res WEEKLYFLAGS_BUENAS_PASSWORD_F, [hl] + ld hl, wDailyFlags2 + res DAILYFLAGS2_BUENAS_PASSWORD_F, [hl] pop hl ld a, BUENAS_PASSWORD_8 jp NextRadioLine BuenasPassword8: - ld hl, wWeeklyFlags - res WEEKLYFLAGS_BUENAS_PASSWORD_F, [hl] + ld hl, wDailyFlags2 + res DAILYFLAGS2_BUENAS_PASSWORD_F, [hl] ld hl, BuenaRadioMidnightText10 ld a, BUENAS_PASSWORD_9 jp NextRadioLine @@ -1776,8 +1776,8 @@ BuenasPassword20: farcall NoRadioName pop af ld [hBGMapMode], a - ld hl, wWeeklyFlags - res WEEKLYFLAGS_BUENAS_PASSWORD_F, [hl] + ld hl, wDailyFlags2 + res DAILYFLAGS2_BUENAS_PASSWORD_F, [hl] ld a, BUENAS_PASSWORD ld [wCurrentRadioLine], a xor a diff --git a/mobile/mobile_45.asm b/mobile/mobile_45.asm index e2168a737..64ddaff6b 100644 --- a/mobile/mobile_45.asm +++ b/mobile/mobile_45.asm @@ -4265,7 +4265,7 @@ Function1158c2: ld l, c ld h, b xor a - ld [wWeeklyFlags], a + ld [wDailyFlags2], a .asm_1158e5 ld b, $3 @@ -4290,7 +4290,7 @@ Function1158c2: push hl dec hl ld a, c - ld [wWeeklyFlags], a + ld [wDailyFlags2], a .asm_115908 xor a ld [hld], a @@ -4430,7 +4430,7 @@ endr jp nz, .asm_1158e5 .asm_1159c4 - ld a, [wWeeklyFlags] + ld a, [wDailyFlags2] cp $0 jr z, .asm_1159d8 push hl @@ -4890,7 +4890,7 @@ Function115bc8: Function115c49: ld a, e - ld [wWeeklyFlags], a + ld [wDailyFlags2], a ld a, d ld [wSwarmFlags], a xor a @@ -4960,7 +4960,7 @@ endr ld [$dc1a], a push de push hl - ld hl, wWeeklyFlags + ld hl, wDailyFlags2 ld a, [hli] ld h, [hl] ld l, a @@ -5070,7 +5070,7 @@ Function115cfd: .asm_115d38 push de push hl - ld a, [wWeeklyFlags] + ld a, [wDailyFlags2] ld l, a ld a, [wSwarmFlags] ld h, a diff --git a/wram.asm b/wram.asm index 76785c49d..f56bed8a6 100644 --- a/wram.asm +++ b/wram.asm @@ -2714,8 +2714,8 @@ wWhichMomItemSet:: db ; dc18 wMomItemTriggerBalance:: ds 3 ; dc19 wDailyResetTimer:: dw ; dc1c -wDailyFlags:: db -wWeeklyFlags:: db +wDailyFlags1:: db +wDailyFlags2:: db wSwarmFlags:: db ds 2 wTimerEventStartDay:: db