diff options
Diffstat (limited to 'engine')
48 files changed, 236 insertions, 292 deletions
diff --git a/engine/bank3c.asm b/engine/bank3c.asm index 0028d1fc..83e010ff 100644 --- a/engine/bank3c.asm +++ b/engine/bank3c.asm @@ -242,7 +242,7 @@ PikachuMovementData_f1f2c: INCLUDE "scripts/celadondiner2.asm" INCLUDE "scripts/safarizoneentrance2.asm" -INCLUDE "scripts/cinnabargym2.asm" +INCLUDE "scripts/cinnabargym3.asm" INCLUDE "scripts/mtmoonpokecenter2.asm" diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index 52d2ee6e..4f7cd2c8 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -573,7 +573,7 @@ SetAnimationPalette: ; 78e5c (1e:4e5c) call UpdateGBCPal_OBP0 call UpdateGBCPal_OBP1 ret - + Func_78e98: ; 78e98 (1e:4e98) call SaveScreenTilesToBuffer2 xor a @@ -586,14 +586,14 @@ Func_78e98: ; 78e98 (1e:4e98) ld [H_AUTOBGTRANSFERENABLED], a call LoadScreenTilesFromBuffer2 ld h, vBGMap1 / $100 - + WriteLowerByteOfBGMapAndEnableBGTransfer: ; 78eb1 (1e:4eb1) ld l, vBGMap0 & $ff call BattleAnimCopyTileMapToVRAM ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ret - + PlaySubanimation: ; 78ebb (1e:4ebb) ld a,[wAnimSoundID] cp a,$FF @@ -1207,7 +1207,7 @@ FlashScreenLongDelay: ; 79216 (1e:5216) ld c,1 .delayFrames jp DelayFrames - + AnimationFlashScreen: ; 7922c (1e:522c) ld a,[rBGP] push af ; save initial palette @@ -1273,14 +1273,14 @@ SetAnimationBGPalette: ; 79273 (1e:5273) ret ld b, $5 - + AnimationShakeScreenVertically: ; 79283 (1e:5283) predef_jump PredefShakeScreenVertically AnimationShakeScreen: ; 79288 (1e:5288) ; Shakes the screen for a while. Used in Earthquake/Fissure/etc. animations. ld b, $8 - + AnimationShakeScreenHorizontallyFast: ; 7928a (1e:528a) predef_jump PredefShakeScreenHorizontally @@ -1384,19 +1384,19 @@ AnimationSlideMonDown: ; 79331 (1e:5331) dec b jr nz, .loop ret - + AnimationSlideMonOff: ; 79349 (1e:5349) ; Slides the mon's sprite off the screen horizontally. ld e, 8 ld a, 3 ld [wSlideMonDelay], a jp _AnimationSlideMonOff - + AnimationSlideEnemyMonOff: ; 79353 (1e:5353) ; Slides the enemy mon off the screen horizontally. ld hl, AnimationSlideMonOff jp CallWithTurnFlipped - + _AnimationSlideMonUp: ; 79359 (1e:5359) push de push hl @@ -1553,7 +1553,7 @@ AdjustOAMBlockYPos2: ; 7940d (1e:540d) dec c jr nz, .loop ret - + AnimationBlinkEnemyMon: ; 79421 (1e:5421) ; Make the enemy mon's sprite blink on and off for a second or two ld hl, AnimationBlinkMon @@ -1933,7 +1933,7 @@ UpwardBallsAnimXCoordinatesEnemyTurn: ; 79667 (1e:5667) ; AnimationShootManyBallsUpward animation. It's unused in the game. db $60, $90, $78, $68, $88, $80 db $FF ; list terminator - + AnimationMinimizeMon: ; 7966e (1e:566e) ; Changes the mon's sprite to a mini black sprite. Used by the ; Minimize animation. @@ -1961,7 +1961,7 @@ AnimationMinimizeMon: ; 7966e (1e:566e) MinimizedMonSprite: ; 79693 (1e:5693) INCBIN "gfx/minimized_mon_sprite.1bpp" MinimizedMonSpriteEnd: - + AnimationSlideMonDownAndHide: ; 79698 (1e:5698) ; Slides the mon's sprite down and disappears. Used in Acid Armor. ld a, $1 @@ -1971,7 +1971,7 @@ AnimationSlideMonDownAndHide: ; 79698 (1e:5698) push af call AnimationHideMonPic pop af - push af + push af call GetTileIDList call GetMonSpriteTileMapPointerFromRowCount call CopyPicTiles @@ -2138,7 +2138,7 @@ WavyScreenLineOffsets: ; 7978e (1e:578e) db 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1 db 0, 0, 0, 0, 0, -1, -1, -1, -2, -2, -2, -2, -2, -1, -1, -1 db $80 ; terminator - + AnimationSubstitute: ; 797af (1e:57af) ; Changes the pokemon's sprite to the mini sprite ld hl, wTempPic @@ -2182,7 +2182,7 @@ CopySlowbroSpriteData: ; 7980e (1e:580e) ld bc, $0010 ld a, BANK(SlowbroSprite) jp FarCopyData - + HideSubstituteShowMonAnim: ; 79816 (1e:5816) ld a, [H_WHOSETURN] and a @@ -2291,7 +2291,7 @@ AnimationTransformMon: ; 798c8 (1e:58c8) ld [wChangeMonPicPlayerTurnSpecies], a ld a, [wBattleMonSpecies] ld [wChangeMonPicEnemyTurnSpecies], a - + ChangeMonPic: ; 798d4 (1e:58d4) ld a, [H_WHOSETURN] and a @@ -2332,7 +2332,7 @@ AnimationHideEnemyMonPic: ; 79919 (1e:5919) ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a jp Delay3 - + Func_79929: ; 79929 (1e:5929) ld hl, wPlayerMonMinimized ld a, [H_WHOSETURN] @@ -2349,7 +2349,7 @@ Func_79929: ; 79929 (1e:5929) call AnimationFlashMonPic call AnimationShowMonPic ret - + InitMultipleObjectsOAM: ; 79943 (1e:5943) ; Writes c OAM entries with tile d. ; Sets their Y coordinates to sequential multiples of 8, starting from 0. @@ -2370,9 +2370,9 @@ InitMultipleObjectsOAM: ; 79943 (1e:5943) dec c jr nz, .loop ret - + ret ; unreferenced - + AnimationHideMonPic: ; 7995d (1e:595d) ; Hides the mon's sprite. ld a, [H_WHOSETURN] @@ -2382,7 +2382,7 @@ AnimationHideMonPic: ; 7995d (1e:595d) jr ClearMonPicFromTileMap .playerTurn ld a, 5 * SCREEN_WIDTH + 1 - + ClearMonPicFromTileMap: ; 79968 (1e:5968) push hl push de @@ -2397,7 +2397,7 @@ ClearMonPicFromTileMap: ; 79968 (1e:5968) pop de pop hl ret - + ; puts the tile map destination address of a mon sprite in hl, given the row count in b ; The usual row count is 7, but it may be smaller when sliding a mon sprite in/out, ; in order to show only a portion of the mon sprite. @@ -2473,7 +2473,7 @@ AnimCopyRowRight: ; 799be (1e:59be) jr nz, AnimCopyRowRight ret -; get the sound of the move id in b +; get the sound of the move id in b GetMoveSoundB: ; 799c5 (1e:59c5) ld a, b call GetMoveSound @@ -2859,7 +2859,7 @@ AnimationLeavesFalling: ; 79dd0 (1e:5dd0) ld a, 3 ; number of leaves ld [wNumFallingObjects], a jp AnimationFallingObjects - + AnimationPetalsFalling: ; 79de2 (1e:5de2) ; Makes lots of petals fall down from the top of the screen. It's used in ; the animation for Petal Dance. @@ -3153,7 +3153,7 @@ BattleAnimCopyTileMapToVRAM: ; 79fae (1e:5fae) ld a, l ld [H_AUTOBGTRANSFERDEST], a jp Delay3 - + TossBallAnimation: ; 79fb7 (1e:5fb7) ld a,[wIsInBattle] cp a,2 @@ -3210,7 +3210,7 @@ TossBallAnimation: ; 79fb7 (1e:5fb7) ld a,BLOCKBALL_ANIM ld [wAnimationID],a jp PlayAnimation - + PlayApplyingAttackSound: ; 7a00b (1e:600b) ; play a different sound depending if move is not very effective, neutral, or super-effective ; don't play any sound at all if move is ineffective diff --git a/engine/battle/bank3d_battle.asm b/engine/battle/bank3d_battle.asm index 4fd37bc4..2b2809d9 100644 --- a/engine/battle/bank3d_battle.asm +++ b/engine/battle/bank3d_battle.asm @@ -166,7 +166,7 @@ _LoadTrainerPic: ; f615a (3d:615a) ld a, $77 ld c, a jp LoadUncompressedSpriteData - + LoadMonBackPic: ; f6178 (3d:6178) ; Assumes the monster's attributes have ; been loaded with GetMonHeader. @@ -186,7 +186,7 @@ LoadMonBackPic: ; f6178 (3d:6178) ld a, [H_LOADEDROMBANK] ld b, a jp CopyVideoData - + AnimateSendingOutMon: ; f61a6 (3d:f61a6) ld a, [wPredefRegisters] ld h, a @@ -256,7 +256,7 @@ CopyUncompressedPicToHL: ; f6203 (3d:6203) dec b jr nz, .asm_f6211 ret - + .asm_f6220 push bc ld b, $0 @@ -279,7 +279,7 @@ CopyUncompressedPicToHL: ; f6203 (3d:6203) dec b jr nz, .asm_f6227 ret - + INCLUDE "engine/battle/init_battle_variables.asm" INCLUDE "engine/battle/moveEffects/focus_energy_effect.asm" INCLUDE "engine/battle/moveEffects/heal_effect.asm" diff --git a/engine/battle/common_text.asm b/engine/battle/common_text.asm index a09241d4..0ca9ce96 100644 --- a/engine/battle/common_text.asm +++ b/engine/battle/common_text.asm @@ -142,7 +142,7 @@ PrintSendOutMonMessage: ; f40e0 (3d:40e5) ld a, [H_QUOTIENT + 3] ; a = (enemy mon current HP * 25) / (enemy max HP / 4); this approximates the current percentage of max HP ld hl, GoText ; 70% or greater cp 70 - jr nc, .printText + jr nc, .printText ld hl, DoItText ; 40% - 69% cp 40 jr nc, .printText diff --git a/engine/battle/core.asm b/engine/battle/core.asm index cb81bf04..565525ea 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -565,7 +565,7 @@ MainInBattleLoop: ; 3c249 (f:4249) call DrawHUDsAndHPBars call CheckNumAttacksLeft jp MainInBattleLoop - + HandlePoisonBurnLeechSeed: ; 3c3d3 (f:43d3) ld hl, wBattleMonHP ld de, wBattleMonStatus @@ -1162,7 +1162,7 @@ RemoveFaintedPlayerMon: ; 3c75e (f:475e) sub b ; enemylevel - playerlevel ; are we stronger than the opposing pokemon? jr c, .regularFaint ; if so, deduct happiness regularly - + cp 30 ; is the enemy 30 levels greater than us? jr nc, .carelessTrainer ; if so, punish the player for being careless, as they shouldn't be fighting a very high leveled trainer with such a level difference .regularFaint @@ -1171,7 +1171,7 @@ RemoveFaintedPlayerMon: ; 3c75e (f:475e) .carelessTrainer callabd_ModifyPikachuHappiness PIKAHAPPY_CARELESSTRAINER ret - + PlayerMonFaintedText: ; 3c7fa (f:47fa) TX_FAR _PlayerMonFaintedText db "@" @@ -2350,11 +2350,11 @@ DisplayBattleMenu: ; 3cf78 (f:4f78) .RunAwayText ; 3d0df (f:50df) TX_FAR _RunAwayText db "@" - + .upperLeftMenuItemWasNotSelected ; a menu item other than the upper left item was selected cp $2 jp nz, PartyMenuOrRockOrRun - + ; either the bag (normal battle) or bait (safari battle) was selected ld a, [wLinkState] cp LINK_STATE_BATTLING @@ -2911,7 +2911,7 @@ Func_3d4f5: ; 3d4f5 (f:54f5) predef MoveAnimation callab Func_78e98 jp MoveSelectionMenu - + Func_3d523: ; 3d523 (f:5523) ld a, [wTestBattlePlayerSelectedMove] dec a @@ -2977,7 +2977,7 @@ AnyMoveToSelect: ; 3d55f (f:555f) .allMovesChecked ; bugfix: only check PP value and not PP up bits ; in case all other moves have no PP left and a move has a PP up used on it -; and a non-PP up move is disabled +; and a non-PP up move is disabled and $3f ; any PP left? ret nz ; return if a move has PP left .noMovesLeft @@ -4150,7 +4150,7 @@ UnaffectedText: ; 3ddbe (f:5dbe) PrintDoesntAffectText: ; 3ddc3 (f:5dc3) ld hl, DoesntAffectMonText jp PrintText - + DoesntAffectMonText: ; 3ddc9 (f:5dc9) TX_FAR _DoesntAffectMonText db "@" @@ -5554,7 +5554,7 @@ AdjustDamageForMoveType: ; 3e517 (f:6517) jp .loop .done ret - + AIGetTypeEffectiveness: ; 3e5bb (f:65bb) ld a,[wEnemyMoveType] ld d,a ; d = type of enemy move diff --git a/engine/battle/moveEffects/one_hit_ko_effect.asm b/engine/battle/moveEffects/one_hit_ko_effect.asm index 28973356..a60d573a 100644 --- a/engine/battle/moveEffects/one_hit_ko_effect.asm +++ b/engine/battle/moveEffects/one_hit_ko_effect.asm @@ -1,5 +1,5 @@ OneHitKOEffect_: ; f64db (3d:64db) - ld hl, wDamage + ld hl, wDamage xor a ld [hli], a ld [hl], a ; set the damage output to zero diff --git a/engine/battle/scale_sprites.asm b/engine/battle/scale_sprites.asm index 3d4c0e0b..03495c82 100644 --- a/engine/battle/scale_sprites.asm +++ b/engine/battle/scale_sprites.asm @@ -7,7 +7,7 @@ ScaleSpriteByTwo: ; 2fd79 (b:7d79) call ScaleSpriteByTwo_ call PrepareRTCDataAndDisableSRAM ret - + ScaleSpriteByTwo_: ; 2fd85 (b:7d85) ld de, S_SPRITEBUFFER1 + (4*4*8) - 5 ; last byte of input data, last 4 rows already skipped ld hl, S_SPRITEBUFFER0 + SPRITEBUFFERSIZE - 1 ; end of destination buffer diff --git a/engine/bg_map_attributes.asm b/engine/bg_map_attributes.asm index c8076728..b2c4c3f1 100644 --- a/engine/bg_map_attributes.asm +++ b/engine/bg_map_attributes.asm @@ -34,7 +34,7 @@ LoadBGMapAttributes:: ; bf450 (2f:7450) ld [rHDMA3], a ld a, e ld [rHDMA4], a - + ld a, [rLCDC] and rLCDC_ENABLE_MASK ; is LCD off? jr z, .lcdOff ; if off, transfer immediately @@ -47,7 +47,7 @@ LoadBGMapAttributes:: ; bf450 (2f:7450) ld a, [rSTAT] and %10 ; are we in HBlank or VBlank? jr nz, .waitForAccessibleVRAMLoop1 ; loop until we're in a safe period to transfer to VRAM -.lcdOff +.lcdOff ld a, c ; number of BG attributes to transfer, plus 1 times 16 ld [rHDMA5], a ; initiate transfer call Func_3082 ; update audio so it doesn't "lag" @@ -104,7 +104,7 @@ LoadBGMapAttributes:: ; bf450 (2f:7450) ld [rVBK], a ei ret - + BGMapAttributesPointers: ; bf4de (2f:74de) dw BGMapAttributes_Unknown1 dw BGMapAttributes_Unknown2 @@ -121,7 +121,7 @@ BGMapAttributesPointers: ; bf4de (2f:74de) dw BGMapAttributes_Unknown13 HandleBadgeFaceAttributes: ; bf4f8 (2f:74f8) -; zero out the attributes if the player doesn't have the respective badge +; zero out the attributes if the player doesn't have the respective badge ; BOULDERBADGE ld hl, vBGMap1 + $183 ld de, wTrainerCardBadgeAttributes + 6 * 0 @@ -174,7 +174,7 @@ HandleBadgeFaceAttributes: ; bf4f8 (2f:74f8) ZeroOutCurrentBadgeAttributes: ; bf551 (2f:7551) push hl - xor a + xor a ld [hli], a ld [hl], a ld bc, $1f @@ -202,16 +202,16 @@ HandlePartyHPBarAttributes: ; bf55d (2f:755d) ld bc, $40 ; get 2nd party location add hl, bc push hl - + push de ; (inefficiently) copy de to hl pop hl - + ld bc, $6 add hl, bc ; get the next palette - + push hl pop de ; copy back to de - + pop hl pop bc dec c diff --git a/engine/cable_club.asm b/engine/cable_club.asm index bafc2b93..3c75b340 100755 --- a/engine/cable_club.asm +++ b/engine/cable_club.asm @@ -978,7 +978,7 @@ CableClub_DrawHorizontalLine: ; 5b94 (1:5b94) dec d jr nz, .drawHorizontalLineLoop ret - + LoadTrainerInfoTextBoxTiles: ; 5b9a (1:5b9a) ld de, TrainerInfoTextBoxTileGraphics ld hl, vChars2 + $760 diff --git a/engine/draw_badges.asm b/engine/draw_badges.asm index bd4aeaa8..3134ae0a 100644 --- a/engine/draw_badges.asm +++ b/engine/draw_badges.asm @@ -115,6 +115,6 @@ DrawBadges: ; e880 (3:6880) .FaceBadgeTiles db $20, $28, $30, $38, $40, $48, $50, $58 - + GymLeaderFaceAndBadgeTileGraphics: ; e91b (3:691b) INCBIN "gfx/badges.2bpp"
\ No newline at end of file diff --git a/engine/evolve_trade.asm b/engine/evolve_trade.asm deleted file mode 100755 index 81e41166..00000000 --- a/engine/evolve_trade.asm +++ /dev/null @@ -1,44 +0,0 @@ -EvolveTradeMon: ; 17d7d (5:7d7d) -; Verify the TradeMon's species name before -; attempting to initiate a trade evolution. - -; The names of the trade evolutions in Blue (JP) -; are checked. In that version, TradeMons that -; can evolve are Graveler and Haunter. - -; In localization, this check was translated -; before monster names were finalized. -; Then, Haunter's name was "Spectre". -; Since its name no longer starts with -; "SP", it is prevented from evolving. - -; This may have been why Red/Green's trades -; were used instead, where none can evolve. - -; This was fixed in Yellow. - - ld a, [wInGameTradeReceiveMonName] - - ; GRAVELER - cp "G" - jr z, .ok - - ; "SPECTRE" (HAUNTER) - cp "S" - ret nz - ld a, [wInGameTradeReceiveMonName + 1] - cp "P" - ret nz - -.ok - ld a, [wPartyCount] - dec a - ld [wWhichPokemon], a - ld a, $1 - ld [wForceEvolution], a - ld a, LINK_STATE_TRADING - ld [wLinkState], a - callab TryEvolvingMon - xor a ; LINK_STATE_NONE - ld [wLinkState], a - jp PlayDefaultMusic diff --git a/engine/evos_moves.asm b/engine/evos_moves.asm index 2e0c3cc9..289c76ed 100755 --- a/engine/evos_moves.asm +++ b/engine/evos_moves.asm @@ -99,7 +99,7 @@ Evolution_PartyMonLoop: ; 3add8 (e:6dd8) and a ld a, [hli] jp nz, .nextEvoEntry1 ; don't evolve if we're in a battle as wcf91 could be holding the last mon sent out - + ld b, a ; evolution item ld a, [wcf91] ; last item used cp b ; was the evolution item in this entry used? @@ -387,16 +387,16 @@ Func_3b079: ; 3b079 (e:7079) push af call Func_3b0a2 jr c, .asm_3b09c - + call Func_3b10f jr nc, .asm_3b096 - + call Func_3b0a2 jr c, .asm_3b09c - + call Func_3b10f jr nc, .asm_3b096 - + call Func_3b0a2 jr c, .asm_3b09c .asm_3b096 @@ -452,7 +452,7 @@ Func_3b0a2: ; 3b0a2 (e:70a2) .asm_3b0ec scf ret - + Pointer_3b0ee: ; 3b0ee (e:70ee) db NIDOKING db IVYSAUR @@ -487,7 +487,7 @@ Pointer_3b0ee: ; 3b0ee (e:70ee) db VILEPLUME db VICTREEBEL db $ff - + Func_3b10f: ; 3b10f (e:710f) ld c, $0 .asm_3b111 @@ -665,5 +665,5 @@ GetMonLearnset: ; 3b1d1 (e:71d1) and a ; have we reached the end of the evolution data? jr nz, .skipEvolutionDataLoop ; if not, jump back up ret - + INCLUDE "data/evos_moves.asm" diff --git a/engine/gamefreak.asm b/engine/gamefreak.asm index 77ce6133..e2db39de 100755 --- a/engine/gamefreak.asm +++ b/engine/gamefreak.asm @@ -70,7 +70,7 @@ AnimateShootingStar: ; 7004a (1c:404a) add hl, de dec c jr nz, .clearOAMLoop - + ; Make Gamefreak logo flash. ld b, 3 .flashLogoLoop @@ -95,7 +95,7 @@ AnimateShootingStar: ; 7004a (1c:404a) pop af dec a jr nz, .initSmallStarsOAMLoop - + ; Animate the small stars falling from the Gamefreak logo. xor a ld [wMoveDownSmallStarsOAMCount], a ; wWhichTrade diff --git a/engine/give_pokemon.asm b/engine/give_pokemon.asm index 31587672..5b506be2 100755 --- a/engine/give_pokemon.asm +++ b/engine/give_pokemon.asm @@ -72,7 +72,7 @@ SetPokedexOwnedFlag: ; f676c (3d:676c) UnknownTerminator_f6794: ; f6794 (3d:6794) db "@" - + GotMonText: ; f6795 (3d:6795) TX_FAR _GotMonText db $0b diff --git a/engine/hall_of_fame.asm b/engine/hall_of_fame.asm index d5c8b2f2..9649da5d 100755 --- a/engine/hall_of_fame.asm +++ b/engine/hall_of_fame.asm @@ -166,12 +166,12 @@ HoFDisplayAndRecordMonInfo: ; 7030e (1c:430e) call PlayCry .asm_7033c jp HoFRecordMonInfo - + Func_7033f: ; 7033f (1c:433f) call HoFDisplayMonInfo ld a,[wHoFMonSpecies] jp PlayCry - + HoFDisplayMonInfo: ; 70348 (1c:4348) coord hl, 0, 2 lb bc, 9, 10 diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index c49c04bd..6e232664 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -161,7 +161,7 @@ CinnabarGymQuiz: ; 1e3be (7:63be) CinnabarGymQuizDummyIntroText: ; 1e401 (7:6401) TX_FAR _CinnabarGymQuizDummyIntroText db "@" - + CinnabarGymQuizIntroText: ; 1e406 (7:6406) TX_FAR _CinnabarGymQuizIntroText db "@" @@ -169,7 +169,7 @@ CinnabarGymQuizIntroText: ; 1e406 (7:6406) CinnabarGymQuizShortIntroText: ; 1e40b (7:640b) TX_FAR _CinnabarGymQuizShortIntroText db "@" - + CinnabarQuizQuestions: ; 1e410 (7:6410) dw CinnabarQuizQuestionsText1 dw CinnabarQuizQuestionsText2 @@ -327,7 +327,7 @@ CinnabarGymGateCoords: ; 1e503 (7:6503) db $02,$06,$54,$00 db $02,$03,$54,$00 - + CinnabarGym_ReplaceTileBlock: ; 1e51b (7:651b) ; basically a copy of the first half of ReplaceTileBlock ; before checking if it is necessary to redraw the map view diff --git a/engine/in_game_trades.asm b/engine/in_game_trades.asm index 80cb27f3..ff739ef0 100755 --- a/engine/in_game_trades.asm +++ b/engine/in_game_trades.asm @@ -223,7 +223,7 @@ InGameTrade_FlagActionPredef: ; 71ded (1c:5ded) ld a,[wWhichTrade] ld c,a predef_jump FlagActionPredef - + InGameTrade_CheckForTradeEvo: ; 71df9 (1c:5df9) ld a,[wInGameTradeReceiveMonSpecies] cp KADABRA @@ -235,7 +235,7 @@ InGameTrade_CheckForTradeEvo: ; 71df9 (1c:5df9) cp HAUNTER jr z,.tradeEvo ret - + .tradeEvo ld a,[wPartyCount] dec a @@ -248,7 +248,7 @@ InGameTrade_CheckForTradeEvo: ; 71df9 (1c:5df9) xor a ; LINK_STATE_NONE ld [wLinkState],a jp PlayDefaultMusic - + InGameTrade_TrainerString: ; 71e2d (1c:5e2d) ; "TRAINER@@@@@@@@@@" db $5d, "@@@@@@@@@@" diff --git a/engine/init_player_data.asm b/engine/init_player_data.asm index c1b93505..f240b5db 100644 --- a/engine/init_player_data.asm +++ b/engine/init_player_data.asm @@ -11,12 +11,12 @@ InitPlayerData2: ld a, $ff ld [wUnusedD71B], a - + ld a, 90 ; initialize happiness to 90 ld [wPikachuHappiness], a ld a, $80 ld [wPikachuMood], a ; initialize mood - + ld hl, wPartyCount call InitializeEmptyList ld hl, wNumInBox diff --git a/engine/items/items.asm b/engine/items/items.asm index e147f5a5..cffcb5b3 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -484,7 +484,7 @@ ItemUseBall: ; d3ad (3:53ad) .emptyString db "@" - + ItemUseBallText00: ; d697 (3:5697) ;"It dodged the thrown ball!" ;"This pokemon can't be caught" @@ -744,7 +744,7 @@ Func_d85d: ; d85d (3:585d) ld hl, wcd6d .loop ld a, [hli] - and a + and a jr z, .cannotEvolveWithUsedStone inc hl inc hl @@ -919,7 +919,7 @@ ItemUseMedicine: ; d8ae (3:58ae) pop hl pop af ld [wWhichPokemon], a - + ld a, [wIsInBattle] and a jr z, .compareCurrentHPToMaxHP @@ -1410,7 +1410,7 @@ ItemUseMedicine: ; d8ae (3:58ae) xor a ; PLAYER_PARTY_DATA ld [wMonDataLocation], a predef LearnMoveFromLevelUp ; learn level up move, if any - + xor a ld [wForceEvolution], a callabd_ModifyPikachuHappiness PIKAHAPPY_LEVELUP @@ -1421,7 +1421,7 @@ ItemUseMedicine: ; d8ae (3:58ae) callab Func_2fd6a ; evolve pokemon, if appropriate pop af ld [wWhichPokemon], a - + callab TryEvolvingMon ld a, $01 ld [wUpdateSpritesEnabled], a @@ -1628,7 +1628,7 @@ ItemUseCardKey: ; de57 (3:de57) set 7, [hl] ret -; These tables are probably supposed to be door locations in Silph Co., +; These tables are probably supposed to be door locations in Silph Co., ; but they are unused. ; The reason there are 3 tables is unknown. @@ -1681,7 +1681,7 @@ ItemUseGuardSpec: ; df11 (3:5f11) ld a, [wIsInBattle] and a jp z, ItemUseNotTime - + ld a, [wWhichPokemon] push af ld a, [wPlayerMonNumber] @@ -1689,7 +1689,7 @@ ItemUseGuardSpec: ; df11 (3:5f11) callabd_ModifyPikachuHappiness PIKAHAPPY_USEDXITEM pop af ld [wWhichPokemon], a - + ld hl, wPlayerBattleStatus2 set ProtectedByMist, [hl] ; Mist bit jp PrintItemUseTextAndRemoveItem @@ -1706,7 +1706,7 @@ ItemUseDireHit: ; df42 (3:5f42) ld a, [wIsInBattle] and a jp z, ItemUseNotTime - + ld a, [wWhichPokemon] push af ld a, [wPlayerMonNumber] @@ -1714,7 +1714,7 @@ ItemUseDireHit: ; df42 (3:5f42) callabd_ModifyPikachuHappiness PIKAHAPPY_USEDXITEM pop af ld [wWhichPokemon], a - + ld hl, wPlayerBattleStatus2 set GettingPumped, [hl] ; Focus Energy bit jp PrintItemUseTextAndRemoveItem @@ -1746,7 +1746,7 @@ ItemUseXStat: ; df69 (3:df69) xor a ld [H_WHOSETURN], a ; set turn to player's turn callba StatModifierUpEffect ; do stat increase move - + ld a, [wWhichPokemon] push af ld a, [wPlayerMonNumber] @@ -1754,7 +1754,7 @@ ItemUseXStat: ; df69 (3:df69) callabd_ModifyPikachuHappiness PIKAHAPPY_USEDXITEM pop af ld [wWhichPokemon], a - + pop hl pop af ld [hld], a ; restore [wPlayerMoveEffect] @@ -2005,10 +2005,9 @@ ItemUseSuperRod: ; e130 (3:6130) ld [wRodResponse], a jr DoNotGenerateFishingEncounter - RodResponse: ; e15b (3:615b) ld [wRodResponse], a - + dec a ; is there a bite? jr nz, DoNotGenerateFishingEncounter ; if yes, store level and species data @@ -2234,7 +2233,7 @@ ItemUsePPRestore: ; e1f7 (3:61f7) ret z ; if so, return add a, 10 ; increase current PP by 10 ; b holds the max PP amount and b will hold the new PP amount. -; So, if the new amount meets or exceeds the max amount, +; So, if the new amount meets or exceeds the max amount, ; cap the amount to the max amount by leaving b unchanged. ; Otherwise, store the new amount in b. cp b ; does the new amount meet or exceed the maximum? @@ -2420,7 +2419,7 @@ ItemUseTMHM: ; e374 (3:6374) ld a, b and a ret z - + ld a, [wWhichPokemon] push af ld a, d @@ -2494,7 +2493,6 @@ Func_e4bf: ; e4bf (3:64bf) ld hl, DontHavePokemonText jp PrintText - ThrowBallAtTrainerMon: ; e4ca (3:64ca) call RunDefaultPaletteCommand call LoadScreenTilesFromBuffer1 ; restore saved screen @@ -2559,7 +2557,7 @@ BoxFullCannotThrowBallText: ; e522 (3:6522) DontHavePokemonText: ; e527 (3:6527) TX_FAR _DontHavePokemonText db "@" - + ItemUseText00: ; e52c (3:652c) TX_FAR _ItemUseText001 db $05 diff --git a/engine/items/tms.asm b/engine/items/tms.asm index 9621e550..ff10d134 100755 --- a/engine/items/tms.asm +++ b/engine/items/tms.asm @@ -25,7 +25,7 @@ CanLearnTM: ; 122f0 (4:62f0) pop hl ld c, 0 ret - + ; converts TM/HM number in wd11e into move number ; HMs start at 51 TMToMove: ; 1231d (4:631d) diff --git a/engine/load_mon_data.asm b/engine/load_mon_data.asm index 41ba65b1..4a1e3097 100644 --- a/engine/load_mon_data.asm +++ b/engine/load_mon_data.asm @@ -16,7 +16,7 @@ LoadMonData_: ; 442b (1:442b) ld a, [wWhichPokemon] ld e, a call GetMonSpecies - + .GetMonHeader ld a, [wcf91] ld [wd0b5], a ; input for GetMonHeader @@ -47,7 +47,7 @@ LoadMonData_: ; 442b (1:442b) ld de, wLoadedMon ld bc, wPartyMon2 - wPartyMon1 jp CopyData - + ; get species of mon e in list [wMonDataLocation] for LoadMonData GetMonSpecies: ; 4478 (1:4478) ld hl, wPartySpecies diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm index 9055a9d2..e104f693 100644 --- a/engine/menu/bills_pc.asm +++ b/engine/menu/bills_pc.asm @@ -183,7 +183,7 @@ BillsPCMenu: ; 21495 (8:5495) jp z, BillsPCChangeBox ; change box cp $4 jp z, BillsPCPrintBox - + ExitBillsPC: ; 2153e (8:553e) ld a, [wFlags_0xcd60] bit 3, a ; accessing Bill's PC through another PC? @@ -356,7 +356,7 @@ BillsPCRelease: ; 21690 (8:5690) ld hl, PikachuUnhappyText call PrintText jp BillsPCMenu - + BillsPCChangeBox: ; 216e7 (8:56e7) callba ChangeBox jp BillsPCMenu @@ -540,7 +540,7 @@ PikachuUnhappyText: ; 21853 (8:5853) ReleaseWhichMonText: ; 21858 (8:5858) TX_FAR _ReleaseWhichMonText db "@" - + OnceReleasedText: ; 2185d (8:585d) TX_FAR _OnceReleasedText db "@" diff --git a/engine/menu/link_menu.asm b/engine/menu/link_menu.asm index 73e19038..becefd47 100644 --- a/engine/menu/link_menu.asm +++ b/engine/menu/link_menu.asm @@ -175,7 +175,7 @@ Func_f531b:: ; f531b (3d:531b) ld [wUnknownSerialCounter+1],a and a ret - + Func_f5476:: ; f5476 (3d:5476) ld hl,ColosseumIneligibleText call PrintText @@ -207,7 +207,7 @@ PokeCup:: ; f548e (3d:548e) dec b jr nz,.loop dec hl - dec hl + dec hl cp [hl] ; is third mon second mon? jp z,DuplicateSpecies dec hl ; wPartySpecies @@ -253,7 +253,7 @@ PikaCup:: ; f54e4 (3d:54e4) dec b jr nz,.loop dec hl - dec hl + dec hl cp [hl] ; is third mon second mon? jp z,DuplicateSpecies dec hl ; wPartySpecies @@ -285,7 +285,7 @@ PikaCup:: ; f54e4 (3d:54e4) jp nc,CombinedLevelsAbove50 xor a ret - + PetitCup:: ; f553a (3d:553a) ld hl,wPartyCount ld a,[hli] @@ -299,7 +299,7 @@ PetitCup:: ; f553a (3d:553a) dec b jr nz,.loop dec hl - dec hl + dec hl cp [hl] ; is third mon second mon? jp z,DuplicateSpecies dec hl ; wPartySpecies @@ -406,7 +406,7 @@ PetitCup:: ; f553a (3d:553a) jp nc,CombinedLevelsAbove80 xor a ret - + NotThreeMonsInParty:: ; f561d (3d:516d) ld hl,Colosseum3MonsText call PrintText @@ -418,67 +418,67 @@ MewInParty:: ; f5626 (3d:f5626) call PrintText ld a,$2 ret - + DuplicateSpecies:: ; f562f (3d:f562f) ld hl,ColosseumDifferentMonsText call PrintText ld a,$3 ret - + LevelAbove55:: ; f5638 (3d:5638) ld hl,ColosseumMaxL55Text call PrintText ld a,$4 ret - + LevelUnder50:: ; f5641 (3d:5641) ld hl,ColosseumMinL50Text call PrintText ld a,$5 ret - + CombinedLevelsGreaterThan155:: ; f5641 (3d:564a) ld hl,ColosseumTotalL155Text call PrintText ld a,$6 ret - + LevelAbove30:: ; f5653 (3d:5653) ld hl,ColosseumMaxL30Text call PrintText ld a,$7 ret - + LevelUnder25:: ; f565c (3d:565c) ld hl,ColosseumMinL25Text call PrintText ld a,$8 ret - + CombinedLevelsAbove80:: ; f5665 (3d:5665) ld hl,ColosseumTotalL80Text call PrintText ld a,$9 ret - + LevelAbove20:: ; f566e (3d:566e) ld hl,ColosseumMaxL20Text call PrintText ld a,$a ret - + LevelUnder15:: ; f5677 (3d:5677) ld hl,ColosseumMinL15Text call PrintText ld a,$b ret - + CombinedLevelsAbove50:: ; f5680 (3d:5680) ld hl,ColosseumTotalL50Text call PrintText ld a,$c ret - + asm_f5689:: ; f5689 (3d:5689) pop af pop bc @@ -489,7 +489,7 @@ asm_f5689:: ; f5689 (3d:5689) call PrintText ld a,$d ret - + asm_f569b:: ; f569b (3d:569b) pop af pop bc @@ -500,7 +500,7 @@ asm_f569b:: ; f569b (3d:569b) call PrintText ld a,$e ret - + asm_f56ad:: ; f56ad (3d:56ad) ld a,[hl] ld [wd11e],a @@ -509,7 +509,7 @@ asm_f56ad:: ; f56ad (3d:56ad) call PrintText ld a,$f ret - + Func_f56bd:: ; f56bd (3d:56bd) xor a ld [H_AUTOBGTRANSFERENABLED],a @@ -537,31 +537,31 @@ Func_f56bd:: ; f56bd (3d:56bd) ld a,$1 ld [H_AUTOBGTRANSFERENABLED],a ret - + PointerTable_f56ee:: ; f56ee (3d:56ee) dw Text_f56f4 dw Text_f5728 dw Text_f575b - + Text_f56f4:: ; f56f4 (3d:56f4) db "LVs of 3<pkmn>:50-55" next "Sum of LVs:155 MAX" next "MEW can't attend.@" - + Text_f5728:: ; f5728 (3d:5728) db "LVs of 3<pkmn>:15-20" next "Sum of LVs:50 MAX" next "MEW can't attend.@" - + Text_f575b:: ; f575b (3d:575b) db "3 Basic <pkmn>.LV25-30" next "Sum of LVs:80 MAX" next "6′8″ and 44lb MAX@" - + Text_f5791:: ; f5791 (3d:5791) db "View" next "Rules@" - + Text_f579c:: ; f579c (3d:579c) db "# Cup" next "Pika Cup" @@ -623,7 +623,7 @@ ColosseumHeightText:: ; f57f8 (3d:57f8) ColosseumWeightText:: ; f57fd (3d:57fd) TX_FAR _ColosseumWeightText ; a0b9f db "@" - + ColosseumEvolvedText:: ; f5802 (3d:5802) TX_FAR _ColosseumEvolvedText ; a0bbb db "@" @@ -631,7 +631,7 @@ ColosseumEvolvedText:: ; f5802 (3d:5802) ColosseumIneligibleText:: ; f5807 (3d:5807) TX_FAR _ColosseumIneligibleText ; a0bd4 db "@" - + LinkMenu: ; f580c (3d:580c) xor a ld [wLetterPrintingDelayFlags], a @@ -854,7 +854,7 @@ LinkMenu: ; f580c (3d:580c) ld e,"▷" call Func_f59ec jp .choseCancel - + .asm_f59cd ld hl,ColosseumVersionText call PrintText @@ -870,7 +870,7 @@ LinkMenu: ; f580c (3d:580c) jp c,.choseCancel ld a,$f0 jp .next - + Func_f59ec:: ; f59ec (3d:59ec) ld a, b Coorda 6, 5 @@ -883,7 +883,7 @@ Func_f59ec:: ; f59ec (3d:59ec) ld c, 40 call DelayFrames ret - + ColosseumWhereToText: ; f5a02 (3d:5a02) TX_FAR _ColosseumWhereToText db "@" @@ -899,7 +899,7 @@ ColosseumCanceledText: ; f5a0c (3d:5a0c) ColosseumVersionText: ; f5a11 (3d:5a11) TX_FAR _ColosseumVersionText ; 28:4c47 db "@" - + TextTerminator_f5a16: ; f5a16 (3d:5a16) db "@" diff --git a/engine/menu/main_menu.asm b/engine/menu/main_menu.asm index 3f1ca0e8..fb3fb6b9 100755 --- a/engine/menu/main_menu.asm +++ b/engine/menu/main_menu.asm @@ -139,11 +139,11 @@ Func_5cc1: ; 5cc1 (1:5cc1) ld hl, NotEnoughMemoryText call PrintText ret - -NotEnoughMemoryText: ; 5ccd (1:5ccd) + +NotEnoughMemoryText: ; 5ccd (1:5ccd) TX_FAR _NotEnoughMemoryText db "@" - + StartNewGame: ; 5cd2 (1:5cd2) ld hl, wd732 res 1, [hl] diff --git a/engine/menu/options.asm b/engine/menu/options.asm index 4b8eb883..86a55bd2 100644 --- a/engine/menu/options.asm +++ b/engine/menu/options.asm @@ -39,7 +39,7 @@ OptionMenuJumpTable: ; 41ca4 (10:5ca4) dw OptionsMenu_Dummy dw OptionsMenu_Dummy dw OptionsMenu_Cancel - + OptionsMenu_TextSpeed: ; 41cb4 (10:5cb4) call Func_41d07 ld a, [hJoy5] @@ -83,19 +83,19 @@ OptionsMenu_TextSpeed: ; 41cb4 (10:5cb4) call PlaceString and a ret - + TextSpeedStringsPointerTable: ; 41cf2 (10:5cf2) dw FastText dw MidText dw SlowText - + FastText: ; 41cf9 (10:5cf9) db "FAST@" MidText: ; 41cfd (10:5cfd) db "MID @" SlowText: ; 41d02 (10:5d02) db "SLOW@" - + Func_41d07: ; 41d07 (10:5d07) ld a, [wOptions] and $f @@ -115,7 +115,7 @@ Func_41d07: ; 41d07 (10:5d07) ld c, $0 lb de, 5, 3 ret - + OptionsMenu_BattleAnimations: ; 41d26 (10:5d26) ld a, [hJoy5] and D_RIGHT | D_LEFT @@ -141,16 +141,16 @@ OptionsMenu_BattleAnimations: ; 41d26 (10:5d26) call PlaceString and a ret - + AnimationOptionStringsPointerTable: ; 41d52 (10:5d52) dw AnimationOnText dw AnimationOffText - + AnimationOnText: ; 41d56 (10:5d56) db "ON @" AnimationOffText: ; 41d5a (10:5d5a) db "OFF@" - + OptionsMenu_BattleStyle: ; 41d5e (10:5d5e) ld a, [hJoy5] and D_LEFT | D_RIGHT @@ -177,16 +177,16 @@ OptionsMenu_BattleStyle: ; 41d5e (10:5d5e) call PlaceString and a ret - + BattleStyleOptionStringsPointerTable: ; 41d8c (10:5d8c) dw BattleStyleShiftText dw BattleStyleSetText - + BattleStyleShiftText: ; 41d90 (10:5d90) db "SHIFT@" BattleStyleSetText: ; 41d96 (10:5d96) db "SET @" - + OptionsMenu_SpeakerSettings: ; 41d9c (10:5d9c) ld a, [wOptions] and $30 @@ -235,7 +235,7 @@ SpeakerOptionStringsPointerTable: ; 41ddc (10:5ddc) dw Earphone1SoundText dw Earphone2SoundText dw Earphone3SoundText - + MonoSoundText: ; 41de4 (10:5de4) db "MONO @" Earphone1SoundText: ; 41dee (10:5dee) @@ -244,7 +244,7 @@ Earphone2SoundText: ; 41df8 (10:5df8) db "EARPHONE2@" Earphone3SoundText: ; 41e02 (10:5e02) db "EARPHONE3@" - + OptionsMenu_GBPrinterBrightness: ; 41e0c (10:5e0c) call Func_41e7b ld a, [hJoy5] @@ -285,14 +285,14 @@ OptionsMenu_GBPrinterBrightness: ; 41e0c (10:5e0c) call PlaceString and a ret - + GBPrinterOptionStringsPointerTable: ; 41e44 (10:5e44) dw LightestPrintText dw LighterPrintText dw NormalPrintText dw DarkerPrintText dw DarkestPrintText - + LightestPrintText: ; 41e4e (10:5e4e) db "LIGHTEST@" LighterPrintText: ; 41e57 (10:5e57) @@ -303,7 +303,7 @@ DarkerPrintText: ; 41e69 (10:5e69) db "DARKER @" DarkestPrintText: ; 41e72 (10:5e72) db "DARKEST @" - + Func_41e7b: ; 41e7b (10:5e7b) ld a, [wPrinterSettings] and a @@ -347,7 +347,7 @@ OptionsMenu_Cancel: ; 41ead (10:5ead) .pressedCancel scf ret - + Func_41eb7: ; 41eb7 (10:5eb7) ld hl, wOptionsCursorLocation ld a, [hJoy5] @@ -387,7 +387,7 @@ Func_41eb7: ; 41eb7 (10:5eb7) dec [hl] scf ret - + Func_41ee9: ; 41ee9 (10:5ee9) coord hl, 1, 1 ld de, SCREEN_WIDTH @@ -431,13 +431,13 @@ Func_41f06: ; 41f06 (10:5f06) ld [H_AUTOBGTRANSFERENABLED], a call Delay3 ret - + AllOptionsText: ; 41f3e (10:5f3e) db "TEXT SPEED :" next "ANIMATION :" next "BATTLESTYLE:" next "SOUND:" next "PRINT:@" - + OptionMenuCancelText: ; 41f73 (10:5f73) db "CANCEL@"
\ No newline at end of file diff --git a/engine/menu/players_pc.asm b/engine/menu/players_pc.asm index 1fcf1f49..38cdf2f6 100755 --- a/engine/menu/players_pc.asm +++ b/engine/menu/players_pc.asm @@ -13,7 +13,7 @@ PlayerPC: ; 778e (1:778e) call PlaySound ld hl, TurnedOnPC2Text call PrintText - + PlayerPCMenu: ; 790c (1:790c) ld hl, wd730 set 6, [hl] diff --git a/engine/menu/pokedex.asm b/engine/menu/pokedex.asm index c8a37f2e..7715500b 100755 --- a/engine/menu/pokedex.asm +++ b/engine/menu/pokedex.asm @@ -475,7 +475,6 @@ ShowPokedexDataInternal: ; 40323 (10:4323) ld [rNR50], a ret - HeightWeightText: ; 40370 (10:4370) db "HT ?", $60, "??", $61 next "WT ???lb@" @@ -690,7 +689,6 @@ Pokedex_PrepareDexEntryForPrinting: ; 404bc (10:44bc) ld [hFlags_0xFFFA], a ret - ; draws a line of tiles ; INPUT: ; b = tile ID diff --git a/engine/mon_party_sprites.asm b/engine/mon_party_sprites.asm index 09d1cb4c..b4091d9c 100755 --- a/engine/mon_party_sprites.asm +++ b/engine/mon_party_sprites.asm @@ -227,12 +227,12 @@ MonPartySpritePointers: ; 7184d (1c:584d) db $10 / $10 ; $10 bytes db BANK(MonPartySprites) dw vSprites + $260 - + dw PikachuSprite db $40 / $10 ; $40 bytes db BANK(PikachuSprite) dw vSprites + $280 - + dw MonPartySprites + $100 db $40 / $10 ; $40 bytes db BANK(MonPartySprites) diff --git a/engine/oak_speech.asm b/engine/oak_speech.asm index 346df99b..925ff913 100755 --- a/engine/oak_speech.asm +++ b/engine/oak_speech.asm @@ -39,7 +39,7 @@ SetDefaultNames: ; 5e27 (1:5e27) ld bc, NAME_LENGTH call CopyData ; rip optimizations ret - + OakSpeech: ; 5e85 (1:5e85) call StopAllMusic ; stop music ld a, BANK(Music_Routes2) @@ -157,7 +157,7 @@ OakSpeech: ; 5e85 (1:5e85) call GBFadeOutToWhite call ClearScreen ; rip more tail-end optimizations ret - + OakSpeechText1: ; 5fb9 (1:5fb9) TX_FAR _OakSpeechText1 db "@" diff --git a/engine/oak_speech2.asm b/engine/oak_speech2.asm index 911a4ed0..37c998a9 100755 --- a/engine/oak_speech2.asm +++ b/engine/oak_speech2.asm @@ -224,7 +224,7 @@ GetDefaultName: ; 6858 (1:6858) ld de, wcd6d ld bc, $14 jp CopyData - + DefaultNamesPlayerList: ; 687d (1:687d) db "NEW NAME@YELLOW@ASH@JACK@" DefaultNamesRivalList: ; 688d (1:688d) diff --git a/engine/overworld/cable_club_npc.asm b/engine/overworld/cable_club_npc.asm index f60042de..bc1a553a 100755 --- a/engine/overworld/cable_club_npc.asm +++ b/engine/overworld/cable_club_npc.asm @@ -165,7 +165,7 @@ Serial_SyncAndExchangeNybbleDouble: ; 7131 (1:7131) ld [wUnknownSerialCounter], a ld [wUnknownSerialCounter + 1], a ret - + CableClubNPCAreaReservedFor2FriendsLinkedByCableText: ; 7188 (1:7188) TX_FAR _CableClubNPCAreaReservedFor2FriendsLinkedByCableText db "@" diff --git a/engine/overworld/check_player_state.asm b/engine/overworld/check_player_state.asm index 0fc73bc7..5dd91c4c 100644 --- a/engine/overworld/check_player_state.asm +++ b/engine/overworld/check_player_state.asm @@ -83,7 +83,7 @@ CheckForceBikeOrSurf: ; c0d2 (3:40d2) ld [wWalkBikeSurfStateCopy], a call ForceBikeOrSurf ret - + INCLUDE "data/force_bike_surf.asm" IsPlayerFacingEdgeOfMap: ; c148 (3:4148) diff --git a/engine/overworld/get_coords_tile_in_front_of_player.asm b/engine/overworld/get_coords_tile_in_front_of_player.asm index ce45e79c..1003570b 100644 --- a/engine/overworld/get_coords_tile_in_front_of_player.asm +++ b/engine/overworld/get_coords_tile_in_front_of_player.asm @@ -1,6 +1,6 @@ GetTileAndCoordsInFrontOfPlayer: ; c2d4 (3:42d1) call GetPredefRegisters - + _GetTileAndCoordsInFrontOfPlayer: ; c2d4 (3:42d4) ld a, [wYCoord] ld d, a @@ -37,7 +37,7 @@ _GetTileAndCoordsInFrontOfPlayer: ; c2d4 (3:42d4) ld c, a ld [wTileInFrontOfPlayer], a ret - + GetTileTwoStepsInFrontOfPlayer: ; c309 (3:4309) xor a ld [$ffdb], a diff --git a/engine/overworld/is_player_just_outside_map.asm b/engine/overworld/is_player_just_outside_map.asm index e9ba204a..19823c53 100644 --- a/engine/overworld/is_player_just_outside_map.asm +++ b/engine/overworld/is_player_just_outside_map.asm @@ -1,5 +1,5 @@ ; returns whether the player is one tile outside the map in Z -IsPlayerJustOutsideMap: ; 128d8 (4:68d8) +IsPlayerJustOutsideMap: ; e876c (3a:476c) ld a, [wYCoord] ld b, a ld a, [wCurMapHeight] diff --git a/engine/overworld/load_wild_data.asm b/engine/overworld/load_wild_data.asm index 083e08bf..71e3fe2a 100644 --- a/engine/overworld/load_wild_data.asm +++ b/engine/overworld/load_wild_data.asm @@ -29,5 +29,5 @@ LoadWildData: ; cb62 (3:4b62) ld de,wWaterMons ; otherwise, load surfing data ld bc,$0014 jp CopyData - + INCLUDE "data/wild_mons.asm"
\ No newline at end of file diff --git a/engine/overworld/map_sprite_functions1.asm b/engine/overworld/map_sprite_functions1.asm index 46479a9f..722fc14e 100644 --- a/engine/overworld/map_sprite_functions1.asm +++ b/engine/overworld/map_sprite_functions1.asm @@ -55,7 +55,7 @@ UpdateNonPlayerSprite: ; 4be3 (1:4be3) ; multiple of $10 to make comparisons easier. DetectCollisionBetweenSprites: ; 4bf7 (1:4bf7) ; nop - + ld h, wSpriteStateData1 / $100 ld a, [H_CURRENTSPRITEOFFSET] ld l, a @@ -355,7 +355,7 @@ Func_4d0a: ; 4d0a (1:4d0a) inc l inc l ret - + SetSpriteCollisionValues: ; 4d22 (1:4d22) and a ld b, 0 diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm index 68f6b006..10f0362e 100755 --- a/engine/overworld/map_sprites.asm +++ b/engine/overworld/map_sprites.asm @@ -16,7 +16,7 @@ _InitMapSprites: ; 1401b (5:401b) call LoadMapSpriteTilePatterns call Func_14150 ret - + ; Loads sprite set for outside maps (cities and routes) and sets VRAM slots. ; sets carry if the map is a city or route, unsets carry if not InitOutsideMapSprites: ; 14029 (5:4029) @@ -49,7 +49,7 @@ InitOutsideMapSprites: ; 14029 (5:4029) call Func_14150 scf ret - + LoadSpriteSetFromMapHeader: ; 14061 (5:4061) ; This loop stores the correct VRAM tile pattern slots according the sprite ; data from the map's header. Since the VRAM tile pattern slots are filled in @@ -81,7 +81,7 @@ LoadSpriteSetFromMapHeader: ; 14061 (5:4061) jr .continue .isFourTileSprite -; loop through the space reserved for regular picture IDs +; loop through the space reserved for regular picture IDs ld de, wSpriteSet ld b, 9 call CheckIfPictureIDAlreadyLoaded @@ -100,11 +100,11 @@ CheckIfPictureIDAlreadyLoaded: ; 1409b (5:409b) .loop ld a, [de] and a ; is sprite set slot not taken up yet? - jr z, .spriteSlotNotTaken ; if so, load it as it signifies we've reached + jr z, .spriteSlotNotTaken ; if so, load it as it signifies we've reached ; the end of data for the last sprite set cp c ; is the tile pattern already loaded? - ret z ; don't redundantly load + ret z ; don't redundantly load dec b ; have we reached the end of the sprite set? jr z, .spriteNotAlreadyLoaded ; if so, we're done here inc de @@ -124,7 +124,7 @@ CheckForFourTileSprite: ; 140ac (5:40ac) ; Else, returns carry if the sprite uses 4 tiles cp SPRITE_PIKACHU ; is this the Pikachu Sprite? ret z ; return if yes - + cp SPRITE_BALL ; is this a four tile sprite? jr nc, .notYellowSprite ; set carry if yes ; regular sprite @@ -132,7 +132,7 @@ CheckForFourTileSprite: ; 140ac (5:40ac) ret .notYellowSprite - scf + scf ret LoadMapSpriteTilePatterns: ; 140b7 (5:40b7) @@ -153,7 +153,7 @@ LoadMapSpriteTilePatterns: ; 140b7 (5:40b7) cp 11 jr nz, .loop ret - + ReloadWalkingTilePatterns: ; 140d2 (5:40d2) xor a .loop @@ -167,7 +167,7 @@ ReloadWalkingTilePatterns: ; 140d2 (5:40d2) cp 11 jr nz, .loop ret - + LoadStillTilePattern: ; 140e4 (5:40e4) ld a, [wFontLoaded] bit 0, a ; reloading upper half of tile patterns after displaying text? @@ -177,7 +177,7 @@ LoadStillTilePattern: ; 140e4 (5:40e4) call GetSpriteVRAMAddress call CopyVideoDataAlternate ; new yellow function ret - + LoadWalkingTilePattern: ; 140f5 (5:40f5) call ReadSpriteSheetData ret nc @@ -189,7 +189,7 @@ LoadWalkingTilePattern: ; 140f5 (5:40f5) set 3, h ; add $800 to hl call CopyVideoDataAlternate ret - + GetSpriteVRAMAddress: ; 14018 (5:4108) push bc ld a, [hVRAMSlot] @@ -203,7 +203,7 @@ GetSpriteVRAMAddress: ; 14018 (5:4108) ld l, a pop bc ret - + SpriteVRAMAddresses: ; 14118 (5:4118) ; Equivalent to multiplying $C0 (number of bytes in 12 tiles) times the VRAM ; slot and adding the result to $8000 (the VRAM base address). @@ -218,7 +218,7 @@ SpriteVRAMAddresses: ; 14118 (5:4118) dw vChars0 + $6c0 dw vChars0 + $780 ; 4-tile sprites dw vChars0 + $7c0 ; 4-tile sprites - + ReadSpriteSheetData: ; 1412e (5:412e) ld a, [hVRAMSlot] ld e, a @@ -248,13 +248,12 @@ ReadSpriteSheetData: ; 1412e (5:412e) inc hl scf ret - + Func_14150: ; 14150 (5:4150) ld a, $1 ld [wPlayerSpriteImageBaseOffset], a ; vram slot for player ld a, $2 ld [wPikachuSpriteImageBaseOffset], a ; vram slot for Pikachu - ld a, $e ld hl, wSprite01SpriteStateData1 .loop @@ -275,7 +274,7 @@ Func_14150: ; 14150 (5:4150) dec a jr nz, .loop ret - + Func_14179: ; 14179 (5:4179) push de push bc diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index 6bd28dad..5f929ce3 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -93,7 +93,7 @@ Func_4e32: ; 4e32 (1:4e32) add b ld [wSpriteStateData1 + 2], a ret - + UpdateNPCSprite: ; 4e3e (1:4e3e) ld a, [H_CURRENTSPRITEOFFSET] swap a @@ -836,7 +836,7 @@ AdvanceScriptedNPCAnimFrameCounter: ; 5264 (1:5264) and $3 ld [hSpriteAnimFrameCounter], a ret - + Func_5274: ; 5274 (1:5274) ld a, [H_CURRENTSPRITEOFFSET] add $7 @@ -853,7 +853,7 @@ Func_5274: ; 5274 (1:5274) and $3 ld [hl], a ; advance to next animation frame every 4 ticks (16 ticks total for one step) ret - + Func_5288: ; 5288 (1:5288) ; nice lookup table ; a is supposedly [wNPCMovementDirections + $fe] @@ -914,7 +914,7 @@ Func_5288: ; 5288 (1:5288) .asm_52e1 call Func_532b jr .asm_530b - + .asm_52e6 call Func_5337 call Func_5349 @@ -939,7 +939,7 @@ Func_5288: ; 5288 (1:5288) call UpdateSpriteImage scf ret - + .asm_530b call Func_5337 call Func_5349 @@ -952,27 +952,27 @@ Func_5288: ; 5288 (1:5288) call UpdateSpriteImage scf ret - + Func_531f: ; 531f (1:531f) lb de, 1, 0 ld c, SPRITE_FACING_DOWN ret - + Func_5325: ; 5325 (1:5325) lb de, -1, 0 ld c, SPRITE_FACING_UP ret - + Func_532b: ; 532b (1:532b) lb de, 0, 1 ld c, SPRITE_FACING_RIGHT ret - + Func_5331: ; 5331 (1:5331) lb de, 0, -1 ld c, SPRITE_FACING_LEFT ret - + Func_5337: ; 5337 (1:5337) ld a, [H_CURRENTSPRITEOFFSET] add $9 @@ -987,7 +987,7 @@ Func_5337: ; 5337 (1:5337) inc l ld [hl], e ; c1x5 (update X movement delta) ret - + Func_5349: ; 5349 (1:5349) ld h, wSpriteStateData2 / $100 ld a, [H_CURRENTSPRITEOFFSET] @@ -1000,7 +1000,7 @@ Func_5349: ; 5349 (1:5349) add e ld [hl], a ; update X position ret - + Func_5357: ; 5357 (1:5357) call Func_5274 ld a, [H_CURRENTSPRITEOFFSET] diff --git a/engine/overworld/npc_movement_2.asm b/engine/overworld/npc_movement_2.asm new file mode 100755 index 00000000..c5e11aa0 --- /dev/null +++ b/engine/overworld/npc_movement_2.asm @@ -0,0 +1,24 @@ +FreezeEnemyTrainerSprite: ; eaa02 (3a:6a02) + ld a, [wCurMap] + cp POKEMONTOWER_7 + ret z ; the Rockets on Pokemon Tower 7F leave after battling, so don't freeze them + ld hl, RivalIDs + ld a, [wEngagedTrainerClass] + ld b, a +.loop + ld a, [hli] + cp $ff + jr z, .notRival + cp b + ret z ; the rival leaves after battling, so don't freeze him + jr .loop +.notRival + ld a, [wSpriteIndex] + ld [H_SPRITEINDEX], a + jp SetSpriteMovementBytesToFF + +RivalIDs: ; eaa20 (3a:6a20) + db OPP_SONY1 + db OPP_SONY2 + db OPP_SONY3 + db $ff diff --git a/engine/overworld/oam.asm b/engine/overworld/oam.asm index f51c839f..ede025cd 100644 --- a/engine/overworld/oam.asm +++ b/engine/overworld/oam.asm @@ -19,10 +19,10 @@ PrepareOAMData: ; 499b (1:499b) .spriteLoop ld [hSpriteOffset2], a - + ld e, a ld d, wSpriteStateData1 / $100 - + ld a, [de] ; c1x0 and a jp z, .nextSprite @@ -42,7 +42,7 @@ PrepareOAMData: ; 499b (1:499b) jr c, .usefacing ; unchanging - ld a, $0 + ld a, $0 jr .next .usefacing @@ -81,7 +81,7 @@ PrepareOAMData: ; 499b (1:499b) call Func_4a7b ld [wd5cd], a ld a, [hOAMBufferOffset] - + ld e, a ld d, wOAMBuffer / $100 @@ -185,7 +185,7 @@ GetSpriteScreenXY: ; 4a5f (1:4a5f) and $f0 ld [de], a ; c1xb (x) ret - + Func_4a7b: ; 4a7b (1:4a7b) push bc ld a, [wd5cd] ; temp copy of c1x2 @@ -228,5 +228,5 @@ _IsTilePassable:: ; 4aaa (1:4aaa) .tileNotPassable scf ret - + INCLUDE "data/collision.asm" ; probably
\ No newline at end of file diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index d0b1cde4..bea43308 100755 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -418,7 +418,7 @@ FishingAnim: ; 70816 (1c:4816) cp $2 ld hl, NothingHereText jr z, .done - + ; there was a bite ; shake the player's sprite vertically @@ -432,7 +432,7 @@ FishingAnim: ; 70816 (1c:4816) call Delay3 dec b jr nz, .loop - + ; If the player is facing up, hide the fishing rod so it doesn't overlap with ; the exclamation bubble that will be shown next. ld a, [wSpriteStateData1 + 2] diff --git a/engine/overworld/pokecenter.asm b/engine/overworld/pokecenter.asm index 63137433..65dfcd87 100755 --- a/engine/overworld/pokecenter.asm +++ b/engine/overworld/pokecenter.asm @@ -106,7 +106,7 @@ Func_6eaa: ; 6eaa (1:6eaa) ld c, 64 call DelayFrames ret - + Func_6ebb: ; 6ebb (1:6ebb) ld a, b ld [H_SPRITEINDEX], a @@ -121,7 +121,7 @@ Func_6ebb: ; 6ebb (1:6ebb) ld [hSpriteImageIndex], a call SpriteFunc_34a1 ret - + PokemonCenterWelcomeText: ; 6de0 (1:6de0) TX_FAR _PokemonCenterWelcomeText db "@" @@ -143,7 +143,7 @@ PokemonCenterFarewellText: ; 6ee5 (1:6ee5) db $a TX_FAR _PokemonCenterFarewellText db "@" - + LooksContentText: ; 6eeb (1:6eeb) TX_FAR _LooksContentText db "@"
\ No newline at end of file diff --git a/engine/overworld/step_functions.asm b/engine/overworld/step_functions.asm index 64d215a1..bc1a74aa 100644 --- a/engine/overworld/step_functions.asm +++ b/engine/overworld/step_functions.asm @@ -123,7 +123,7 @@ ApplyOutOfBattlePoisonDamage: ; c3de (3:43de) .done ld [wOutOfBattleBlackout], a ret - + Func_c4c7: ; c4c7 (3:44c7) ld a, [wStepCounter] and a diff --git a/engine/predefs17_2.asm b/engine/predefs17_2.asm index c0df7d0a..49818543 100755 --- a/engine/predefs17_2.asm +++ b/engine/predefs17_2.asm @@ -1,5 +1,5 @@ ; updates the types of a party mon (pointed to in hl) to the ones of the mon specified in wd11e -SetPartyMonTypes: ; 5db5e (17:5b5e) +SetPartyMonTypes: ; 5db93 (17:5b93) call GetPredefRegisters ld bc, wPartyMon1Type - wPartyMon1 ; $5 add hl, bc diff --git a/engine/save.asm b/engine/save.asm index 5a144d10..b684c1be 100755 --- a/engine/save.asm +++ b/engine/save.asm @@ -182,7 +182,7 @@ WouldYouLikeToSaveText: ; 73ad1 (1c:7ad1) SavingText: ; 73ad6 (1c:7ad6) TX_FAR _SavingText db "@" - + GameSavedText: ; 73adb (1c:7adb) TX_FAR _GameSavedText db "@" @@ -190,7 +190,7 @@ GameSavedText: ; 73adb (1c:7adb) OlderFileWillBeErasedText: ; 73ae0 (1c:7ae0) TX_FAR _OlderFileWillBeErasedText db "@" - + SaveSAVtoSRAM0: ; 73ae5 (1c:7ae5) call EnableSRAMAndLatchClockData ld a, $1 @@ -257,7 +257,7 @@ SaveSAVtoSRAM2: ; 73b56 (1c:7b56) ld [de], a ld hl, sPlayerName ld bc, sMainDataCheckSum - sPlayerName - call SAVCheckSum + call SAVCheckSum ld [sMainDataCheckSum], a call DisableSRAMAndPrepareClockData ret @@ -674,7 +674,7 @@ EnableSRAMAndLatchClockData: ; 73e9f (1c:7e9f) ld a, SRAM_ENABLE ld [MBC1SRamEnable], a ret - + DisableSRAMAndPrepareClockData: ; 73eaa (1c:7eaa) ld a, SRAM_DISABLE ld [MBC1SRamBankingMode], a diff --git a/engine/titlescreen.asm b/engine/titlescreen.asm index a8a65dba..c10e0315 100755 --- a/engine/titlescreen.asm +++ b/engine/titlescreen.asm @@ -222,7 +222,6 @@ DisplayTitleScreen: ; 4171 (1:4171) jr nz, .audioFadeLoop jp Init - .doClearSaveDialogue ; 432a (1:432a) jpba DoClearSaveDialogue @@ -255,7 +254,6 @@ CopyrightTextString: ; 4355 (1:4355) TitleScreen_PlayPikachuPCM: ; 4387 (1:4387) callab PlayPikachuSoundClip ret - DoTitleScreenFunction: ; 4390 (1:4390) call .CheckTimer @@ -290,7 +288,6 @@ DoTitleScreenFunction: ; 4390 (1:4390) ld [wTitleScreenScene], a .Nop ret - .BlinkOpen: ; 43bf (1:43bf) ld e, 0 @@ -319,7 +316,6 @@ DoTitleScreenFunction: ; 4390 (1:4390) ld hl, wTitleScreenScene inc [hl] ret - .CheckTimer: ; 43de (1:43de) ld hl, wTitleScreenTimer @@ -341,7 +337,6 @@ CopyFixedLengthText: ; 43f3 (1:43f3) ld bc, NAME_LENGTH jp CopyData - NintenText: db "NINTEN@" SonyText: db "SONY@" @@ -364,7 +359,6 @@ IncrementResetCounter: ; 4405 (1:4405) scf ret - FillSpriteBuffer0WithAA: ; 4418 (1:4418) xor a call SwitchSRAMBankAndLatchClockData diff --git a/engine/town_map.asm b/engine/town_map.asm index 2d4f0023..82e24d75 100755 --- a/engine/town_map.asm +++ b/engine/town_map.asm @@ -587,12 +587,12 @@ LoadTownMapEntry: ; 7137a (1c:537a) ld h, [hl] ld l, a ret - + ; ExternalMapEntries: ; 7139c (1c:539c) ; dr $7139c,$7140b ; InternalMapEntries: ; 7140b (1c:540b) ; dr $7140b,$7174b - + INCLUDE "data/town_map_entries.asm" INCLUDE "text/map_names.asm" ; TODO: relabel addresses diff --git a/engine/turn_sprite.asm b/engine/turn_sprite.asm deleted file mode 100755 index 84037cfe..00000000 --- a/engine/turn_sprite.asm +++ /dev/null @@ -1,25 +0,0 @@ -UpdateSpriteFacingOffsetAndDelayMovement: ; 13074 (4:7074) - ld h, $c2 - ld a, [H_CURRENTSPRITEOFFSET] - add $8 - ld l, a - ld a, $7f ; maximum movement delay - ld [hl], a ; c2x8 (movement delay) - dec h - ld a, [H_CURRENTSPRITEOFFSET] - add $9 - ld l, a - ld a, [hld] ; c1x9 (facing direction) - ld b, a - xor a - ld [hld], a - ld [hl], a ; c1x8 (walk animation frame) - ld a, [H_CURRENTSPRITEOFFSET] - add $2 - ld l, a - ld a, [hl] ; c1x2 (facing and animation table offset) - or b ; or in the facing direction - ld [hld], a - ld a, $2 ; delayed movement status - ld [hl], a ; c1x1 (movement status) - ret |