diff options
Diffstat (limited to 'engine/battle')
-rw-r--r-- | engine/battle/core.asm | 21 | ||||
-rw-r--r-- | engine/battle/init_battle.asm | 4 | ||||
-rw-r--r-- | engine/battle/init_battle_variables.asm | 4 |
3 files changed, 15 insertions, 14 deletions
diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 415b287c..053d6a1e 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -51,7 +51,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: ldh [hWY], a ldh [rWY], a xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a ldh [hSCY], a dec a ld [wUpdateSpritesEnabled], a @@ -2088,23 +2088,24 @@ DisplayBattleMenu:: .menuselected ld [wTextBoxID], a call DisplayTextBoxID + ; handle menu input if it's not the old man tutorial or prof. oak pikachu battle ld a, [wBattleType] cp BATTLE_TYPE_OLD_MAN - jr z, .doSimulatedMenuInput ; simulate menu input if it's the old man or prof. oak pikachu battle + jr z, .doSimulatedMenuInput cp BATTLE_TYPE_PIKACHU jr z, .doSimulatedMenuInput jp .handleBattleMenuInput ; the following happens for the old man tutorial and prof. oak pikachu battle .doSimulatedMenuInput - ; Temporarily save the player name in wGrassRate, - ; which is supposed to get overwritten when entering a - ; map with wild Pokémon. - ; In Red/Blue, due to an oversight, the data may not get - ; overwritten (on Cinnabar and Route 21) and the infamous - ; Missingno. glitch can show up. + ; Temporarily save the player name in wLinkEnemyTrainerName. + ; Since wLinkEnemyTrainerName == wGrassRate, this affects wild encounters. + ; The wGrassRate byte and following wGrassMons buffer are supposed + ; to get overwritten when entering a map with wild Pokémon, + ; but an oversight prevents this in Cinnabar and Route 21, + ; so the infamous MissingNo. glitch can show up. ; However, this has been fixed in Yellow. ld hl, wPlayerName - ld de, wGrassRate + ld de, wLinkEnemyTrainerName ld bc, NAME_LENGTH call CopyData ld hl, .oldManName @@ -6454,7 +6455,7 @@ DoBattleTransitionAndInitBattleVariables: ldh [hAutoBGTransferEnabled], a ldh [hWY], a ldh [rWY], a - ldh [hTilesetType], a + ldh [hTileAnimations], a ld hl, wPlayerStatsToDouble ld [hli], a ld [hli], a diff --git a/engine/battle/init_battle.asm b/engine/battle/init_battle.asm index d6ba51ed..6a6331b7 100644 --- a/engine/battle/init_battle.asm +++ b/engine/battle/init_battle.asm @@ -143,8 +143,8 @@ _InitBattleCommon: ld [wLetterPrintingDelayFlags], a pop af ld [wMapPalOffset], a - ld a, [wSavedTilesetType] - ldh [hTilesetType], a + ld a, [wSavedTileAnimations] + ldh [hTileAnimations], a scf ret .emptyString diff --git a/engine/battle/init_battle_variables.asm b/engine/battle/init_battle_variables.asm index 0d403b55..dd9f9714 100644 --- a/engine/battle/init_battle_variables.asm +++ b/engine/battle/init_battle_variables.asm @@ -1,6 +1,6 @@ InitBattleVariables: - ldh a, [hTilesetType] - ld [wSavedTilesetType], a + ldh a, [hTileAnimations] + ld [wSavedTileAnimations], a xor a ld [wActionResultOrTookBattleTurn], a ld [wBattleResult], a |