diff options
Diffstat (limited to 'engine')
-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 | ||||
-rw-r--r-- | engine/menus/league_pc.asm | 6 | ||||
-rw-r--r-- | engine/menus/pokedex.asm | 12 | ||||
-rw-r--r-- | engine/menus/save.asm | 8 | ||||
-rw-r--r-- | engine/menus/start_sub_menus.asm | 6 | ||||
-rw-r--r-- | engine/minigame/surfing_pikachu.asm | 6 | ||||
-rw-r--r-- | engine/movie/evolution.asm | 2 | ||||
-rw-r--r-- | engine/movie/hall_of_fame.asm | 2 | ||||
-rw-r--r-- | engine/movie/oak_speech/oak_speech.asm | 2 | ||||
-rw-r--r-- | engine/movie/title.asm | 2 | ||||
-rw-r--r-- | engine/overworld/tilesets.asm | 2 | ||||
-rw-r--r-- | engine/overworld/update_map.asm | 6 | ||||
-rw-r--r-- | engine/pikachu/pikachu_pic_animation.asm | 6 | ||||
-rw-r--r-- | engine/pokemon/evos_moves.asm | 4 | ||||
-rw-r--r-- | engine/pokemon/status_screen.asm | 12 |
17 files changed, 53 insertions, 52 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 diff --git a/engine/menus/league_pc.asm b/engine/menus/league_pc.asm index 5551fd0b..882565ca 100644 --- a/engine/menus/league_pc.asm +++ b/engine/menus/league_pc.asm @@ -6,10 +6,10 @@ PKMNLeaguePC: push hl ld a, [wUpdateSpritesEnabled] push af - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a ld [wSpriteFlipped], a ld [wUpdateSpritesEnabled], a ld [wHoFTeamIndex2], a @@ -40,7 +40,7 @@ PKMNLeaguePC: jr nz, .loop .doneShowingTeams pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a pop af ld [wUpdateSpritesEnabled], a pop hl diff --git a/engine/menus/pokedex.asm b/engine/menus/pokedex.asm index 315e4805..8e4fef19 100644 --- a/engine/menus/pokedex.asm +++ b/engine/menus/pokedex.asm @@ -162,10 +162,10 @@ HandlePokedexSideMenu: jr .exitSideMenu .chosePrint - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a ld a, [wd11e] ld [wcf91], a callfar PrintPokedexEntry @@ -173,7 +173,7 @@ HandlePokedexSideMenu: ldh [hAutoBGTransferEnabled], a call ClearScreen pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a ld b, $3 jr .exitSideMenu @@ -442,10 +442,10 @@ ShowPokedexDataInternal: set 1, [hl] ld a, $33 ; 3/7 volume ldh [rNR50], a - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a call GBPalWhiteOut ; zero all palettes ld a, [wd11e] ; pokemon ID ld [wcf91], a @@ -462,7 +462,7 @@ ShowPokedexDataInternal: and A_BUTTON | B_BUTTON jr z, .waitForButtonPress pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a call GBPalWhiteOut call ClearScreen call RunDefaultPaletteCommand diff --git a/engine/menus/save.asm b/engine/menus/save.asm index bcb27ddf..13fdf729 100644 --- a/engine/menus/save.asm +++ b/engine/menus/save.asm @@ -67,8 +67,8 @@ LoadSAV0: ld de, wSpriteDataStart ld bc, wSpriteDataEnd - wSpriteDataStart call CopyData - ld a, [sTilesetType] - ldh [hTilesetType], a + ld a, [sTileAnimations] + ldh [hTileAnimations], a ld hl, sCurBoxData ld de, wBoxDataStart ld bc, wBoxDataEnd - wBoxDataStart @@ -211,8 +211,8 @@ SaveSAVtoSRAM0: ld de, sCurBoxData ld bc, wBoxDataEnd - wBoxDataStart call CopyData - ldh a, [hTilesetType] - ld [sTilesetType], a + ldh a, [hTileAnimations] + ld [sTileAnimations], a ld hl, sPlayerName ld bc, sMainDataCheckSum - sPlayerName call SAVCheckSum diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm index c054761c..05a1fa56 100644 --- a/engine/menus/start_sub_menus.asm +++ b/engine/menus/start_sub_menus.asm @@ -471,10 +471,10 @@ StartMenu_TrainerInfo:: call GBPalWhiteOut call ClearScreen call UpdateSprites - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a call DrawTrainerInfo predef DrawBadges ; draw badges ld b, SET_PAL_TRAINER_CARD @@ -489,7 +489,7 @@ StartMenu_TrainerInfo:: farcall DrawStartMenu ; XXX what difference does this make? call LoadGBPal pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a jp RedisplayStartMenu_DoNotDrawStartMenu ; loads tile patterns and draws everything except for gym leader faces / badges diff --git a/engine/minigame/surfing_pikachu.asm b/engine/minigame/surfing_pikachu.asm index 641c4f62..e66926d4 100644 --- a/engine/minigame/surfing_pikachu.asm +++ b/engine/minigame/surfing_pikachu.asm @@ -3,10 +3,10 @@ SurfingPikachuMinigame:: call DelayFrame call DelayFrame call DelayFrame - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a ld a, [wUpdateSpritesEnabled] push af ld a, $ff @@ -56,7 +56,7 @@ SurfingPikachuMinigame:: pop af ld [wUpdateSpritesEnabled], a pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a ret SurfingPikachuLoop: diff --git a/engine/movie/evolution.asm b/engine/movie/evolution.asm index 624a7f5f..2cf841c8 100644 --- a/engine/movie/evolution.asm +++ b/engine/movie/evolution.asm @@ -17,7 +17,7 @@ EvolveMon: call Delay3 xor a ldh [hAutoBGTransferEnabled], a - ldh [hTilesetType], a + ldh [hTileAnimations], a ld a, [wEvoOldSpecies] ld [wWholeScreenPaletteMonSpecies], a ld c, 0 diff --git a/engine/movie/hall_of_fame.asm b/engine/movie/hall_of_fame.asm index 616a72e3..db3ab617 100644 --- a/engine/movie/hall_of_fame.asm +++ b/engine/movie/hall_of_fame.asm @@ -19,7 +19,7 @@ AnimateHallOfFame: call FillMemory xor a ld [wUpdateSpritesEnabled], a - ldh [hTilesetType], a + ldh [hTileAnimations], a ld [wSpriteFlipped], a ld [wLetterPrintingDelayFlags], a ; no delay ld [wHoFMonOrPlayer], a ; mon diff --git a/engine/movie/oak_speech/oak_speech.asm b/engine/movie/oak_speech/oak_speech.asm index 7acbd693..2ed61fda 100644 --- a/engine/movie/oak_speech/oak_speech.asm +++ b/engine/movie/oak_speech/oak_speech.asm @@ -60,7 +60,7 @@ OakSpeech: ld [wDestinationMap], a call SpecialWarpIn xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a ld a, [wd732] bit 1, a ; possibly a debug mode bit jp nz, .skipChoosingNames diff --git a/engine/movie/title.asm b/engine/movie/title.asm index cf1eecdb..dfe057f3 100644 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -21,7 +21,7 @@ DisplayTitleScreen: ld a, $1 ldh [hAutoBGTransferEnabled], a xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a ldh [hSCX], a ld a, $40 ldh [hSCY], a diff --git a/engine/overworld/tilesets.asm b/engine/overworld/tilesets.asm index 686fa50c..21101e7b 100644 --- a/engine/overworld/tilesets.asm +++ b/engine/overworld/tilesets.asm @@ -14,7 +14,7 @@ LoadTilesetHeader: ld bc, $b call CopyData ld a, [hl] - ldh [hTilesetType], a + ldh [hTileAnimations], a xor a ldh [hMovingBGTilesCounter1], a pop hl diff --git a/engine/overworld/update_map.asm b/engine/overworld/update_map.asm index 53a5592d..dbf28dae 100644 --- a/engine/overworld/update_map.asm +++ b/engine/overworld/update_map.asm @@ -52,11 +52,11 @@ RedrawMapView: ret z ldh a, [hAutoBGTransferEnabled] push af - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a ldh [hAutoBGTransferEnabled], a - ldh [hTilesetType], a ; no flower/water BG tile animations + ldh [hTileAnimations], a call LoadCurrentMapView call RunDefaultPaletteCommand ld hl, wMapViewVRAMPointer @@ -112,7 +112,7 @@ RedrawMapView: dec c jr nz, .redrawRowLoop pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a pop af ldh [hAutoBGTransferEnabled], a ret diff --git a/engine/pikachu/pikachu_pic_animation.asm b/engine/pikachu/pikachu_pic_animation.asm index 4f56d542..a5d9087f 100644 --- a/engine/pikachu/pikachu_pic_animation.asm +++ b/engine/pikachu/pikachu_pic_animation.asm @@ -616,10 +616,10 @@ PikaPicAnimCommand_loadgfx: push af xor a ldh [hAutoBGTransferEnabled], a - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a call GetPikaPicAnimByte ld [wPikaPicAnimCurGraphicID], a ld a, [wPikaPicAnimCurGraphicID] @@ -634,7 +634,7 @@ PikaPicAnimCommand_loadgfx: call DecompressRequestPikaPicAnimGFX .done pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a pop af ldh [hAutoBGTransferEnabled], a pop af diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm index 3df780c1..7c1476d3 100644 --- a/engine/pokemon/evos_moves.asm +++ b/engine/pokemon/evos_moves.asm @@ -12,7 +12,7 @@ EvolveTradeMon: ; this is only called after battle ; it is supposed to do level up evolutions, though there is a bug that allows item evolutions to occur EvolutionAfterBattle: - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a ld [wEvolutionOccurred], a @@ -250,7 +250,7 @@ Evolution_PartyMonLoop: ; loop over party mons pop bc pop hl pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a ld a, [wLinkState] cp LINK_STATE_TRADING ret z diff --git a/engine/pokemon/status_screen.asm b/engine/pokemon/status_screen.asm index a2cfb595..f1f3aa26 100644 --- a/engine/pokemon/status_screen.asm +++ b/engine/pokemon/status_screen.asm @@ -101,10 +101,10 @@ StatusScreen: ld hl, vChars2 tile $72 lb bc, BANK(PTile), 1 call CopyVideoDataDouble ; bold P (for PP) - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a hlcoord 19, 1 lb bc, 6, 10 call DrawLineBox ; Draws the box around name, HP and status @@ -191,7 +191,7 @@ StatusScreen: .continue call WaitForTextScrollButtonPress ; wait for button pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a ret .GetStringPointer @@ -311,10 +311,10 @@ StatsText: next "SPECIAL@" StatusScreen2: - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a ldh [hAutoBGTransferEnabled], a ld bc, NUM_MOVES + 1 ld hl, wMoves @@ -443,7 +443,7 @@ StatusScreen2: call Delay3 call WaitForTextScrollButtonPress ; wait for button pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a ld hl, wd72c res 1, [hl] ld a, $77 |