From 0e455634975b12504e643d2620889935a03df83b Mon Sep 17 00:00:00 2001 From: i0brendan0 Date: Mon, 19 Feb 2018 02:54:13 -0600 Subject: [PATCH 01/12] Add Fix for Lock On Status Moves These changes should fix the status move and secondary effects not working if the opponent is flying or digging but has been locked on. --- docs/bugs_and_glitches.md | 7 ++++++- engine/battle/effect_commands.asm | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 5abf9d08a..7a4242ece 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -292,13 +292,18 @@ This is a bug with `CheckHiddenOpponent` in [engine/battle/effect_commands.asm]( ```asm CheckHiddenOpponent: ; 37daa ; BUG: This routine should account for Lock-On and Mind Reader. +; Uncomment the lines below to fix. + ; ld a, BATTLE_VARS_SUBSTATUS5_OPP + ; call GetBattleVar + ; bit SUBSTATUS_LOCK_ON, a + ; ret z ld a, BATTLE_VARS_SUBSTATUS3_OPP call GetBattleVar and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND ret ``` -*To do:* Fix this bug. +**Fix:** Uncomment those 4 lines to fix. ## Beat Up can desynchronize link battles diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 48efba8fa..2cf4ac97d 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -9708,6 +9708,11 @@ BattleCommand_ThunderAccuracy: ; 37d94 CheckHiddenOpponent: ; 37daa ; BUG: This routine should account for Lock-On and Mind Reader. +; Uncomment the lines below to fix. + ; ld a, BATTLE_VARS_SUBSTATUS5_OPP + ; call GetBattleVar + ; bit SUBSTATUS_LOCK_ON, a + ; ret z ld a, BATTLE_VARS_SUBSTATUS3_OPP call GetBattleVar and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND From a99adb0e5affbb8ef5aa8ded07043801665efd9e Mon Sep 17 00:00:00 2001 From: i0brendan0 Date: Tue, 20 Feb 2018 01:48:22 -0600 Subject: [PATCH 02/12] Fix I did a dumb and used the wrong check instruction. Should actually work. --- docs/bugs_and_glitches.md | 2 +- engine/battle/effect_commands.asm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 7a4242ece..a1693a00d 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -295,7 +295,7 @@ CheckHiddenOpponent: ; 37daa ; Uncomment the lines below to fix. ; ld a, BATTLE_VARS_SUBSTATUS5_OPP ; call GetBattleVar - ; bit SUBSTATUS_LOCK_ON, a + ; and 1 << SUBSTATUS_LOCK_ON ; ret z ld a, BATTLE_VARS_SUBSTATUS3_OPP call GetBattleVar diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 2cf4ac97d..12915038c 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -9711,7 +9711,7 @@ CheckHiddenOpponent: ; 37daa ; Uncomment the lines below to fix. ; ld a, BATTLE_VARS_SUBSTATUS5_OPP ; call GetBattleVar - ; bit SUBSTATUS_LOCK_ON, a + ; and 1 << SUBSTATUS_LOCK_ON ; ret z ld a, BATTLE_VARS_SUBSTATUS3_OPP call GetBattleVar From b57bafd3b7ca771a51596207105a54784175cb7b Mon Sep 17 00:00:00 2001 From: i0brendan0 Date: Mon, 26 Feb 2018 02:34:25 -0600 Subject: [PATCH 03/12] revert --- engine/battle/effect_commands.asm | 5 ----- 1 file changed, 5 deletions(-) diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 12915038c..48efba8fa 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -9708,11 +9708,6 @@ BattleCommand_ThunderAccuracy: ; 37d94 CheckHiddenOpponent: ; 37daa ; BUG: This routine should account for Lock-On and Mind Reader. -; Uncomment the lines below to fix. - ; ld a, BATTLE_VARS_SUBSTATUS5_OPP - ; call GetBattleVar - ; and 1 << SUBSTATUS_LOCK_ON - ; ret z ld a, BATTLE_VARS_SUBSTATUS3_OPP call GetBattleVar and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND From 82ffb584c8fefc04e1bad4895cdc2d9222100b4c Mon Sep 17 00:00:00 2001 From: i0brendan0 Date: Thu, 1 Mar 2018 04:08:54 -0600 Subject: [PATCH 04/12] Add Protect Bug and Fix Moves 'miss' when opponent uses Protect. --- docs/bugs_and_glitches.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index a1693a00d..34b04de9b 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -53,6 +53,7 @@ These are known bugs and glitches in the original Pokémon Crystal game: code th - [`TryObjectEvent` arbitrary code execution](#tryobjectevent-arbitrary-code-execution) - [`Special_CheckBugContestContestantFlag` can read beyond its data table](#special_checkbugcontestcontestantflag-can-read-beyond-its-data-table) - [`ClearWRAM` only clears WRAM bank 1](#clearwram-only-clears-wram-bank-1) +- [Moves erroneously say they have missed when the opponent uses Protect or Detect](#moves-erroneously-say-they-have-missed-when-the-opponent-uses-protect-or-detect) ## Thick Club and Light Ball can decrease damage done with boosted (Special) Attack @@ -1486,3 +1487,29 @@ ClearWRAM:: ; 25a ``` **Fix:** Change `jr nc, .bank_loop` to `jr c, .bank_loop`. + +## Moves erroneously say they have missed when the opponent uses Protect or Detect + +In [battle/effect_commands.asm](battle/effect_commands.asm): + +```asm +BattleCommand_CheckHit: ; 34d32 +; checkhit + + call .DreamEater + jp z, .Miss + + call .Protect + jp nz, .Miss +``` + +**Fix:** Change `jp nz, .Miss` to `jp nz, .Failed` and add + +```asm +.Failed: + ld a, 1 + ld [wEffectFailed], a + ret +``` + +at [line 1781](battle/effect_commands.asm#L1718). From 51bbfee89192cd93c49e3c400ca8745cc3e77e30 Mon Sep 17 00:00:00 2001 From: i0brendan0 <19826742+i0brendan0@users.noreply.github.com> Date: Thu, 1 Mar 2018 04:06:46 -0600 Subject: [PATCH 05/12] Reflect Rangi's suggestion --- docs/bugs_and_glitches.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 34b04de9b..ce2715d92 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -293,19 +293,25 @@ This is a bug with `CheckHiddenOpponent` in [engine/battle/effect_commands.asm]( ```asm CheckHiddenOpponent: ; 37daa ; BUG: This routine should account for Lock-On and Mind Reader. -; Uncomment the lines below to fix. - ; ld a, BATTLE_VARS_SUBSTATUS5_OPP - ; call GetBattleVar - ; and 1 << SUBSTATUS_LOCK_ON - ; ret z ld a, BATTLE_VARS_SUBSTATUS3_OPP call GetBattleVar and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND ret ``` -**Fix:** Uncomment those 4 lines to fix. +Fix: +```asm +CheckHiddenOpponent: ; 37daa + ld a, BATTLE_VARS_SUBSTATUS5_OPP + call GetBattleVar + and 1 << SUBSTATUS_LOCK_ON + ret z + ld a, BATTLE_VARS_SUBSTATUS3_OPP + call GetBattleVar + and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND + ret +``` ## Beat Up can desynchronize link battles From 158144f9cbebdb076262dc45c05253cb8fbc1acf Mon Sep 17 00:00:00 2001 From: i0brendan0 <19826742+i0brendan0@users.noreply.github.com> Date: Sat, 2 Jun 2018 01:12:52 -0500 Subject: [PATCH 06/12] undo protect message bug --- docs/bugs_and_glitches.md | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index ce2715d92..efe951263 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -53,7 +53,6 @@ These are known bugs and glitches in the original Pokémon Crystal game: code th - [`TryObjectEvent` arbitrary code execution](#tryobjectevent-arbitrary-code-execution) - [`Special_CheckBugContestContestantFlag` can read beyond its data table](#special_checkbugcontestcontestantflag-can-read-beyond-its-data-table) - [`ClearWRAM` only clears WRAM bank 1](#clearwram-only-clears-wram-bank-1) -- [Moves erroneously say they have missed when the opponent uses Protect or Detect](#moves-erroneously-say-they-have-missed-when-the-opponent-uses-protect-or-detect) ## Thick Club and Light Ball can decrease damage done with boosted (Special) Attack @@ -1493,29 +1492,3 @@ ClearWRAM:: ; 25a ``` **Fix:** Change `jr nc, .bank_loop` to `jr c, .bank_loop`. - -## Moves erroneously say they have missed when the opponent uses Protect or Detect - -In [battle/effect_commands.asm](battle/effect_commands.asm): - -```asm -BattleCommand_CheckHit: ; 34d32 -; checkhit - - call .DreamEater - jp z, .Miss - - call .Protect - jp nz, .Miss -``` - -**Fix:** Change `jp nz, .Miss` to `jp nz, .Failed` and add - -```asm -.Failed: - ld a, 1 - ld [wEffectFailed], a - ret -``` - -at [line 1781](battle/effect_commands.asm#L1718). From 62439a95a1a7efed07f7189216ce3f9011200f32 Mon Sep 17 00:00:00 2001 From: Thomas Winwood Date: Sat, 9 Jun 2018 23:27:47 +0100 Subject: [PATCH 07/12] Convert code samples in design_flaws.md to diffs --- docs/design_flaws.md | 54 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/docs/design_flaws.md b/docs/design_flaws.md index 6b015a56a..a7100fc7f 100644 --- a/docs/design_flaws.md +++ b/docs/design_flaws.md @@ -151,21 +151,22 @@ Don't enforce `org $4000` in pokecrystal.link. Modify `GetFrontpicPointer`: -```asm +```diff ld a, [wCurPartySpecies] cp UNOWN jr z, .unown ld a, [wCurPartySpecies] - ld hl, PokemonPicPointers ++ ld hl, PokemonPicPointers ld d, BANK(PokemonPicPointers) jr .ok .unown ld a, [wUnownLetter] - ld hl, UnownPicPointers ++ ld hl, UnownPicPointers ld d, BANK(UnownPicPointers) .ok +- ld hl, PokemonPicPointers ; UnownPicPointers dec a ld bc, 6 call AddNTimes @@ -174,13 +175,15 @@ Modify `GetFrontpicPointer`: And `GetMonBackpic`: ```asm +- ; These are assumed to be at the same address in their respective banks. +- ld hl, PokemonPicPointers ; UnownPicPointers ld a, b - ld hl, PokemonPicPointers ++ ld hl, PokemonPicPointers ld d, BANK(PokemonPicPointers) cp UNOWN jr nz, .ok ld a, c - ld hl, UnownPicPointers ++ ld hl, UnownPicPointers ld d, BANK(UnownPicPointers) .ok dec a @@ -267,11 +270,25 @@ INCBIN "gfx/footprints/wartortle.1bpp" Modify `Pokedex_LoadAnyFootprint`: -```asm +```diff +- push hl +- ld e, l +- ld d, h +- ld hl, vTiles2 tile $62 +- lb bc, BANK(Footprints), 2 +- call Request1bpp +- pop hl +- +- ; Whoever was editing footprints forgot to fix their +- ; tile editor. Now each bottom half is 8 tiles off. +- ld de, 8 tiles +- add hl, de +- ld e, l ld d, h - ld hl, vTiles2 tile $62 - lb bc, BANK(Footprints), 4 + ld hl, vTiles2 tile $64 +- lb bc, BANK(Footprints), 2 ++ lb bc, BANK(Footprints), 4 call Request1bpp ``` @@ -340,10 +357,19 @@ Move `ITEM_C3` and `ITEM_DC` above all the TMs in every table of item data. Modify engine/items/items.asm: -```asm +```diff GetTMHMNumber:: ; d407 ; Return the number of a TM/HM by item id c. ld a, c +-; Skip any dummy items. +- cp ITEM_C3 ; TM04-05 +- jr c, .done +- cp ITEM_DC ; TM28-29 +- jr c, .skip +- dec a +-.skip +- dec a +-.done sub TM01 inc a ld c, a @@ -352,6 +378,16 @@ GetTMHMNumber:: ; d407 GetNumberedTMHM: ; d417 ; Return the item id of a TM/HM by number c. ld a, c +-; Skip any gaps. +- cp ITEM_C3 - (TM01 - 1) +- jr c, .done +- cp ITEM_DC - (TM01 - 1) - 1 +- jr c, .skip_one +-.skip_two +- inc a +-.skip_one +- inc a +-.done add TM01 dec a ld c, a From ff1c9f36daa855d7d7253a157371b0a79244870b Mon Sep 17 00:00:00 2001 From: Thomas Winwood Date: Sat, 9 Jun 2018 23:35:50 +0100 Subject: [PATCH 08/12] Convert code samples in bugs_and_glitches.md to diffs --- docs/bugs_and_glitches.md | 153 ++++++++++++++++++++++---------------- 1 file changed, 87 insertions(+), 66 deletions(-) diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 2b5a6a152..d9a9f5ff6 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -76,21 +76,21 @@ This is a bug with `SpeciesItemBoost` in [engine/battle/effect_commands.asm](/en **Fix:** -```asm +```diff ; Double the stat sla l rl h - - ld a, HIGH(MAX_STAT_VALUE) - cp h - jr c, .cap - ld a, LOW(MAX_STAT_VALUE) - cp l - ret nc - -.cap - ld h, HIGH(MAX_STAT_VALUE) - ld l, LOW(MAX_STAT_VALUE) ++ ++ ld a, HIGH(MAX_STAT_VALUE) ++ cp h ++ jr c, .cap ++ ld a, LOW(MAX_STAT_VALUE) ++ cp l ++ ret nc ++ ++.cap ++ ld h, HIGH(MAX_STAT_VALUE) ++ ld l, LOW(MAX_STAT_VALUE) ret ``` @@ -123,7 +123,7 @@ This is a bug with `DittoMetalPowder` in [engine/battle/effect_commands.asm](/en **Fix:** -```asm +```diff ld a, c srl a add c @@ -138,17 +138,17 @@ This is a bug with `DittoMetalPowder` in [engine/battle/effect_commands.asm](/en .done scf rr c - - ld a, HIGH(MAX_STAT_VALUE) - cp b - jr c, .cap - ld a, LOW(MAX_STAT_VALUE) - cp c - ret nc - -.cap - ld b, HIGH(MAX_STAT_VALUE) - ld c, LOW(MAX_STAT_VALUE) ++ ++ ld a, HIGH(MAX_STAT_VALUE) ++ cp b ++ jr c, .cap ++ ld a, LOW(MAX_STAT_VALUE) ++ cp c ++ ret nc ++ ++.cap ++ ld b, HIGH(MAX_STAT_VALUE) ++ ld c, LOW(MAX_STAT_VALUE) ret ``` @@ -402,16 +402,16 @@ BattleCommand_BeatUpFailText: ; 355b5 **Fix:** -```asm +```diff BattleCommand_BeatUpFailText: ; 355b5 ; beatupfailtext ld a, [wBeatUpHitAtLeastOnce] and a ret nz - - inc a - ld [wAttackMissed], a ++ ++ inc a ++ ld [wAttackMissed], a jp PrintButItFailed ``` @@ -613,22 +613,22 @@ CalcExpAtLevel: ; 50e47 **Fix:** -```asm +```diff CalcExpAtLevel: ; 50e47 ; (a/b)*n**3 + c*n**2 + d*n - e - ld a, d - cp 1 - jr nz, .UseExpFormula -; Pokémon have 0 experience at level 1 - xor a - ld hl, hProduct - ld [hli], a - ld [hli], a - ld [hli], a - ld [hl], a - ret - -.UseExpFormula ++ ld a, d ++ cp 1 ++ jr nz, .UseExpFormula ++; Pokémon have 0 experience at level 1 ++ xor a ++ ld hl, hProduct ++ ld [hli], a ++ ld [hli], a ++ ld [hli], a ++ ld [hl], a ++ ret ++ ++.UseExpFormula ld a, [wBaseGrowthRate] add a add a @@ -837,10 +837,11 @@ HappinessData_DaisysGrooming: ; 746b **Fix:** -```asm +```diff HappinessData_DaisysGrooming: ; 746b - db $80, 2, HAPPINESS_GROOMING ; 50% chance - db $ff, 2, HAPPINESS_GROOMING ; 50% chance +- db $ff, 2, HAPPINESS_GROOMING ; 99.6% chance ++ db $80, 2, HAPPINESS_GROOMING ; 50% chance ++ db $ff, 2, HAPPINESS_GROOMING ; 50% chance ``` @@ -1037,18 +1038,18 @@ This is a bug with `PlayBattleMusic` in [engine/battle/start_battle.asm](/engine **Fix:** -```asm +```diff ld de, MUSIC_ROCKET_BATTLE cp GRUNTM jr z, .done cp GRUNTF jr z, .done - cp EXECUTIVEM - jr z, .done - cp EXECUTIVEF - jr z, .done - cp SCIENTIST - jr z, .done ++ cp EXECUTIVEM ++ jr z, .done ++ cp EXECUTIVEF ++ jr z, .done ++ cp SCIENTIST ++ jr z, .done ``` @@ -1083,10 +1084,12 @@ This is a bug with `DoPlayerMovement.CheckWarp` in [engine/overworld/player_move **Fix:** -```asm +```diff ld a, [wWalkingDirection] - cp STANDING - jr z, .not_warp +- ; cp STANDING +- ; jr z, .not_warp ++ cp STANDING ++ jr z, .not_warp ld e, a ld d, 0 ld hl, .EdgeWarps @@ -1098,6 +1101,9 @@ This is a bug with `DoPlayerMovement.CheckWarp` in [engine/overworld/player_move ld a, 1 ld [wd041], a ld a, [wWalkingDirection] +- ; This is in the wrong place. +- cp STANDING +- jr z, .not_warp ``` @@ -1279,15 +1285,27 @@ This is a bug with `PokeBallEffect` in [engine/items/item_effects.asm](/engine/i **Fix:** -```asm +```diff ld hl, wEnemySubStatus5 ld a, [hl] push af set SUBSTATUS_TRANSFORMED, [hl] +-; This code is buggy. Any wild Pokémon that has Transformed will be +-; caught as a Ditto, even if it was something else like Mew. +-; To fix, do not set [wTempEnemyMonSpecies] to DITTO. bit SUBSTATUS_TRANSFORMED, a - jr nz, .load_data +- jr nz, .ditto +- jr .not_ditto ++ jr nz, .load_data +-.ditto +- ld a, DITTO +- ld [wTempEnemyMonSpecies], a +- jr .load_data +- +-.not_ditto +- set SUBSTATUS_TRANSFORMED, [hl] ld hl, wEnemyBackupDVs ld a, [wEnemyMonDVs] ld [hli], a @@ -1323,12 +1341,14 @@ This is a bug with `PokeBallEffect` in [engine/items/item_effects.asm](/engine/i **Fix:** -```asm +```diff .room_in_party xor a ld [wWildMon], a - ld a, [wBattleType] - cp BATTLETYPE_CONTEST +- ld a, [wCurItem] +- cp PARK_BALL ++ ld a, [wBattleType] ++ cp BATTLETYPE_CONTEST call nz, ReturnToBattle_UseBall ``` @@ -1405,10 +1425,10 @@ This is a bug with `PlacePartyMonEvoStoneCompatibility.DetermineCompatibility` i ld a, [hli] and a jr z, .nope - cp EVOLVE_STAT - jr nz, .not_four_bytes - inc hl -.not_four_bytes ++ cp EVOLVE_STAT ++ jr nz, .not_four_bytes ++ inc hl ++.not_four_bytes inc hl inc hl cp EVOLVE_ITEM @@ -1519,11 +1539,12 @@ ValidateTempWildMonSpecies: ; 2a4a0 **Fix:** -```asm +```diff ld a, b ld [wCurPartyLevel], a ld b, [hl] - ld a, b +- ; ld a, b ++ ld a, b call ValidateTempWildMonSpecies jr c, .nowildbattle From 17a4d0540acc00e3f5ad260009115eb36e72b7d2 Mon Sep 17 00:00:00 2001 From: Thomas Winwood Date: Sun, 10 Jun 2018 00:21:34 +0100 Subject: [PATCH 09/12] Fix small bug --- docs/design_flaws.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/design_flaws.md b/docs/design_flaws.md index a7100fc7f..55ec11754 100644 --- a/docs/design_flaws.md +++ b/docs/design_flaws.md @@ -272,11 +272,12 @@ Modify `Pokedex_LoadAnyFootprint`: ```diff - push hl -- ld e, l -- ld d, h -- ld hl, vTiles2 tile $62 + ld e, l + ld d, h + ld hl, vTiles2 tile $62 - lb bc, BANK(Footprints), 2 -- call Request1bpp ++ lb bc, BANK(Footprints), 4 + call Request1bpp - pop hl - - ; Whoever was editing footprints forgot to fix their @@ -284,12 +285,11 @@ Modify `Pokedex_LoadAnyFootprint`: - ld de, 8 tiles - add hl, de - - ld e, l - ld d, h - ld hl, vTiles2 tile $64 +- ld e, l +- ld d, h +- ld hl, vTiles2 tile $64 - lb bc, BANK(Footprints), 2 -+ lb bc, BANK(Footprints), 4 - call Request1bpp +- call Request1bpp ``` From 57efc4b392598d773e8bfc35cb742cf9d8632c57 Mon Sep 17 00:00:00 2001 From: i0brendan0 <19826742+i0brendan0@users.noreply.github.com> Date: Mon, 18 Jun 2018 00:32:36 -0500 Subject: [PATCH 10/12] final fix --- docs/bugs_and_glitches.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index efe951263..cd69a08fd 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -305,6 +305,7 @@ CheckHiddenOpponent: ; 37daa ld a, BATTLE_VARS_SUBSTATUS5_OPP call GetBattleVar and 1 << SUBSTATUS_LOCK_ON + cp 1 << SUBSTATUS_LOCK_ON ret z ld a, BATTLE_VARS_SUBSTATUS3_OPP call GetBattleVar From 6e62eabb42cb8c933e77d84768353c5fec47cf3a Mon Sep 17 00:00:00 2001 From: i0brendan0 <19826742+i0brendan0@users.noreply.github.com> Date: Sat, 21 Jul 2018 03:36:03 -0500 Subject: [PATCH 11/12] final change --- docs/bugs_and_glitches.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index cd69a08fd..4aeb088ef 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -304,6 +304,7 @@ Fix: CheckHiddenOpponent: ; 37daa ld a, BATTLE_VARS_SUBSTATUS5_OPP call GetBattleVar + ld a, [hl] and 1 << SUBSTATUS_LOCK_ON cp 1 << SUBSTATUS_LOCK_ON ret z From 8755a88458b912975c537e489e182ca956dcac9b Mon Sep 17 00:00:00 2001 From: i0brendan0 <19826742+i0brendan0@users.noreply.github.com> Date: Sat, 21 Jul 2018 05:05:40 -0500 Subject: [PATCH 12/12] turns out none of the code is needed --- docs/bugs_and_glitches.md | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 4aeb088ef..7dfd8f421 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -302,18 +302,11 @@ Fix: ```asm CheckHiddenOpponent: ; 37daa - ld a, BATTLE_VARS_SUBSTATUS5_OPP - call GetBattleVar - ld a, [hl] - and 1 << SUBSTATUS_LOCK_ON - cp 1 << SUBSTATUS_LOCK_ON - ret z - ld a, BATTLE_VARS_SUBSTATUS3_OPP - call GetBattleVar - and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND ret ``` +The code in `CheckHiddenOpponent` is completely redundant as `CheckHit` already does what this code is doing. Another option is to remove `CheckHiddenOpponent` completely, the calls to `CheckHiddenOpponent`, and the jump afterwards. + ## Beat Up can desynchronize link battles *Fixing this bug will break compatibility with standard Pokémon Crystal for link battles.*