From bef792f2d21ccac0127aeffd9e0838aba81f44b6 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 20 Jul 2015 03:51:52 -0400 Subject: More label updates, moved predefs to new file Also named most of the engine and event flag constants. --- data/wild/fish.asm | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'data/wild/fish.asm') diff --git a/data/wild/fish.asm b/data/wild/fish.asm index 777c7b48a..f25365c49 100644 --- a/data/wild/fish.asm +++ b/data/wild/fish.asm @@ -12,17 +12,7 @@ FishAction: ; 92402 call GetFishGroupHeader ld hl, FishGroupHeaders - ; encounter chance - add hl, de - ; pointer to old rod data - add hl, de - add hl, de - ; pointer to good rod data - add hl, de - add hl, de - ; pointer to super rod data - add hl, de - add hl, de + add_n_times hl, de, 7 call Fish @@ -52,8 +42,7 @@ Fish: ; 9241a inc hl ld e, b ld d, 0 - add hl, de - add hl, de + add_n_times hl, de, 2 ld a, [hli] ld h, [hl] ld l, a @@ -122,7 +111,7 @@ GetFishGroupHeader: ; 9245b ; Return fishing encounter group header d in de. push hl - ld hl, wdc1e + ld hl, DailyFlags bit 2, [hl] pop hl jr z, .end -- cgit v1.2.3 From d9300a9becc9aa699b7191f87d8b493a93139ba2 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 20 Jul 2015 11:28:05 -0400 Subject: Fix unnecessary white space and retire add_n_times --- data/wild/fish.asm | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'data/wild/fish.asm') diff --git a/data/wild/fish.asm b/data/wild/fish.asm index f25365c49..844629201 100644 --- a/data/wild/fish.asm +++ b/data/wild/fish.asm @@ -6,16 +6,18 @@ FishAction: ; 92402 push af push bc push hl - + ; Get the fishing group for this map. ld b, e call GetFishGroupHeader - + ld hl, FishGroupHeaders - add_n_times hl, de, 7 - +rept 7 + add hl, de +endr + call Fish - + pop hl pop bc pop af @@ -42,29 +44,31 @@ Fish: ; 9241a inc hl ld e, b ld d, 0 - add_n_times hl, de, 2 +rept 2 + add hl, de +endr ld a, [hli] ld h, [hl] ld l, a - + ; Encounter chance for this monster: call Random - + .CheckEncounter cp [hl] jr z, .ReadMon jr c, .ReadMon - + ; Next monster... inc hl inc hl inc hl jr .CheckEncounter - + .ReadMon ; We're done with the encounter chance inc hl - + ; Species 0 triggers a read from a time-based encounter table. ld a, [hli] ld d, a @@ -74,21 +78,20 @@ Fish: ; 9241a ; Level ld e, [hl] ret - + .NoBite ld de, 0 ret - + .TimeEncounter ; The level byte is repurposed as the index for the new table. ld e, [hl] ld d, 0 ld hl, TimeFishGroups +rept 4 add hl, de - add hl, de - add hl, de - add hl, de +endr ; One nightmon, then one daymon ld a, [TimeOfDay] @@ -97,7 +100,7 @@ Fish: ; 9241a jr c, .TimeSpecies inc hl inc hl - + .TimeSpecies ld d, [hl] inc hl @@ -115,27 +118,27 @@ GetFishGroupHeader: ; 9245b bit 2, [hl] pop hl jr z, .end - + ; Groups 11 and 12 have special attributes. ld a, d cp 11 jr z, .group11 cp 12 jr z, .group12 - + .end dec d ld e, d ld d, 0 ret - + .group11 ld a, [wdfce] cp 1 jr nz, .end ld d, 6 jr .end - + .group12 ld a, [wdfce] cp 2 -- cgit v1.2.3 From 471492b775fc2a0f5162f3d1c13c5472359beb14 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 20 Jul 2015 22:18:18 -0400 Subject: Reverted ld_hl_pointer macro --- data/wild/fish.asm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'data/wild/fish.asm') diff --git a/data/wild/fish.asm b/data/wild/fish.asm index 844629201..c44e23937 100644 --- a/data/wild/fish.asm +++ b/data/wild/fish.asm @@ -60,9 +60,9 @@ endr jr c, .ReadMon ; Next monster... +rept 3 inc hl - inc hl - inc hl +endr jr .CheckEncounter .ReadMon @@ -98,8 +98,9 @@ endr and 3 cp NITE jr c, .TimeSpecies +rept 2 inc hl - inc hl +endr .TimeSpecies ld d, [hl] -- cgit v1.2.3