diff options
author | YamaArashi <shadow962@live.com> | 2016-06-11 17:48:24 -0700 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-06-11 17:50:20 -0700 |
commit | 7e112672b436afee27f1a5a0d6e7a5964e7829b2 (patch) | |
tree | 9176ffc5b6384a48eb32ea8f33ac97d1d67f6865 /engine/battle | |
parent | f5983c0f813d3d908b6016db3ed866e4ca9437dc (diff) |
remove address comments
Diffstat (limited to 'engine/battle')
39 files changed, 732 insertions, 732 deletions
diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index 74bb0573..31148392 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -1,6 +1,6 @@ ; Draws a "frame block". Frame blocks are blocks of tiles that are put ; together to form frames in battle animations. -DrawFrameBlock: ; 78000 (1e:4000) +DrawFrameBlock: ld l, c ld h, b ld a, [hli] @@ -188,7 +188,7 @@ DrawFrameBlock: ; 78000 (1e:4000) .done ret -PlayAnimation: ; 78124 (1e:4124) +PlayAnimation: xor a ld [$FF8B], a ; it looks like nothing reads this ld [wSubAnimTransform], a @@ -285,7 +285,7 @@ PlayAnimation: ; 78124 (1e:4124) .AnimationOver ; 417B ret -LoadSubanimation: ; 781b5 (1e:41b5) +LoadSubanimation: ld a, [wSubAnimAddrPtr + 1] ld h, a ld a, [wSubAnimAddrPtr] @@ -335,7 +335,7 @@ LoadSubanimation: ; 781b5 (1e:41b5) ; called if the subanimation type is not 5 ; sets the transform to 0 (i.e. no transform) if it's the player's turn ; sets the transform to the subanimation type if it's the enemy's turn -GetSubanimationTransform1: ; 781fb (1e:41fb) +GetSubanimationTransform1: ld b, a ld a, [H_WHOSETURN] and a @@ -347,7 +347,7 @@ GetSubanimationTransform1: ; 781fb (1e:41fb) ; called if the subanimation type is 5 ; sets the transform to 2 (i.e. horizontal and vertical flip) if it's the player's turn ; sets the transform to 0 (i.e. no transform) if it's the enemy's turn -GetSubanimationTransform2: ; 78203 (1e:4203) +GetSubanimationTransform2: ld a, [H_WHOSETURN] and a ld a, 2 << 5 @@ -356,7 +356,7 @@ GetSubanimationTransform2: ; 78203 (1e:4203) ret ; loads tile patterns for battle animations -LoadAnimationTileset: ; 7820b (1e:420b) +LoadAnimationTileset: ld a, [wWhichBattleAnimTileset] add a add a @@ -376,7 +376,7 @@ LoadAnimationTileset: ; 7820b (1e:420b) ld c, a ; number of tiles jp CopyVideoData ; load tileset -AnimationTilesetPointers: ; 7822b (1e:422b) +AnimationTilesetPointers: db 79 ; number of tiles dw AnimationTileset1 db $FF @@ -389,16 +389,16 @@ AnimationTilesetPointers: ; 7822b (1e:422b) dw AnimationTileset1 db $FF -AnimationTileset1: ; 78237 (1e:4237) +AnimationTileset1: INCBIN "gfx/attack_anim_1.2bpp" -AnimationTileset2: ; 78757 (1e:4757) +AnimationTileset2: INCBIN "gfx/attack_anim_2.2bpp" -SlotMachineTiles2: ; 78bde (1e:4c17) +SlotMachineTiles2: INCBIN "gfx/slotmachine2.2bpp" -MoveAnimation: ; 78d97 (1e:4d97) +MoveAnimation: push hl push de push bc @@ -443,7 +443,7 @@ MoveAnimation: ; 78d97 (1e:4d97) pop hl ret -ShareMoveAnimations: ; 78ddf (1e:4ddf) +ShareMoveAnimations: ; some moves just reuse animations from status conditions ld a, [H_WHOSETURN] and a @@ -466,7 +466,7 @@ ShareMoveAnimations: ; 78ddf (1e:4ddf) ld [wAnimationID], a ret -PlayApplyingAttackAnimation: ; 78df6 (1e:4df6) +PlayApplyingAttackAnimation: ; Generic animation that shows after the move's individual animation ; Different animation depending on whether the move has an additional effect and on whose turn it is ld a, [wAnimationType] @@ -483,7 +483,7 @@ PlayApplyingAttackAnimation: ; 78df6 (1e:4df6) ld l, a jp [hl] -AnimationTypePointerTable: ; 78e08 (1e:4e08) +AnimationTypePointerTable: dw ShakeScreenVertically ; enemy mon has used a damaging move without a side effect dw ShakeScreenHorizontallyHeavy ; enemy mon has used a damaging move with a side effect dw ShakeScreenHorizontallySlow ; enemy mon has used a non-damaging move @@ -491,33 +491,33 @@ AnimationTypePointerTable: ; 78e08 (1e:4e08) dw ShakeScreenHorizontallyLight ; player mon has used a damaging move with a side effect dw ShakeScreenHorizontallySlow2 ; player mon has used a non-damaging move -ShakeScreenVertically: ; 78e14 (1e:4e14) +ShakeScreenVertically: call PlayApplyingAttackSound ld b, 8 jp AnimationShakeScreenVertically -ShakeScreenHorizontallyHeavy: ; 78e1c (1e:4e1c) +ShakeScreenHorizontallyHeavy: call PlayApplyingAttackSound ld b, 8 jp AnimationShakeScreenHorizontallyFast -ShakeScreenHorizontallySlow: ; 78e24 (1e:4e24) +ShakeScreenHorizontallySlow: lb bc, 6, 2 jr AnimationShakeScreenHorizontallySlow -BlinkEnemyMonSprite: ; 78e29 (1e:4e29) +BlinkEnemyMonSprite: call PlayApplyingAttackSound jp AnimationBlinkEnemyMon -ShakeScreenHorizontallyLight: ; 78e2f (1e:4e2f) +ShakeScreenHorizontallyLight: call PlayApplyingAttackSound ld b, 2 jp AnimationShakeScreenHorizontallyFast -ShakeScreenHorizontallySlow2: ; 78e37 (1e:4e37) +ShakeScreenHorizontallySlow2: lb bc, 3, 2 -AnimationShakeScreenHorizontallySlow: ; 78e3a (1e:4e3a) +AnimationShakeScreenHorizontallySlow: push bc push bc .loop1 @@ -542,7 +542,7 @@ AnimationShakeScreenHorizontallySlow: ; 78e3a (1e:4e3a) jr nz, AnimationShakeScreenHorizontallySlow ret -SetAnimationPalette: ; 78e5c (1e:4e5c) +SetAnimationPalette: ld a, [wOnSGB] and a ld a, $e4 @@ -574,7 +574,7 @@ SetAnimationPalette: ; 78e5c (1e:4e5c) call UpdateGBCPal_OBP1 ret -Func_78e98: ; 78e98 (1e:4e98) +Func_78e98: call SaveScreenTilesToBuffer2 xor a ld [H_AUTOBGTRANSFERENABLED], a @@ -587,14 +587,14 @@ Func_78e98: ; 78e98 (1e:4e98) call LoadScreenTilesFromBuffer2 ld h, vBGMap1 / $100 -WriteLowerByteOfBGMapAndEnableBGTransfer: ; 78eb1 (1e:4eb1) +WriteLowerByteOfBGMapAndEnableBGTransfer: ld l, vBGMap0 & $ff call BattleAnimCopyTileMapToVRAM ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ret -PlaySubanimation: ; 78ebb (1e:4ebb) +PlaySubanimation: ld a, [wAnimSoundID] cp a, $FF jr z, .skipPlayingSound @@ -660,7 +660,7 @@ PlaySubanimation: ; 78ebb (1e:4ebb) ld [wSubAnimSubEntryAddr], a jp .loop -AnimationCleanOAM: ; 78f30 (1e:4f30) +AnimationCleanOAM: push hl push de push bc @@ -675,7 +675,7 @@ AnimationCleanOAM: ; 78f30 (1e:4f30) ; this runs after each frame block is drawn in a subanimation ; it runs a particular special effect based on the animation ID -DoSpecialEffectByAnimationId: ; 78f3f (1e:4f3f) +DoSpecialEffectByAnimationId: push hl push de push bc @@ -698,7 +698,7 @@ DoSpecialEffectByAnimationId: ; 78f3f (1e:4f3f) ret ; Format: Animation ID (1 byte), Address (2 bytes) -AnimationIdSpecialEffects: ; 78f5d (1e:4f5d) +AnimationIdSpecialEffects: db MEGA_PUNCH dw AnimationFlashScreen @@ -773,7 +773,7 @@ AnimationIdSpecialEffects: ; 78f5d (1e:4f5d) db $FF ; terminator -DoBallTossSpecialEffects: ; 78fa6 (1e:4fa6) +DoBallTossSpecialEffects: ld a, [wcf91] cp a, 3 ; is it a Master Ball or Ultra Ball? jr nc, .skipFlashingEffect @@ -828,7 +828,7 @@ DoBallTossSpecialEffects: ; 78fa6 (1e:4fa6) ld [wSubAnimCounter], a ret -DoBallShakeSpecialEffects: ; 79001 (1e:5001) +DoBallShakeSpecialEffects: ld a, [wSubAnimCounter] cp a, 4 ; is it the beginning of a shake? jr nz, .skipPlayingSound @@ -862,14 +862,14 @@ DoBallShakeSpecialEffects: ; 79001 (1e:5001) ret ; plays a sound after the second frame of the poof animation -DoPoofSpecialEffects: ; 79039 (1e:5039) +DoPoofSpecialEffects: ld a, [wSubAnimCounter] cp a, 5 ret nz ld a, SFX_BALL_POOF jp PlaySound -DoRockSlideSpecialEffects: ; 79044 (1e:5044) +DoRockSlideSpecialEffects: ld a, [wSubAnimCounter] cp a, 12 ret nc @@ -885,21 +885,21 @@ DoRockSlideSpecialEffects: ; 79044 (1e:5044) ld b, 1 predef_jump PredefShakeScreenVertically ; shake vertically -FlashScreenEveryEightFrameBlocks: ; 79062 (1e:5062) +FlashScreenEveryEightFrameBlocks: ld a, [wSubAnimCounter] and a, 7 ; is the subanimation counter exactly 8? call z, AnimationFlashScreen ; if so, flash the screen ret ; flashes the screen if the subanimation counter is divisible by 4 -FlashScreenEveryFourFrameBlocks: ; 7906b (1e:506b) +FlashScreenEveryFourFrameBlocks: ld a, [wSubAnimCounter] and a, 3 call z, AnimationFlashScreen ret ; used for Explosion and Selfdestruct -DoExplodeSpecialEffects: ; 79074 (1e:5074) +DoExplodeSpecialEffects: ld a, [wSubAnimCounter] cp a, 1 ; is it the end of the subanimation? jr nz, FlashScreenEveryFourFrameBlocks @@ -908,7 +908,7 @@ DoExplodeSpecialEffects: ; 79074 (1e:5074) jp AnimationHideMonPic ; make pokemon disappear ; flashes the screen when subanimation counter is 1 modulo 4 -DoBlizzardSpecialEffects: ; 79081 (1e:5081) +DoBlizzardSpecialEffects: ld a, [wSubAnimCounter] cp a, 13 jp z, AnimationFlashScreen @@ -922,7 +922,7 @@ DoBlizzardSpecialEffects: ; 79081 (1e:5081) ; flashes the screen at 3 points in the subanimation ; unused -FlashScreenUnused: ; 79099 (1e:5099) +FlashScreenUnused: ld a, [wSubAnimCounter] cp a, 14 jp z, AnimationFlashScreen @@ -933,7 +933,7 @@ FlashScreenUnused: ; 79099 (1e:5099) ret ; function to make the pokemon disappear at the beginning of the animation -TradeHidePokemon: ; 790ac (1e:50ac) +TradeHidePokemon: ld a, [wSubAnimCounter] cp a, 6 ret nz @@ -941,7 +941,7 @@ TradeHidePokemon: ; 790ac (1e:50ac) jp ClearMonPicFromTileMap ; make pokemon disappear ; function to make a shaking pokeball jump up at the end of the animation -TradeShakePokeball: ; 790b7 (1e:50b7) +TradeShakePokeball: ld a, [wSubAnimCounter] cp a, 1 ret nz @@ -970,12 +970,12 @@ TradeShakePokeball: ; 790b7 (1e:50b7) ld a, SFX_TRADE_MACHINE jp PlaySound -BallMoveDistances1: ; 790e3 (1e:50e3) +BallMoveDistances1: db -12, -12, -8 db $ff ; terminator ; function to make the pokeball jump up -TradeJumpPokeball: ; 790e7 (1e:50e7) +TradeJumpPokeball: ld de, BallMoveDistances2 .loop ld hl, wOAMBuffer ; OAM buffer @@ -1011,13 +1011,13 @@ TradeJumpPokeball: ; 790e7 (1e:50e7) pop de jr .loop -BallMoveDistances2: ; 7911f (1e:511f) +BallMoveDistances2: db 11, 12, -12, -7, 7, 12, -8, 8 db $ff ; terminator ; this function copies the current musical note graphic ; so that there are two musical notes flying towards the defending pokemon -DoGrowlSpecialEffects: ; 79127 (1e:5127) +DoGrowlSpecialEffects: ld hl, wOAMBuffer ; OAM buffer ld de, wOAMBuffer + $10 ld bc, $10 @@ -1028,13 +1028,13 @@ DoGrowlSpecialEffects: ; 79127 (1e:5127) ret ; this is associated with Tail Whip, but Tail Whip doesn't use any subanimations -TailWhipAnimationUnused: ; 7913b (1e:513b) +TailWhipAnimationUnused: ld a, 1 ld [wSubAnimCounter], a ld c, 20 jp DelayFrames -SpecialEffectPointers: ; 79145 (1e:5145) +SpecialEffectPointers: db SE_DARK_SCREEN_FLASH ; $FE dw AnimationFlashScreen db SE_DARK_SCREEN_PALETTE ; $FD @@ -1115,13 +1115,13 @@ SpecialEffectPointers: ; 79145 (1e:5145) dw AnimationWavyScreen db $FF -AnimationDelay10: ; 791bb (1e:51bb) +AnimationDelay10: ld c, 10 jp DelayFrames ; calls a function with the turn flipped from player to enemy or vice versa ; input - hl - address of function to call -CallWithTurnFlipped: ; 791c0 (1e:51c0) +CallWithTurnFlipped: ld a, [H_WHOSETURN] push af xor a, 1 @@ -1135,7 +1135,7 @@ CallWithTurnFlipped: ; 791c0 (1e:51c0) ret ; flashes the screen for an extended period (48 frames) -AnimationFlashScreenLong: ; 791d0 (1e:51d0) +AnimationFlashScreenLong: ld a, 3 ; cycle through the palettes 3 times ld [wFlashScreenLongCounter], a ld a, [wOnSGB] ; running on SGB? @@ -1162,7 +1162,7 @@ AnimationFlashScreenLong: ; 791d0 (1e:51d0) ret ; BG palettes -FlashScreenLongMonochrome: ; 791fc (1e:51fc) +FlashScreenLongMonochrome: db %11111001 ; 3, 3, 2, 1 db %11111110 ; 3, 3, 3, 2 db %11111111 ; 3, 3, 3, 3 @@ -1178,7 +1178,7 @@ FlashScreenLongMonochrome: ; 791fc (1e:51fc) db $01 ; terminator ; BG palettes -FlashScreenLongSGB: ; 79209 (1e:5209) +FlashScreenLongSGB: db %11111000 ; 3, 3, 2, 0 db %11111100 ; 3, 3, 3, 0 db %11111111 ; 3, 3, 3, 3 @@ -1195,7 +1195,7 @@ FlashScreenLongSGB: ; 79209 (1e:5209) ; causes a delay of 2 frames for the first cycle ; causes a delay of 1 frame for the second and third cycles -FlashScreenLongDelay: ; 79216 (1e:5216) +FlashScreenLongDelay: ld a, [wFlashScreenLongCounter] cp a, 4 ; never true since [wFlashScreenLongCounter] starts at 3 ld c, 4 @@ -1208,7 +1208,7 @@ FlashScreenLongDelay: ; 79216 (1e:5216) .delayFrames jp DelayFrames -AnimationFlashScreen: ; 7922c (1e:522c) +AnimationFlashScreen: ld a, [rBGP] push af ; save initial palette ld a, %00011011 ; 0, 1, 2, 3 (inverted colors) @@ -1226,42 +1226,42 @@ AnimationFlashScreen: ; 7922c (1e:522c) call UpdateGBCPal_BGP ret -AnimationDarkScreenPalette: ; 7924d (1e:524d) +AnimationDarkScreenPalette: ; Changes the screen's palette to a dark palette. lb bc, $6f, $6f jr SetAnimationBGPalette -AnimationDarkenMonPalette: ; 79252 (1e:5252) +AnimationDarkenMonPalette: ; Darkens the mon sprite's palette. lb bc, $f9, $f4 jr SetAnimationBGPalette -AnimationUnusedPalette1: ; 79257 (1e:5257) +AnimationUnusedPalette1: lb bc, $fe, $f8 jr SetAnimationBGPalette -AnimationUnusedPalette2: ; 7925c (1e:525c) +AnimationUnusedPalette2: lb bc, $ff, $ff jr SetAnimationBGPalette -AnimationResetScreenPalette: ; 79261 (1e:5261) +AnimationResetScreenPalette: ; Restores the screen's palette to the normal palette. lb bc, $e4, $e4 jr SetAnimationBGPalette -AnimationUnusedPalette3: ; 79266 (1e:5266) +AnimationUnusedPalette3: lb bc, $00, $00 jr SetAnimationBGPalette -AnimationLightScreenPalette: ; 7926b (1e:526b) +AnimationLightScreenPalette: ; Changes the screen to use a palette with light colors. lb bc, $90, $90 jr SetAnimationBGPalette -AnimationUnusedPalette4: ; 79270 (1e:5270) +AnimationUnusedPalette4: lb bc, $40, $40 -SetAnimationBGPalette: ; 79273 (1e:5273) +SetAnimationBGPalette: ld a, [wOnSGB] and a ld a, b @@ -1274,17 +1274,17 @@ SetAnimationBGPalette: ; 79273 (1e:5273) ld b, $5 -AnimationShakeScreenVertically: ; 79283 (1e:5283) +AnimationShakeScreenVertically: predef_jump PredefShakeScreenVertically -AnimationShakeScreen: ; 79288 (1e:5288) +AnimationShakeScreen: ; Shakes the screen for a while. Used in Earthquake/Fissure/etc. animations. ld b, $8 -AnimationShakeScreenHorizontallyFast: ; 7928a (1e:528a) +AnimationShakeScreenHorizontallyFast: predef_jump PredefShakeScreenHorizontally -AnimationWaterDropletsEverywhere: ; 7928f (1e:528f) +AnimationWaterDropletsEverywhere: ; Draws water droplets all over the screen and makes them ; scroll. It's hard to describe, but it's the main animation ; in Surf/Mist/Toxic. @@ -1311,7 +1311,7 @@ AnimationWaterDropletsEverywhere: ; 7928f (1e:528f) jr nz, .loop ret -_AnimationWaterDroplets: ; 792c0 (1e:52c0) +_AnimationWaterDroplets: ld hl, wOAMBuffer .loop ld a, $1 @@ -1352,7 +1352,7 @@ _AnimationWaterDroplets: ; 792c0 (1e:52c0) call AnimationCleanOAM jp DelayFrame -AnimationSlideMonUp: ; 79314 (1e:5314) +AnimationSlideMonUp: ; Slides the mon's sprite upwards. ld c, 7 ld a, [H_WHOSETURN] @@ -1368,7 +1368,7 @@ AnimationSlideMonUp: ; 79314 (1e:5314) ld [wSlideMonUpBottomRowLeftTile], a jp _AnimationSlideMonUp -AnimationSlideMonDown: ; 79331 (1e:5331) +AnimationSlideMonDown: ; Slides the mon's sprite down out of the screen. xor a call GetTileIDList @@ -1385,19 +1385,19 @@ AnimationSlideMonDown: ; 79331 (1e:5331) jr nz, .loop ret -AnimationSlideMonOff: ; 79349 (1e:5349) +AnimationSlideMonOff: ; Slides the mon's sprite off the screen horizontally. ld e, 8 ld a, 3 ld [wSlideMonDelay], a jp _AnimationSlideMonOff -AnimationSlideEnemyMonOff: ; 79353 (1e:5353) +AnimationSlideEnemyMonOff: ; Slides the enemy mon off the screen horizontally. ld hl, AnimationSlideMonOff jp CallWithTurnFlipped -_AnimationSlideMonUp: ; 79359 (1e:5359) +_AnimationSlideMonUp: push de push hl push bc @@ -1448,7 +1448,7 @@ _AnimationSlideMonUp: ; 79359 (1e:5359) jr nz, _AnimationSlideMonUp ret -ShakeEnemyHUD_WritePlayerMonPicOAM: ; 79397 (1e:5397) +ShakeEnemyHUD_WritePlayerMonPicOAM: ; Writes the OAM entries for a copy of the player mon's pic in OAM. ; The top 5 rows are reproduced in OAM, although only 2 are actually needed. ld a, $10 @@ -1476,7 +1476,7 @@ ShakeEnemyHUD_WritePlayerMonPicOAM: ; 79397 (1e:5397) ld [wBaseCoordX], a jr .loop -BattleAnimWriteOAMEntry: ; 793c3 (1e:53c3) +BattleAnimWriteOAMEntry: ; Y coordinate = e (increased by 8 each call, before the write to OAM) ; X coordinate = [wBaseCoordX] ; tile = d @@ -1507,11 +1507,11 @@ BattleAnimWriteOAMEntry: ; 793c3 (1e:53c3) ld [hli], a ret -AdjustOAMBlockXPos: ; 793ef (1e:53ef) +AdjustOAMBlockXPos: ld l, e ld h, d -AdjustOAMBlockXPos2: ; 793f1 (1e:53f1) +AdjustOAMBlockXPos2: ld de, 4 .loop ld a, [wCoordAdjustmentAmount] @@ -1531,11 +1531,11 @@ AdjustOAMBlockXPos2: ; 793f1 (1e:53f1) jr nz, .loop ret -AdjustOAMBlockYPos: ; 79408 (1e:5408) +AdjustOAMBlockYPos: ld l, e ld h, d -AdjustOAMBlockYPos2: ; 7940d (1e:540d) +AdjustOAMBlockYPos2: ld de, 4 .loop ld a, [wCoordAdjustmentAmount] @@ -1554,12 +1554,12 @@ AdjustOAMBlockYPos2: ; 7940d (1e:540d) jr nz, .loop ret -AnimationBlinkEnemyMon: ; 79421 (1e:5421) +AnimationBlinkEnemyMon: ; Make the enemy mon's sprite blink on and off for a second or two ld hl, AnimationBlinkMon jp CallWithTurnFlipped -AnimationBlinkMon: ; 79427 (1e:5427) +AnimationBlinkMon: ; Make the mon's sprite blink on and off for a second or two. push af ld c, 6 @@ -1577,7 +1577,7 @@ AnimationBlinkMon: ; 79427 (1e:5427) pop af ret -AnimationFlashMonPic: ; 79441 (1e:5441) +AnimationFlashMonPic: ; Flashes the mon's sprite on and off ld a, [wBattleMonSpecies] ld [wChangeMonPicPlayerTurnSpecies], a @@ -1585,25 +1585,25 @@ AnimationFlashMonPic: ; 79441 (1e:5441) ld [wChangeMonPicEnemyTurnSpecies], a jp ChangeMonPic -AnimationFlashEnemyMonPic: ; 79450 (1e:5450) +AnimationFlashEnemyMonPic: ; Flashes the enemy mon's sprite on and off ld hl, AnimationFlashMonPic jp CallWithTurnFlipped -AnimationShowMonPic: ; 79456 (1e:5456) +AnimationShowMonPic: xor a call GetTileIDList call GetMonSpriteTileMapPointerFromRowCount call CopyPicTiles jp Delay3 -AnimationShowEnemyMonPic: ; 79463 (1e:5463) +AnimationShowEnemyMonPic: ; Shows the emenmy mon's front sprite. Used in animations like Seismic Toss ; to make the mon's sprite reappear after disappears offscreen. ld hl, AnimationShowMonPic jp CallWithTurnFlipped -AnimationShakeBackAndForth: ; 79469 (1e:5469) +AnimationShakeBackAndForth: ; Shakes the mon's sprite back and forth rapidly. This is used in Double Team. ; The mon's sprite disappears after this animation. ld a, [H_WHOSETURN] @@ -1650,7 +1650,7 @@ AnimationShakeBackAndForth: ; 79469 (1e:5469) jr nz, .loop ret -AnimationMoveMonHorizontally: ; 794b1 (1e:54b1) +AnimationMoveMonHorizontally: ; Shifts the mon's sprite horizontally to a fixed location. Used by lots of ; animations like Tackle/Body Slam. call AnimationHideMonPic @@ -1668,7 +1668,7 @@ AnimationMoveMonHorizontally: ; 794b1 (1e:54b1) ld c, 3 jp DelayFrames -AnimationResetMonPosition: ; 794cd (1e:54cd) +AnimationResetMonPosition: ; Resets the mon's sprites to be located at the normal coordinates. ld a, [H_WHOSETURN] and a @@ -1679,7 +1679,7 @@ AnimationResetMonPosition: ; 794cd (1e:54cd) call ClearMonPicFromTileMap jp AnimationShowMonPic -AnimationSpiralBallsInward: ; 794dc (1e:54dc) +AnimationSpiralBallsInward: ; Creates an effect that looks like energy balls spiralling into the ; player mon's sprite. Used in Focus Energy, for example. ld a, [H_WHOSETURN] @@ -1746,7 +1746,7 @@ AnimationSpiralBallsInward: ; 794dc (1e:54dc) call AnimationCleanOAM jp AnimationFlashScreen -SpiralBallAnimationCoordinates: ; 79545 (1e:5545) +SpiralBallAnimationCoordinates: ; y, x pairs ; This is the sequence of screen coordinates that the spiralling ; balls are positioned at. @@ -1773,7 +1773,7 @@ SpiralBallAnimationCoordinates: ; 79545 (1e:5545) db $50, $28 db $FF ; list terminator -AnimationSquishMonPic: ; 79570 (1e:5570) +AnimationSquishMonPic: ; Squishes the mon's sprite horizontally making it ; disappear. Used by Teleport/Sky Attack animations. ld c, 4 @@ -1804,7 +1804,7 @@ AnimationSquishMonPic: ; 79570 (1e:5570) ld c, 2 jp DelayFrame -_AnimationSquishMonPic: ; 795a3 (1e:55a3) +_AnimationSquishMonPic: ld c, 7 .loop push bc @@ -1829,7 +1829,7 @@ _AnimationSquishMonPic: ; 795a3 (1e:55a3) jr nz, .loop jp Delay3 -AnimationShootBallsUpward: ; 795c8 (1e:55c8) +AnimationShootBallsUpward: ; Shoots one pillar of "energy" balls upwards. Used in Teleport/Sky Attack ; animations. ld a, [H_WHOSETURN] @@ -1848,7 +1848,7 @@ AnimationShootBallsUpward: ; 795c8 (1e:55c8) call _AnimationShootBallsUpward jp AnimationCleanOAM -_AnimationShootBallsUpward: ; 795e6 (1e:55e6) +_AnimationShootBallsUpward: push bc xor a ld [wWhichBattleAnimTileset], a @@ -1898,7 +1898,7 @@ _AnimationShootBallsUpward: ; 795e6 (1e:55e6) jr nz, .loop ret -AnimationShootManyBallsUpward: ; 79635 (1e:5635) +AnimationShootManyBallsUpward: ; Shoots several pillars of "energy" balls upward. ld a, [H_WHOSETURN] and a @@ -1922,19 +1922,19 @@ AnimationShootManyBallsUpward: ; 79635 (1e:5635) pop hl jr .loop -UpwardBallsAnimXCoordinatesPlayerTurn: ; 79660 (1e:5660) +UpwardBallsAnimXCoordinatesPlayerTurn: ; List of x coordinates for each pillar of "energy" balls in the ; AnimationShootManyBallsUpward animation. It's unused in the game. db $10, $40, $28, $18, $38, $30 db $FF ; list terminator -UpwardBallsAnimXCoordinatesEnemyTurn: ; 79667 (1e:5667) +UpwardBallsAnimXCoordinatesEnemyTurn: ; List of x coordinates for each pillar of "energy" balls in the ; AnimationShootManyBallsUpward animation. It's unused in the game. db $60, $90, $78, $68, $88, $80 db $FF ; list terminator -AnimationMinimizeMon: ; 7966e (1e:566e) +AnimationMinimizeMon: ; Changes the mon's sprite to a mini black sprite. Used by the ; Minimize animation. ld hl, wTempPic @@ -1958,11 +1958,11 @@ AnimationMinimizeMon: ; 7966e (1e:566e) call Delay3 jp AnimationShowMonPic -MinimizedMonSprite: ; 79693 (1e:5693) +MinimizedMonSprite: INCBIN "gfx/minimized_mon_sprite.1bpp" MinimizedMonSpriteEnd: -AnimationSlideMonDownAndHide: ; 79698 (1e:5698) +AnimationSlideMonDownAndHide: ; Slides the mon's sprite down and disappears. Used in Acid Armor. ld a, $1 ld c, $2 @@ -1989,7 +1989,7 @@ AnimationSlideMonDownAndHide: ; 79698 (1e:5698) call FillMemory jp CopyTempPicToMonPic -_AnimationSlideMonOff: ; 796c7 (1e:56c7) +_AnimationSlideMonOff: ; Slides the mon's sprite off the screen horizontally by e tiles and waits ; [wSlideMonDelay] V-blanks each time the pic is slid by one tile. ld a, [H_WHOSETURN] @@ -2059,7 +2059,7 @@ _AnimationSlideMonOff: ; 796c7 (1e:56c7) ld a, " " ret -AnimationSlideMonHalfOff: ; 79714 (1e:5714) +AnimationSlideMonHalfOff: ; Slides the mon's sprite halfway off the screen. It's used in Softboiled. ld e, 4 ld a, 4 @@ -2067,7 +2067,7 @@ AnimationSlideMonHalfOff: ; 79714 (1e:5714) call _AnimationSlideMonOff jp Delay3 -CopyTempPicToMonPic: ; 79721 (1e:5721) +CopyTempPicToMonPic: ld a, [H_WHOSETURN] and a ld hl, vBackPic ; player turn @@ -2078,7 +2078,7 @@ CopyTempPicToMonPic: ; 79721 (1e:5721) ld bc, 7 * 7 jp CopyVideoData -AnimationWavyScreen: ; 79735 (1e:5735) +AnimationWavyScreen: ; used in Psywave/Psychic etc. ld hl, vBGMap0 call BattleAnimCopyTileMapToVRAM @@ -2119,7 +2119,7 @@ AnimationWavyScreen: ; 79735 (1e:5735) call BattleAnimCopyTileMapToVRAM ret -WavyScreen_SetSCX: ; 7977d (1e:577d) +WavyScreen_SetSCX: ld a, [rSTAT] and $3 ; is it H-blank? jr nz, WavyScreen_SetSCX ; wait until it's H-blank @@ -2132,14 +2132,14 @@ WavyScreen_SetSCX: ; 7977d (1e:577d) ld hl, WavyScreenLineOffsets ; go back to the beginning if so ret -WavyScreenLineOffsets: ; 7978e (1e:578e) +WavyScreenLineOffsets: ; Sequence of horizontal line pixel offsets for the wavy screen animation. ; This sequence vaguely resembles a sine wave. 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) +AnimationSubstitute: ; Changes the pokemon's sprite to the mini sprite ld hl, wTempPic xor a @@ -2178,12 +2178,12 @@ AnimationSubstitute: ; 797af (1e:57af) call CopyTempPicToMonPic jp AnimationShowMonPic -CopySlowbroSpriteData: ; 7980e (1e:580e) +CopySlowbroSpriteData: ld bc, $0010 ld a, BANK(SlowbroSprite) jp FarCopyData -HideSubstituteShowMonAnim: ; 79816 (1e:5816) +HideSubstituteShowMonAnim: ld a, [H_WHOSETURN] and a ld hl, wPlayerMonMinimized @@ -2267,12 +2267,12 @@ HideSubstituteShowMonAnim: ; 79816 (1e:5816) jr nz, .loop jp CopyTempPicToMonPic -ReshowSubstituteAnim: ; 798b2 (1e:58b2) +ReshowSubstituteAnim: call AnimationSlideMonOff call AnimationSubstitute jp AnimationShowMonPic -AnimationBoundUpAndDown: ; 798bb (1e:58bb) +AnimationBoundUpAndDown: ; Bounces the mon's sprite up and down several times. It is used ; by Splash's animation. ld c, 5 @@ -2284,7 +2284,7 @@ AnimationBoundUpAndDown: ; 798bb (1e:58bb) jr nz, .loop jp AnimationShowMonPic -AnimationTransformMon: ; 798c8 (1e:58c8) +AnimationTransformMon: ; Redraws this mon's sprite as the back/front sprite of the opposing mon. ; Used in Transform. ld a, [wEnemyMonSpecies] @@ -2292,7 +2292,7 @@ AnimationTransformMon: ; 798c8 (1e:58c8) ld a, [wBattleMonSpecies] ld [wChangeMonPicEnemyTurnSpecies], a -ChangeMonPic: ; 798d4 (1e:58d4) +ChangeMonPic: ld a, [H_WHOSETURN] and a jr z, .playerTurn @@ -2323,7 +2323,7 @@ ChangeMonPic: ; 798d4 (1e:58d4) ld b, SET_PAL_BATTLE jp RunPaletteCommand -AnimationHideEnemyMonPic: ; 79919 (1e:5919) +AnimationHideEnemyMonPic: ; Hides the enemy mon's sprite xor a ld [H_AUTOBGTRANSFERENABLED], a @@ -2333,7 +2333,7 @@ AnimationHideEnemyMonPic: ; 79919 (1e:5919) ld [H_AUTOBGTRANSFERENABLED], a jp Delay3 -Func_79929: ; 79929 (1e:5929) +Func_79929: ld hl, wPlayerMonMinimized ld a, [H_WHOSETURN] and a @@ -2350,7 +2350,7 @@ Func_79929: ; 79929 (1e:5929) call AnimationShowMonPic ret -InitMultipleObjectsOAM: ; 79943 (1e:5943) +InitMultipleObjectsOAM: ; Writes c OAM entries with tile d. ; Sets their Y coordinates to sequential multiples of 8, starting from 0. ; Sets their X coordinates to 0. @@ -2373,7 +2373,7 @@ InitMultipleObjectsOAM: ; 79943 (1e:5943) ret ; unreferenced -AnimationHideMonPic: ; 7995d (1e:595d) +AnimationHideMonPic: ; Hides the mon's sprite. ld a, [H_WHOSETURN] and a @@ -2383,7 +2383,7 @@ AnimationHideMonPic: ; 7995d (1e:595d) .playerTurn ld a, 5 * SCREEN_WIDTH + 1 -ClearMonPicFromTileMap: ; 79968 (1e:5968) +ClearMonPicFromTileMap: push hl push de push bc @@ -2401,7 +2401,7 @@ ClearMonPicFromTileMap: ; 79968 (1e:5968) ; 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. -GetMonSpriteTileMapPointerFromRowCount: ; 7997c (1e:597c) +GetMonSpriteTileMapPointerFromRowCount: push de ld a, [H_WHOSETURN] and a @@ -2434,7 +2434,7 @@ GetMonSpriteTileMapPointerFromRowCount: ; 7997c (1e:597c) ; de = tile ID list pointer ; b = number of rows ; c = number of columns -GetTileIDList: ; 7999e (1e:599e) +GetTileIDList: ld hl, TileIDListPointerTable ld e, a ld d, 0 @@ -2455,7 +2455,7 @@ GetTileIDList: ; 7999e (1e:599e) ld b, a ret -AnimCopyRowLeft: ; 798b7 (1e:58b7) +AnimCopyRowLeft: ; copy a row of c tiles 1 tile left ld a, [hld] ld [hli], a @@ -2464,7 +2464,7 @@ AnimCopyRowLeft: ; 798b7 (1e:58b7) jr nz, AnimCopyRowLeft ret -AnimCopyRowRight: ; 799be (1e:59be) +AnimCopyRowRight: ; copy a row of c tiles 1 tile right ld a, [hli] ld [hld], a @@ -2474,13 +2474,13 @@ AnimCopyRowRight: ; 799be (1e:59be) ret ; get the sound of the move id in b -GetMoveSoundB: ; 799c5 (1e:59c5) +GetMoveSoundB: ld a, b call GetMoveSound ld b, a ret -GetMoveSound: ; 799cb (1e:59cb) +GetMoveSound: ld hl, MoveSoundTable ld e, a ld d, 0 @@ -2520,7 +2520,7 @@ GetMoveSound: ; 799cb (1e:59cb) ld a, b ret -IsCryMove: ; 79a09 (1e:5a09) +IsCryMove: ; set carry if the move animation involves playing a monster cry ld a, [wAnimationID] cp a, GROWL @@ -2533,7 +2533,7 @@ IsCryMove: ; 79a09 (1e:5a09) scf ret -MoveSoundTable: ; 79a18 (1e:5a18) +MoveSoundTable: ; ID, pitch mod, tempo mod db SFX_POUND, $00, $80 ; POUND db SFX_BATTLE_0C, $10, $80 ; KARATE_CHOP @@ -2702,7 +2702,7 @@ MoveSoundTable: ; 79a18 (1e:5a18) db SFX_BATTLE_0B, $00, $80 ; STRUGGLE db SFX_BATTLE_0B, $00, $80 -CopyPicTiles: ; 79c0a (1e:5c0a) +CopyPicTiles: ld a, [H_WHOSETURN] and a ld a, $31 ; base tile ID of player mon sprite @@ -2714,7 +2714,7 @@ CopyPicTiles: ; 79c0a (1e:5c0a) jr CopyTileIDs_NoBGTransfer ; copy the tiles used when a mon is being sent out of or into a pokeball -CopyDownscaledMonTiles: ; 79c16 (1e:5c16) +CopyDownscaledMonTiles: call GetPredefRegisters ld a, [wDownscaledMonSize] and a @@ -2725,14 +2725,14 @@ CopyDownscaledMonTiles: ; 79c16 (1e:5c16) ld de, DownscaledMonTiles_3x3 ; fall through -CopyTileIDs_NoBGTransfer: ; 79acb (1e:5acb) +CopyTileIDs_NoBGTransfer: xor a ld [H_AUTOBGTRANSFERENABLED], a ; fall through ; b = number of rows ; c = number of columns -CopyTileIDs: ; 79ace (1e:5ace) +CopyTileIDs: push hl .rowLoop push bc @@ -2757,7 +2757,7 @@ CopyTileIDs: ; 79ace (1e:5ace) pop hl ret -TileIDListPointerTable: ; 79c46 (1e:5c46) +TileIDListPointerTable: dw DownscaledMonTiles_7x7 dn 7, 7 dw DownscaledMonTiles_5x7 @@ -2775,19 +2775,19 @@ TileIDListPointerTable: ; 79c46 (1e:5c46) dw DownscaledMonTiles_79dac dn 3, 12 -DownscaledMonTiles_5x5: ; 79b02 (1e:5b02) +DownscaledMonTiles_5x5: db $31, $38, $46, $54, $5B db $32, $39, $47, $55, $5C db $34, $3B, $49, $57, $5E db $36, $3D, $4B, $59, $60 db $37, $3E, $4C, $5A, $61 -DownscaledMonTiles_3x3: ; 79b1b (1e:5b1b) +DownscaledMonTiles_3x3: db $31, $46, $5B db $34, $49, $5E db $37, $4C, $61 -DownscaledMonTiles_7x7: ; 79c80 (1e:5c80) +DownscaledMonTiles_7x7: db $00, $07, $0E, $15, $1C, $23, $2A db $01, $08, $0F, $16, $1D, $24, $2B db $02, $09, $10, $17, $1E, $25, $2C @@ -2796,19 +2796,19 @@ DownscaledMonTiles_7x7: ; 79c80 (1e:5c80) db $05, $0C, $13, $1A, $21, $28, $2F db $06, $0D, $14, $1B, $22, $29, $30 -DownscaledMonTiles_5x7: ; 79cb1 (1e:5cb1) +DownscaledMonTiles_5x7: db $00, $07, $0E, $15, $1C, $23, $2A db $01, $08, $0F, $16, $1D, $24, $2B db $03, $0A, $11, $18, $1F, $26, $2D db $04, $0B, $12, $19, $20, $27, $2E db $05, $0C, $13, $1A, $21, $28, $2F -DownscaledMonTiles_3x7: ; 79cd4 (1e:5cd4) +DownscaledMonTiles_3x7: db $00, $07, $0E, $15, $1C, $23, $2A db $02, $09, $10, $17, $1E, $25, $2C db $04, $0B, $12, $19, $20, $27, $2E -DownscaledMonTiles_79ce9: ; 79ce9 (1e:5ce9) +DownscaledMonTiles_79ce9: db $00, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $00, $00, $19, $00 db $02, $06, $0B, $10, $14, $1A, $00 @@ -2817,7 +2817,7 @@ DownscaledMonTiles_79ce9: ; 79ce9 (1e:5ce9) db $04, $09, $0E, $13, $17, $1D, $1F db $05, $0A, $0F, $01, $18, $1E, $20 -DownscaledMonTiles_79d1a: ; 79d1a (1e:5d1a) +DownscaledMonTiles_79d1a: db $00, $00, $00, $30, $00, $37, $00 db $00, $00, $2B, $31, $34, $38, $3D db $21, $26, $2C, $01, $35, $39, $3E @@ -2826,7 +2826,7 @@ DownscaledMonTiles_79d1a: ; 79d1a (1e:5d1a) db $24, $29, $2F, $01, $01, $3B, $00 db $25, $2A, $01, $01, $01, $3C, $00 -DownscaledMonTiles_79d4b: ; 79d4b (1e:5d4b) +DownscaledMonTiles_79d4b: db $00, $00, $00, $00, $00, $00, $00 db $00, $00, $47, $4D, $00, $00, $00 db $00, $00, $48, $4E, $52, $56, $5B @@ -2835,7 +2835,7 @@ DownscaledMonTiles_79d4b: ; 79d4b (1e:5d4b) db $41, $45, $4B, $51, $4C, $59, $5D db $42, $46, $4C, $4C, $55, $5A, $5E -DownscaledMonTiles_79d7c: ; 79d7c (1e:5d7c) +DownscaledMonTiles_79d7c: db $31, $32, $32, $32, $32, $33 db $34, $35, $36, $36, $37, $38 db $34, $39, $3A, $3A, $3B, $38 @@ -2845,12 +2845,12 @@ DownscaledMonTiles_79d7c: ; 79d7c (1e:5d7c) db $41, $43, $4B, $4C, $4D, $4E db $4F, $50, $50, $50, $51, $52 -DownscaledMonTiles_79dac: ; 79dac (1e:5dac) +DownscaledMonTiles_79dac: db $43, $55, $56, $53, $53, $53, $53, $53, $53, $53, $53, $53 db $43, $57, $58, $54, $54, $54, $54, $54, $54, $54, $54, $54 db $43, $59, $5A, $43, $43, $43, $43, $43, $43, $43, $43, $43 -AnimationLeavesFalling: ; 79dd0 (1e:5dd0) +AnimationLeavesFalling: ; Makes leaves float down from the top of the screen. This is used ; in Razor Leaf's animation. ld a, [wAnimPalette] @@ -2861,7 +2861,7 @@ AnimationLeavesFalling: ; 79dd0 (1e:5dd0) ld [wNumFallingObjects], a jp AnimationFallingObjects -AnimationPetalsFalling: ; 79de2 (1e:5de2) +AnimationPetalsFalling: ; Makes lots of petals fall down from the top of the screen. It's used in ; the animation for Petal Dance. ld d, $71 ; petal tile @@ -2870,7 +2870,7 @@ AnimationPetalsFalling: ; 79de2 (1e:5de2) call AnimationFallingObjects jp ClearSprites -AnimationFallingObjects: ; 79def (1e:5def) +AnimationFallingObjects: ld c, a ld a, 1 call InitMultipleObjectsOAM @@ -2909,7 +2909,7 @@ AnimationFallingObjects: ; 79def (1e:5def) jr nz, .loop ; keep moving the falling objects down until it does ret -FallingObjects_UpdateOAMEntry: ; 79cdb (1e:5cdb) +FallingObjects_UpdateOAMEntry: ; Increases Y by 2 pixels and adjusts X and X flip based on the falling object's ; movement byte. ld hl, wOAMBuffer @@ -2978,10 +2978,10 @@ FallingObjects_UpdateOAMEntry: ; 79cdb (1e:5cdb) ld [hl], a ; attribute ret -FallingObjects_DeltaXs: ; 79e96 (1e:5e96) +FallingObjects_DeltaXs: db 0, 1, 3, 5, 7, 9, 11, 13, 15 -FallingObjects_UpdateMovementByte: ; 79e9f (1e:5e9f) +FallingObjects_UpdateMovementByte: ld a, [wFallingObjectMovementByte] inc a ld b, a @@ -2997,7 +2997,7 @@ FallingObjects_UpdateMovementByte: ; 79e9f (1e:5e9f) ld [wFallingObjectMovementByte], a ret -FallingObjects_InitXCoords: ; 79eb3 (1e:5eb3) +FallingObjects_InitXCoords: ld hl, wOAMBuffer + $01 ld de, FallingObjects_InitialXCoords ld a, [wNumFallingObjects] @@ -3013,10 +3013,10 @@ FallingObjects_InitXCoords: ; 79eb3 (1e:5eb3) jr nz, .loop ret -FallingObjects_InitialXCoords: ; 79ec7 (1e:5ec7) +FallingObjects_InitialXCoords: db $38, $40, $50, $60, $70, $88, $90, $56, $67, $4A, $77, $84, $98, $32, $22, $5C, $6C, $7D, $8E, $99 -FallingObjects_InitMovementData: ; 79edb (1e:5edb) +FallingObjects_InitMovementData: ld hl, wFallingObjectsMovementData ld de, FallingObjects_InitialMovementData ld a, [wNumFallingObjects] @@ -3029,10 +3029,10 @@ FallingObjects_InitMovementData: ; 79edb (1e:5edb) jr nz, .loop ret -FallingObjects_InitialMovementData: ; 79eec (1e:5eec) +FallingObjects_InitialMovementData: db $00, $84, $06, $81, $02, $88, $01, $83, $05, $89, $09, $80, $07, $87, $03, $82, $04, $85, $08, $86 -AnimationShakeEnemyHUD: ; 79f00 (1e:5f00) +AnimationShakeEnemyHUD: ; Shakes the enemy HUD. ; Make a copy of the back pic's tile patterns in sprite tile pattern VRAM. @@ -3118,7 +3118,7 @@ AnimationShakeEnemyHUD: ; 79f00 (1e:5f00) ; b = tile ID list index ; c = base tile ID -CopyTileIDsFromList: ; 79f7b (1e:5f7b) +CopyTileIDsFromList: call GetPredefRegisters ld a, c ld [hBaseTileID], a @@ -3128,7 +3128,7 @@ CopyTileIDsFromList: ; 79f7b (1e:5f7b) pop hl jp CopyTileIDs -ShakeEnemyHUD_ShakeBG: ; 79f8a (1e:5f8a) +ShakeEnemyHUD_ShakeBG: ld a, [hSCX] ld [wTempSCX], a .loop @@ -3148,14 +3148,14 @@ ShakeEnemyHUD_ShakeBG: ; 79f8a (1e:5f8a) ld [hSCX], a ret -BattleAnimCopyTileMapToVRAM: ; 79fae (1e:5fae) +BattleAnimCopyTileMapToVRAM: ld a, h ld [H_AUTOBGTRANSFERDEST + 1], a ld a, l ld [H_AUTOBGTRANSFERDEST], a jp Delay3 -TossBallAnimation: ; 79fb7 (1e:5fb7) +TossBallAnimation: ld a, [wIsInBattle] cp a, 2 jr z, .BlockBall ; if in trainer battle, play different animation @@ -3198,7 +3198,7 @@ TossBallAnimation: ; 79fb7 (1e:5fb7) jr nz, .PlayNextAnimation ret -.PokeBallAnimations: ; 79ff1 (1e:5ff1) +.PokeBallAnimations: ; sequence of animations that make up the Poké Ball toss db POOF_ANIM, HIDEPIC_ANIM, SHAKE_ANIM, POOF_ANIM, SHOWPIC_ANIM @@ -3212,7 +3212,7 @@ TossBallAnimation: ; 79fb7 (1e:5fb7) ld [wAnimationID], a jp PlayAnimation -PlayApplyingAttackSound: ; 7a00b (1e:600b) +PlayApplyingAttackSound: ; 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 call WaitForSoundToFinish @@ -3236,4 +3236,4 @@ PlayApplyingAttackSound: ; 7a00b (1e:600b) ld a, b ld [wTempoModifier], a ld a, c - jp PlaySound
\ No newline at end of file + jp PlaySound diff --git a/engine/battle/bank3d_battle.asm b/engine/battle/bank3d_battle.asm index 2b2809d9..3719841f 100644 --- a/engine/battle/bank3d_battle.asm +++ b/engine/battle/bank3d_battle.asm @@ -1,14 +1,14 @@ -InitBattle: ; f5ff2 (3d:5ff2) +InitBattle: ld a, [wCurOpponent] and a jr z, asm_f6003 -InitOpponent: ; f5ff8 (3d:5ff8) +InitOpponent: ld a, [wCurOpponent] ld [wcf91], a ld [wEnemyMonSpecies2], a jr asm_f601d -asm_f6003: ; f6003 (3d:6003) +asm_f6003: ld a, [wd732] bit 1, a jr z, .asm_f600f @@ -21,7 +21,7 @@ asm_f6003: ; f6003 (3d:6003) ret nz callab TryDoWildEncounter ret nz -asm_f601d: ; f601d (f:601d) +asm_f601d: ld a, [wMapPalOffset] push af ld hl, wLetterPrintingDelayFlags @@ -56,7 +56,7 @@ asm_f601d: ; f601d (f:601d) callabd_ModifyPikachuHappiness PIKAHAPPY_GYMLEADER ; useless since already in bank3d jp InitBattle_Common -InitWildBattle: ; f607c (3d:607c) +InitWildBattle: ld a, $1 ld [wIsInBattle], a callab LoadEnemyMonData @@ -106,7 +106,7 @@ InitWildBattle: ; f607c (3d:607c) predef CopyUncompressedPicToTilemap ; common code that executes after init battle code specific to trainer or wild battles -InitBattle_Common: ; f60eb (3d:60eb) +InitBattle_Common: ld b, $0 call RunPaletteCommand callab SlidePlayerAndEnemySilhouettesOnScreen @@ -149,7 +149,7 @@ InitBattle_Common: ; f60eb (3d:60eb) .emptyString db "@" -_LoadTrainerPic: ; f615a (3d:615a) +_LoadTrainerPic: ; wd033-wd034 contain pointer to pic ld a, [wTrainerPicPointer] ; wd033 ld e, a @@ -167,7 +167,7 @@ _LoadTrainerPic: ; f615a (3d:615a) ld c, a jp LoadUncompressedSpriteData -LoadMonBackPic: ; f6178 (3d:6178) +LoadMonBackPic: ; Assumes the monster's attributes have ; been loaded with GetMonHeader. ld a, [wBattleMonSpecies2] @@ -187,7 +187,7 @@ LoadMonBackPic: ; f6178 (3d:6178) ld b, a jp CopyVideoData -AnimateSendingOutMon: ; f61a6 (3d:f61a6) +AnimateSendingOutMon: ld a, [wPredefRegisters] ld h, a ld a, [wPredefRegisters + 1] @@ -227,13 +227,13 @@ AnimateSendingOutMon: ; f61a6 (3d:f61a6) add $31 jr CopyUncompressedPicToHL -CopyUncompressedPicToTilemap: ; f61f9 (3d:61f9) +CopyUncompressedPicToTilemap: ld a, [wPredefRegisters] ld h, a ld a, [wPredefRegisters + 1] ld l, a ld a, [$ffe1] -CopyUncompressedPicToHL: ; f6203 (3d:6203) +CopyUncompressedPicToHL: ld bc, $707 ld de, $14 push af @@ -288,4 +288,4 @@ INCLUDE "engine/battle/moveEffects/reflect_light_screen_effect.asm" INCLUDE "engine/battle/moveEffects/mist_effect.asm" INCLUDE "engine/battle/moveEffects/one_hit_ko_effect.asm" INCLUDE "engine/battle/moveEffects/pay_day_effect.asm" -INCLUDE "engine/battle/moveEffects/paralyze_effect.asm"
\ No newline at end of file +INCLUDE "engine/battle/moveEffects/paralyze_effect.asm" diff --git a/engine/battle/bank_e_misc.asm b/engine/battle/bank_e_misc.asm index 278cce61..df9145f2 100755 --- a/engine/battle/bank_e_misc.asm +++ b/engine/battle/bank_e_misc.asm @@ -1,5 +1,5 @@ ; formats a string at wMovesString that lists the moves at wMoves -FormatMovesString: ; 39b06 (e:5b06) +FormatMovesString: ld hl, wMoves ld de, wMovesString ld b, $0 @@ -52,7 +52,7 @@ FormatMovesString: ; 39b06 (e:5b06) ret ; XXX this is called in a few places, but it doesn't appear to do anything useful -InitList: ; 39b53 (e:5b53) +InitList: ld a, [wInitListType] cp INIT_ENEMYOT_LIST jr nz, .notEnemy @@ -100,4 +100,4 @@ InitList: ; 39b53 (e:5b53) ld [wItemPrices], a ld a, b ld [wItemPrices + 1], a - ret
\ No newline at end of file + ret diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index e3527897..a4871837 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -1,4 +1,4 @@ -BattleTransition: ; 709d7 (1c:49d7) +BattleTransition: ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a call Delay3 @@ -70,7 +70,7 @@ BattleTransition: ; 709d7 (1c:49d7) ; bit 0: set if trainer battle ; bit 1: set if enemy is at least 3 levels higher than player ; bit 2: set if dungeon map -BattleTransitions: ; 70a3c (1c:4a3c) +BattleTransitions: dw BattleTransition_DoubleCircle ; %000 dw BattleTransition_Spiral ; %001 dw BattleTransition_Circle ; %010 @@ -80,7 +80,7 @@ BattleTransitions: ; 70a3c (1c:4a3c) dw BattleTransition_VerticalStripes ; %110 dw BattleTransition_Split ; %111 -GetBattleTransitionID_WildOrTrainer: ; 70a4c (1c:4a4c) +GetBattleTransitionID_WildOrTrainer: ld a, [wCurOpponent] cp 200 jr nc, .trainer @@ -90,7 +90,7 @@ GetBattleTransitionID_WildOrTrainer: ; 70a4c (1c:4a4c) set 0, c ret -GetBattleTransitionID_CompareLevels: ; 70a59 (1c:4a59) +GetBattleTransitionID_CompareLevels: ld hl, wPartyMon1HP .faintedLoop ld a, [hli] @@ -121,7 +121,7 @@ GetBattleTransitionID_CompareLevels: ; 70a59 (1c:4a59) ; fails to recognize VICTORY_ROAD_2, VICTORY_ROAD_3, all ROCKET_HIDEOUT maps, ; MANSION_1, SEAFOAM_ISLANDS_[2-5], POWER_PLANT, DIGLETTS_CAVE ; and SILPH_CO_[9-11]F as dungeon maps -GetBattleTransitionID_IsDungeonMap: ; 70a83 (1c:4a83) +GetBattleTransitionID_IsDungeonMap: ld a, [wCurMap] ld e, a ld hl, DungeonMaps1 @@ -153,7 +153,7 @@ GetBattleTransitionID_IsDungeonMap: ; 70a83 (1c:4a83) ; GetBattleTransitionID_IsDungeonMap checks if wCurMap ; is equal to one of these maps -DungeonMaps1: ; 70aa9 (1c:4aa9) +DungeonMaps1: db VIRIDIAN_FOREST db ROCK_TUNNEL_1 db SEAFOAM_ISLANDS_1 @@ -162,7 +162,7 @@ DungeonMaps1: ; 70aa9 (1c:4aa9) ; GetBattleTransitionID_IsDungeonMap checks if wCurMap ; is in between or equal to each pair of maps -DungeonMaps2: ; 70aac (1c:4aac) +DungeonMaps2: ; all MT_MOON maps db MT_MOON_1 db MT_MOON_3 @@ -181,17 +181,17 @@ DungeonMaps2: ; 70aac (1c:4aac) db UNKNOWN_DUNGEON_1 db $FF -LoadBattleTransitionTile: ; 70ab7 (1c:4ab7) +LoadBattleTransitionTile: ld hl, vChars1 + $7f0 ld de, BattleTransitionTile lb bc, BANK(BattleTransitionTile), (BattleTransitionTileEnd - BattleTransitionTile) / $10 jp CopyVideoData -BattleTransitionTile: ; 70ac3 (1c:4ac3) +BattleTransitionTile: INCBIN "gfx/battle_transition.2bpp" BattleTransitionTileEnd: -BattleTransition_BlackScreen: ; 70ad3 (1c:4ad3) +BattleTransition_BlackScreen: ld a, $ff ld [rBGP], a ld [rOBP0], a @@ -205,7 +205,7 @@ BattleTransition_BlackScreen: ; 70ad3 (1c:4ad3) ; called regardless of mon levels, but does an ; outward spiral if enemy is at least 3 levels ; higher than player and does an inward spiral otherwise -BattleTransition_Spiral: ; 70ae5 (1c:4ae5) +BattleTransition_Spiral: ld a, [wBattleTransitionSpiralDirection] and a jr z, .outwardSpiral @@ -238,7 +238,7 @@ BattleTransition_Spiral: ; 70ae5 (1c:4ae5) ld [wOutwardSpiralTileMapPointer], a ret -BattleTransition_InwardSpiral: ; 70b1d (1c:4b1d) +BattleTransition_InwardSpiral: ld a, 7 ld [wInwardSpiralUpdateScreenCounter], a coord hl, 0, 0 @@ -268,7 +268,7 @@ BattleTransition_InwardSpiral: ; 70b1d (1c:4b1d) jr nz, .loop ret -BattleTransition_InwardSpiral_: ; 70b53 (1c:4b53) +BattleTransition_InwardSpiral_: push bc .loop ld [hl], $ff @@ -287,7 +287,7 @@ BattleTransition_InwardSpiral_: ; 70b53 (1c:4b53) pop bc ret -BattleTransition_OutwardSpiral_: ; 70b6c (1c:4b6c) +BattleTransition_OutwardSpiral_: ld bc, -SCREEN_WIDTH ld de, SCREEN_WIDTH ld a, [wOutwardSpiralTileMapPointer + 1] @@ -355,7 +355,7 @@ BattleTransition_OutwardSpiral_: ; 70b6c (1c:4b6c) jr .done FlashScreen: -BattleTransition_FlashScreen_: ; 70be8 (1c:4be8) +BattleTransition_FlashScreen_: ld hl, BattleTransition_FlashScreenPalettes .loop ld a, [hli] @@ -371,12 +371,12 @@ BattleTransition_FlashScreen_: ; 70be8 (1c:4be8) jr nz, BattleTransition_FlashScreen_ ret -BattleTransition_FlashScreenPalettes: ; 70be8 (1c:4be8) +BattleTransition_FlashScreenPalettes: db $F9,$FE,$FF,$FE,$F9,$E4,$90,$40,$00,$40,$90,$E4 db $01 ; terminator ; used for low level trainer dungeon battles -BattleTransition_Shrink: ; 70bf4 (1c:4bf4) +BattleTransition_Shrink: ld c,9 .loop push bc @@ -410,7 +410,7 @@ BattleTransition_Shrink: ; 70bf4 (1c:4bf4) jp DelayFrames ; used for high level trainer dungeon battles -BattleTransition_Split: ; 70c40 (1c:4c40) +BattleTransition_Split: ld c,$9 xor a ld [H_AUTOBGTRANSFERENABLED], a @@ -441,7 +441,7 @@ BattleTransition_Split: ; 70c40 (1c:4c40) ld c, 10 jp DelayFrames -BattleTransition_CopyTiles1: ; 70c88 (1c:4c88) +BattleTransition_CopyTiles1: ld a, c ld [wBattleTransitionCopyTilesOffset], a ld a, b @@ -473,7 +473,7 @@ BattleTransition_CopyTiles1: ; 70c88 (1c:4c88) jr nz, .loop2 ret -BattleTransition_CopyTiles2: ; 70cb5 (1c:4cb5) +BattleTransition_CopyTiles2: ld a, c ld [wBattleTransitionCopyTilesOffset], a ld a, b @@ -523,7 +523,7 @@ BattleTransition_CopyTiles2: ; 70cb5 (1c:4cb5) ret ; used for high level wild dungeon battles -BattleTransition_VerticalStripes: ; 70cf4 (1c:4cf4) +BattleTransition_VerticalStripes: ld c, SCREEN_HEIGHT coord hl, 0, 0 coord de, 1, 17 @@ -551,7 +551,7 @@ BattleTransition_VerticalStripes: ; 70cf4 (1c:4cf4) jr nz, .loop jp BattleTransition_BlackScreen -BattleTransition_VerticalStripes_: ; 70d20 (1c:4d20) +BattleTransition_VerticalStripes_: ld c, SCREEN_WIDTH / 2 .loop ld [hl], $ff @@ -562,7 +562,7 @@ BattleTransition_VerticalStripes_: ; 70d20 (1c:4d20) ret ; used for low level wild dungeon battles -BattleTransition_HorizontalStripes: ; 70d2a (1c:4d2a) +BattleTransition_HorizontalStripes: ld c, SCREEN_WIDTH coord hl, 0, 0 coord de, 19, 1 @@ -586,7 +586,7 @@ BattleTransition_HorizontalStripes: ; 70d2a (1c:4d2a) jr nz, .loop jp BattleTransition_BlackScreen -BattleTransition_HorizontalStripes_: ; 70d4e (1c:4d4e) +BattleTransition_HorizontalStripes_: ld c, SCREEN_HEIGHT / 2 ld de, SCREEN_WIDTH * 2 .loop @@ -599,7 +599,7 @@ BattleTransition_HorizontalStripes_: ; 70d4e (1c:4d4e) ; used for high level wild non-dungeon battles ; makes one full circle around the screen ; by animating each half circle one at a time -BattleTransition_Circle: ; 70d5a (1c:4d5a) +BattleTransition_Circle: call BattleTransition_FlashScreen lb bc, 0, SCREEN_WIDTH / 2 ld hl, BattleTransition_HalfCircle1 @@ -610,14 +610,14 @@ BattleTransition_Circle: ; 70d5a (1c:4d5a) call BattleTransition_Circle_Sub1 jp BattleTransition_BlackScreen -BattleTransition_FlashScreen: ; 70d73 (1c:4d73) +BattleTransition_FlashScreen: ld b, $3 call BattleTransition_FlashScreen_ xor a ld [H_AUTOBGTRANSFERENABLED], a ret -BattleTransition_Circle_Sub1: ; 70d7c (1c:4d7c) +BattleTransition_Circle_Sub1: push bc push hl ld a, b @@ -631,7 +631,7 @@ BattleTransition_Circle_Sub1: ; 70d7c (1c:4d7c) jr nz, BattleTransition_Circle_Sub1 ret -BattleTransition_TransferDelay3: ; 70d8f (1c:4d8f) +BattleTransition_TransferDelay3: ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a call Delay3 @@ -642,7 +642,7 @@ BattleTransition_TransferDelay3: ; 70d8f (1c:4d8f) ; used for low level wild non-dungeon battles ; makes two half circles around the screen ; by animating both half circles at the same time -BattleTransition_DoubleCircle: ; 70d9a (1c:4d9a) +BattleTransition_DoubleCircle: call BattleTransition_FlashScreen ld c, SCREEN_WIDTH / 2 ld hl, BattleTransition_HalfCircle1 @@ -670,7 +670,7 @@ BattleTransition_DoubleCircle: ; 70d9a (1c:4d9a) jr nz, .loop jp BattleTransition_BlackScreen -BattleTransition_Circle_Sub2: ; 70dc6 (1c:4dc6) +BattleTransition_Circle_Sub2: ld [wBattleTransitionCircleScreenQuadrantY], a ld a, [hli] ld [wBattleTransitionCircleScreenQuadrantX], a @@ -683,7 +683,7 @@ BattleTransition_Circle_Sub2: ; 70dc6 (1c:4dc6) ld l, a jp BattleTransition_Circle_Sub3 -BattleTransition_HalfCircle1: ; 70dd7 (1c:4dd7) +BattleTransition_HalfCircle1: db $01 dw BattleTransition_CircleData1 dwCoord 18, 6 @@ -724,7 +724,7 @@ BattleTransition_HalfCircle1: ; 70dd7 (1c:4dd7) dw BattleTransition_CircleData1 dwCoord 1, 6 -BattleTransition_HalfCircle2: ; 70d93 (1c:4e09) +BattleTransition_HalfCircle2: db $00 dw BattleTransition_CircleData1 dwCoord 1, 11 @@ -765,7 +765,7 @@ BattleTransition_HalfCircle2: ; 70d93 (1c:4e09) dw BattleTransition_CircleData1 dwCoord 18, 11 -BattleTransition_Circle_Sub3: ; 70e3b (1c:4e3b) +BattleTransition_Circle_Sub3: push hl ld a, [de] ld c, a @@ -810,17 +810,17 @@ BattleTransition_Circle_Sub3: ; 70e3b (1c:4e3b) jr nz, .loop2 jr BattleTransition_Circle_Sub3 -BattleTransition_CircleData1: ; 70e74 (1c:4e74) +BattleTransition_CircleData1: db $02,$03,$05,$04,$09,$FF -BattleTransition_CircleData2: ; 70e7a (1c:4e7a) +BattleTransition_CircleData2: db $01,$01,$02,$02,$04,$02,$04,$02,$03,$FF -BattleTransition_CircleData3: ; 70e84 (1c:4e84) +BattleTransition_CircleData3: db $02,$01,$03,$01,$04,$01,$04,$01,$04,$01,$03,$01,$02,$01,$01,$01,$01,$FF -BattleTransition_CircleData4: ; 70e97 (1c:4e97) +BattleTransition_CircleData4: db $04,$01,$04,$00,$03,$01,$03,$00,$02,$01,$02,$00,$01,$FF -BattleTransition_CircleData5: ; 70ea3 (1c:4ea3) +BattleTransition_CircleData5: db $04,$00,$03,$00,$03,$00,$02,$00,$02,$00,$01,$00,$01,$00,$01,$FF diff --git a/engine/battle/common_text.asm b/engine/battle/common_text.asm index a0c44346..02bb1a61 100644 --- a/engine/battle/common_text.asm +++ b/engine/battle/common_text.asm @@ -1,4 +1,4 @@ -PrintBeginningBattleText: ; f4000 (3d:4000) +PrintBeginningBattleText: ld a, [wIsInBattle] ; W_ISINBATTLE dec a jr nz, .trainerBattle @@ -86,31 +86,31 @@ PrintBeginningBattleText: ; f4000 (3d:4000) .done ret -WildMonAppearedText: ; f40c7 (3d:40c7) +WildMonAppearedText: TX_FAR _WildMonAppearedText db "@" -HookedMonAttackedText: ; f40cc (3d:40cc) +HookedMonAttackedText: TX_FAR _HookedMonAttackedText db "@" -EnemyAppearedText: ; f40d1 (3d:40d1) +EnemyAppearedText: TX_FAR _EnemyAppearedText db "@" -TrainerWantsToFightText: ; f40d6 (3d:40d6) +TrainerWantsToFightText: TX_FAR _TrainerWantsToFightText db "@" -UnveiledGhostText: ; f40db (3d:40db) +UnveiledGhostText: TX_FAR _UnveiledGhostText db "@" -GhostCantBeIDdText: ; f40e0 (3d:40e0) +GhostCantBeIDdText: TX_FAR _GhostCantBeIDdText db "@" -PrintSendOutMonMessage: ; f40e0 (3d:40e5) +PrintSendOutMonMessage: ld hl, wEnemyMonHP ld a, [hli] or [hl] @@ -153,38 +153,38 @@ PrintSendOutMonMessage: ; f40e0 (3d:40e5) .printText jp PrintText -GoText: ; f413a (3d:413a) +GoText: TX_FAR _GoText TX_ASM jr PrintPlayerMon1Text -DoItText: ; f4141 (3d:4141) +DoItText: TX_FAR _DoItText TX_ASM jr PrintPlayerMon1Text -GetmText: ; f4148 (3d:4148) +GetmText: TX_FAR _GetmText TX_ASM jr PrintPlayerMon1Text -EnemysWeakText: ; f414f (3d:414f) +EnemysWeakText: TX_FAR _EnemysWeakText TX_ASM -PrintPlayerMon1Text: ; f4154 (3d:4154) +PrintPlayerMon1Text: ld hl, PlayerMon1Text ret -PlayerMon1Text: ; f4158 (3d:4158) +PlayerMon1Text: TX_FAR _PlayerMon1Text db "@" -RetreatMon: ; f415d (3d:415d) +RetreatMon: ld hl, PlayerMon2Text jp PrintText -PlayerMon2Text: ; f4163 (3d:4163) +PlayerMon2Text: TX_FAR _PlayerMon2Text TX_ASM push de @@ -235,25 +235,25 @@ PlayerMon2Text: ; f4163 (3d:4163) ld hl, GoodText ; HP went down 70% or more ret -EnoughText: ; f41b1 (3d:41b1) +EnoughText: TX_FAR _EnoughText TX_ASM jr PrintComeBackText -OKExclamationText: ; f41b8 (3d:41b8) +OKExclamationText: TX_FAR _OKExclamationText TX_ASM jr PrintComeBackText -GoodText: ; f41bf (3d:41bf) +GoodText: TX_FAR _GoodText TX_ASM jr PrintComeBackText -PrintComeBackText: ; f41c6 (3d:41c6) +PrintComeBackText: ld hl, ComeBackText ret -ComeBackText: ; f41ca (3d:41ca) +ComeBackText: TX_FAR _ComeBackText db "@" diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 24b3863b..fa56e5b2 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -1,7 +1,7 @@ BattleCore: ; These are move effects (second value from the Moves table in bank $E). -ResidualEffects1: ; 3c000 (f:4000) +ResidualEffects1: ; most non-side effects db CONVERSION_EFFECT db HAZE_EFFECT @@ -20,13 +20,13 @@ ResidualEffects1: ; 3c000 (f:4000) db LEECH_SEED_EFFECT db SPLASH_EFFECT db -1 -SetDamageEffects: ; 3c011 (f:4011) +SetDamageEffects: ; moves that do damage but not through normal calculations ; e.g., Super Fang, Psywave db SUPER_FANG_EFFECT db SPECIAL_DAMAGE_EFFECT db -1 -ResidualEffects2: ; 3c014 (f:4014) +ResidualEffects2: ; non-side effects not included in ResidualEffects1 ; stat-affecting moves, sleep-inflicting moves, and Bide ; e.g., Meditate, Bide, Hypnosis @@ -58,7 +58,7 @@ ResidualEffects2: ; 3c014 (f:4014) db ACCURACY_DOWN2_EFFECT db EVASION_DOWN2_EFFECT db -1 -AlwaysHappenSideEffects: ; 3c030 (f:4030) +AlwaysHappenSideEffects: ; Attacks that aren't finished after they faint the opponent. db DRAIN_HP_EFFECT db EXPLODE_EFFECT @@ -71,7 +71,7 @@ AlwaysHappenSideEffects: ; 3c030 (f:4030) db TWINEEDLE_EFFECT db RAGE_EFFECT db -1 -SpecialEffects: ; 3c03b (f:403b) +SpecialEffects: ; Effects from arrays 2, 4, and 5B, minus Twineedle and Rage. ; Includes all effects that do not need to be called at the end of ; ExecutePlayerMove (or ExecuteEnemyMove), because they have already been handled @@ -90,13 +90,13 @@ SpecialEffects: ; 3c03b (f:403b) db JUMP_KICK_EFFECT db RECOIL_EFFECT ; fallthrough to Next EffectsArray -SpecialEffectsCont: ; 3c049 (f:4049) +SpecialEffectsCont: ; damaging moves whose effect is executed prior to damage calculation db THRASH_PETAL_DANCE_EFFECT db TRAPPING_EFFECT db -1 -SlidePlayerAndEnemySilhouettesOnScreen: ; 3c04c (f:404c) +SlidePlayerAndEnemySilhouettesOnScreen: call LoadPlayerBackPic ld a, MESSAGE_BOX ; the usual text box at the bottom of the screen ld [wTextBoxID], a @@ -196,7 +196,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: ; 3c04c (f:404c) ; the lower of the player's pic (his body) is part of the background, but his head is a sprite ; the reason for this is that it shares Y coordinates with the lower part of the enemy pic, so background scrolling wouldn't work for both pics ; instead, the enemy pic is part of the background and uses the scroll register, while the player's head is a sprite and is slid by changing its X coordinates in a loop -SlidePlayerHeadLeft: ; 3c108 (f:4108) +SlidePlayerHeadLeft: push bc ld hl, wOAMBuffer + $01 ld c, $15 ; number of OAM entries @@ -210,7 +210,7 @@ SlidePlayerHeadLeft: ; 3c108 (f:4108) pop bc ret -SetScrollXForSlidingPlayerBodyLeft: ; 3c119 (f:4119) +SetScrollXForSlidingPlayerBodyLeft: ld a, [rLY] cp l jr nz, SetScrollXForSlidingPlayerBodyLeft @@ -222,7 +222,7 @@ SetScrollXForSlidingPlayerBodyLeft: ; 3c119 (f:4119) jr z, .loop ret -StartBattle: ; 3c127 (f:4127) +StartBattle: xor a ld [wPartyGainExpFlags], a ld [wPartyFoughtCurrentEnemyFlags], a @@ -350,7 +350,7 @@ StartBattle: ; 3c127 (f:4127) jr MainInBattleLoop ; wild mon or link battle enemy ran from battle -EnemyRan: ; 3c202 (f:4218) +EnemyRan: call LoadScreenTilesFromBuffer1 ld a, [wLinkState] cp LINK_STATE_BATTLING @@ -368,15 +368,15 @@ EnemyRan: ; 3c202 (f:4218) ld [H_WHOSETURN], a jpab AnimationSlideEnemyMonOff -WildRanText: ; 3c23f (f:423f) +WildRanText: TX_FAR _WildRanText db "@" -EnemyRanText: ; 3c23f (f:423f) +EnemyRanText: TX_FAR _EnemyRanText db "@" -MainInBattleLoop: ; 3c249 (f:4249) +MainInBattleLoop: call ReadPlayerMonCurHPAndStatus ld hl, wBattleMonHP ld a, [hli] @@ -566,7 +566,7 @@ MainInBattleLoop: ; 3c249 (f:4249) call CheckNumAttacksLeft jp MainInBattleLoop -HandlePoisonBurnLeechSeed: ; 3c3d3 (f:43d3) +HandlePoisonBurnLeechSeed: ld hl, wBattleMonHP ld de, wBattleMonStatus ld a, [H_WHOSETURN] @@ -630,15 +630,15 @@ HandlePoisonBurnLeechSeed: ; 3c3d3 (f:43d3) xor a ret -HurtByPoisonText: ; 3c444 (f:4444) +HurtByPoisonText: TX_FAR _HurtByPoisonText db "@" -HurtByBurnText: ; 3c449 (f:4449) +HurtByBurnText: TX_FAR _HurtByBurnText db "@" -HurtByLeechSeedText: ; 3c44e (f:444e) +HurtByLeechSeedText: TX_FAR _HurtByLeechSeedText db "@" @@ -646,7 +646,7 @@ HurtByLeechSeedText: ; 3c44e (f:444e) ; note that the toxic ticks are considered even if the damage is not poison (hence the Leech Seed glitch) ; hl: HP pointer ; bc (out): total damage -HandlePoisonBurnLeechSeed_DecreaseOwnHP: ; 3c43d (f:443d) +HandlePoisonBurnLeechSeed_DecreaseOwnHP: push hl push hl ld bc, $e ; skip to max HP @@ -714,7 +714,7 @@ HandlePoisonBurnLeechSeed_DecreaseOwnHP: ; 3c43d (f:443d) ; adds bc to enemy HP ; bc isn't updated if HP substracted was capped to prevent overkill -HandlePoisonBurnLeechSeed_IncreaseEnemyHP: ; 3c4b9 (f:44b9) +HandlePoisonBurnLeechSeed_IncreaseEnemyHP: push hl ld hl, wEnemyMonMaxHP ld a, [H_WHOSETURN] @@ -764,7 +764,7 @@ HandlePoisonBurnLeechSeed_IncreaseEnemyHP: ; 3c4b9 (f:44b9) pop hl ret -UpdateCurMonHPBar: ; 3c50c (f:450c) +UpdateCurMonHPBar: coord hl, 10, 9 ; tile pointer to player HP bar ld a, [H_WHOSETURN] and a @@ -779,7 +779,7 @@ UpdateCurMonHPBar: ; 3c50c (f:450c) pop bc ret -CheckNumAttacksLeft: ; 3c525 (f:4525) +CheckNumAttacksLeft: ld a, [wPlayerNumAttacksLeft] and a jr nz, .checkEnemy @@ -795,7 +795,7 @@ CheckNumAttacksLeft: ; 3c525 (f:4525) res UsingTrappingMove, [hl] ; enemy not using multi-turn attack like wrap any more ret -HandleEnemyMonFainted: ; 3c53b (f:453b) +HandleEnemyMonFainted: xor a ld [wInHandlePlayerMonFainted], a call FaintEnemyPokemon @@ -828,7 +828,7 @@ HandleEnemyMonFainted: ; 3c53b (f:453b) ld [wActionResultOrTookBattleTurn], a jp MainInBattleLoop -FaintEnemyPokemon: ; 3c57d (f:457d) +FaintEnemyPokemon: call ReadPlayerMonCurHPAndStatus ld a, [wIsInBattle] dec a @@ -956,11 +956,11 @@ FaintEnemyPokemon: ; 3c57d (f:457d) ld [wPartyGainExpFlags], a jpab GainExperience -EnemyMonFaintedText: ; 3c654 (f:4654) +EnemyMonFaintedText: TX_FAR _EnemyMonFaintedText db "@" -EndLowHealthAlarm: ; 3c659 (f:4659) +EndLowHealthAlarm: ; This function is called when the player has the won the battle. It turns off ; the low health alarm and prevents it from reactivating until the next battle. xor a @@ -970,7 +970,7 @@ EndLowHealthAlarm: ; 3c659 (f:4659) ld [wLowHealthAlarmDisabled], a ; prevent it from reactivating ret -AnyEnemyPokemonAliveCheck: ; 3c665 (f:4665) +AnyEnemyPokemonAliveCheck: ld a, [wEnemyPartyCount] ld b, a xor a @@ -988,7 +988,7 @@ AnyEnemyPokemonAliveCheck: ; 3c665 (f:4665) ret ; stores whether enemy ran in Z flag -ReplaceFaintedEnemyMon: ; 3c67a (f:467a) +ReplaceFaintedEnemyMon: ld hl, wEnemyHPBarColor ld e, $30 call GetBattleHealthBarColor @@ -1016,7 +1016,7 @@ ReplaceFaintedEnemyMon: ; 3c67a (f:467a) inc a ; reset Z flag ret -TrainerBattleVictory: ; 3c6b8 (f:46b8) +TrainerBattleVictory: call EndLowHealthAlarm ld b, MUSIC_DEFEATED_GYM_LEADER ld a, [wGymLeaderNo] @@ -1052,15 +1052,15 @@ TrainerBattleVictory: ; 3c6b8 (f:46b8) ld c, $3 predef_jump AddBCDPredef -MoneyForWinningText: ; 3c706 (f:4706) +MoneyForWinningText: TX_FAR _MoneyForWinningText db "@" -TrainerDefeatedText: ; 3c70b (f:470b) +TrainerDefeatedText: TX_FAR _TrainerDefeatedText db "@" -PlayBattleVictoryMusic: ; 3c710 (f:4710) +PlayBattleVictoryMusic: push af call StopAllMusic ld c, BANK(Music_DefeatedTrainer) @@ -1068,7 +1068,7 @@ PlayBattleVictoryMusic: ; 3c710 (f:4710) call PlayMusic jp Delay3 -HandlePlayerMonFainted: ; 3c71d (f:471d) +HandlePlayerMonFainted: ld a, 1 ld [wInHandlePlayerMonFainted], a call RemoveFaintedPlayerMon @@ -1102,7 +1102,7 @@ HandlePlayerMonFainted: ; 3c71d (f:471d) jp MainInBattleLoop ; resets flags, slides mon's pic down, plays cry, and prints fainted message -RemoveFaintedPlayerMon: ; 3c75e (f:475e) +RemoveFaintedPlayerMon: ld a, [wPlayerMonNumber] ld c, a ld hl, wPartyGainExpFlags @@ -1172,13 +1172,13 @@ RemoveFaintedPlayerMon: ; 3c75e (f:475e) callabd_ModifyPikachuHappiness PIKAHAPPY_CARELESSTRAINER ret -PlayerMonFaintedText: ; 3c7fa (f:47fa) +PlayerMonFaintedText: TX_FAR _PlayerMonFaintedText db "@" ; asks if you want to use next mon ; stores whether you ran in C flag -DoUseNextMonDialogue: ; 3c7ff (f:47ff) +DoUseNextMonDialogue: call PrintEmptyString call SaveScreenTilesToBuffer1 ld a, [wIsInBattle] @@ -1206,13 +1206,13 @@ DoUseNextMonDialogue: ; 3c7ff (f:47ff) ld de, wEnemyMonSpeed jp TryRunningFromBattle -UseNextMonText: ; 3c837 (f:4837) +UseNextMonText: TX_FAR _UseNextMonText db "@" ; choose next player mon to send out ; stores whether enemy mon has no HP left in Z flag -ChooseNextMon: ; 3c83c (f:483c) +ChooseNextMon: ld a, BATTLE_PARTY_MENU ld [wPartyMenuTypeOrMessageID], a call DisplayPartyMenu @@ -1258,7 +1258,7 @@ ChooseNextMon: ; 3c83c (f:483c) ; called when player is out of usable mons. ; prints approriate lose message, sets carry flag if player blacked out (special case for initial rival fight) -HandlePlayerBlackOut: ; 3c89c (f:489c) +HandlePlayerBlackOut: ld a, [wLinkState] cp LINK_STATE_BATTLING jr z, .notSony1Battle @@ -1293,21 +1293,21 @@ HandlePlayerBlackOut: ; 3c89c (f:489c) scf ret -Sony1WinText: ; 3c8e9 (f:48e9) +Sony1WinText: TX_FAR _Sony1WinText db "@" -PlayerBlackedOutText2: ; 3c8ee (f:48ee) +PlayerBlackedOutText2: TX_FAR _PlayerBlackedOutText2 db "@" -LinkBattleLostText: ; 3c8f3 (f:48f3) +LinkBattleLostText: TX_FAR _LinkBattleLostText db "@" ; slides pic of fainted mon downwards until it disappears ; bug: when this is called, [H_AUTOBGTRANSFERENABLED] is non-zero, so there is screen tearing -SlideDownFaintedMonPic: ; 3c8f8 (f:48f8) +SlideDownFaintedMonPic: ld a, [wd730] push af set 6, a @@ -1353,14 +1353,14 @@ SlideDownFaintedMonPic: ; 3c8f8 (f:48f8) ld [wd730], a ret -SevenSpacesText: ; 3c93c (f:493c) +SevenSpacesText: db " @" ; slides the player or enemy trainer off screen ; a is the number of tiles to slide it horizontally (always 9 for the player trainer or 8 for the enemy trainer) ; if a is 8, the slide is to the right, else it is to the left ; bug: when this is called, [H_AUTOBGTRANSFERENABLED] is non-zero, so there is screen tearing -SlideTrainerPicOffScreen: ; 3c944 (f:4944) +SlideTrainerPicOffScreen: ld [hSlideAmount], a ld c, a .slideStepLoop ; each iteration, the trainer pic is slid one tile left/right @@ -1401,7 +1401,7 @@ SlideTrainerPicOffScreen: ; 3c944 (f:4944) ret ; send out a trainer's mon -EnemySendOut: ; 3c973 (f:4973) +EnemySendOut: ld hl,wPartyGainExpFlags xor a ld [hl],a @@ -1417,7 +1417,7 @@ EnemySendOut: ; 3c973 (f:4973) predef FlagActionPredef ; don't change wPartyGainExpFlags or wPartyFoughtCurrentEnemyFlags -EnemySendOutFirstMon: ; 3c98f (f:498f) +EnemySendOutFirstMon: xor a ld hl,wEnemyStatsToDouble ; clear enemy statuses ld [hli],a @@ -1570,17 +1570,17 @@ EnemySendOutFirstMon: ; 3c98f (f:498f) call SaveScreenTilesToBuffer1 jp SwitchPlayerMon -TrainerAboutToUseText: ; 3cade (f:4ade) +TrainerAboutToUseText: TX_FAR _TrainerAboutToUseText db "@" -TrainerSentOutText: ; 3cae3 (f:4ae3) +TrainerSentOutText: TX_FAR _TrainerSentOutText db "@" ; tests if the player has any pokemon that are not fainted ; sets d = 0 if all fainted, d != 0 if some mons are still alive -AnyPartyAlive: ; 3cae8 (f:4ae8) +AnyPartyAlive: ld a, [wPartyCount] ld e, a xor a @@ -1598,7 +1598,7 @@ AnyPartyAlive: ; 3cae8 (f:4ae8) ; tests if player mon has fainted ; stores whether mon has fainted in Z flag -HasMonFainted: ; 3cafc (f:4afc) +HasMonFainted: ld a, [wWhichPokemon] ld hl, wPartyMon1HP ld bc, wPartyMon2 - wPartyMon1 @@ -1615,13 +1615,13 @@ HasMonFainted: ; 3cafc (f:4afc) xor a ret -NoWillText: ; 3cb19 (f:4b19) +NoWillText: TX_FAR _NoWillText db "@" ; try to run from battle (hl = player speed, de = enemy speed) ; stores whether the attempt was successful in carry flag -TryRunningFromBattle: ; 3cb1e (f:4b1e) +TryRunningFromBattle: call IsGhostBattle jp z, .canEscape ; jump if it's a ghost battle ld a, [wBattleType] @@ -1740,20 +1740,20 @@ TryRunningFromBattle: ; 3cb1e (f:4b1e) scf ; set carry ret -CantEscapeText: ; 3cc01 (f:4c01) +CantEscapeText: TX_FAR _CantEscapeText db "@" -NoRunningText: ; 3cc06 (f:4c06) +NoRunningText: TX_FAR _NoRunningText db "@" -GotAwayText: ; 3cc0b (f:4c0b) +GotAwayText: TX_FAR _GotAwayText db "@" ; copies from party data to battle mon data when sending out a new player mon -LoadBattleMonFromParty: ; 3cc10 (f:4c10) +LoadBattleMonFromParty: ld a, [wWhichPokemon] ld bc, wPartyMon2 - wPartyMon1 ld hl, wPartyMon1Species @@ -1797,7 +1797,7 @@ LoadBattleMonFromParty: ; 3cc10 (f:4c10) ret ; copies from enemy party data to current enemy mon data when sending out a new enemy mon -LoadEnemyMonFromParty: ; 3cc7d (f:4c7d) +LoadEnemyMonFromParty: ld a, [wWhichPokemon] ld bc, wEnemyMon2 - wEnemyMon1 ld hl, wEnemyMons @@ -1850,7 +1850,7 @@ LoadEnemyMonFromParty: ; 3cc7d (f:4c7d) ld [wEnemyMonPartyPos], a ret -SendOutMon: ; 3ccfb (f:4cfb) +SendOutMon: callab PrintSendOutMonMessage ld hl, wEnemyMonHP ld a, [hli] @@ -1914,7 +1914,7 @@ SendOutMon: ; 3ccfb (f:4cfb) jp SaveScreenTilesToBuffer1 ; show 2 stages of the player mon getting smaller before disappearing -AnimateRetreatingPlayerMon: ; 3cd97 (f:4d97) +AnimateRetreatingPlayerMon: ld a, [wWhichPokemon] push af ld a, [wPlayerMonNumber] @@ -1960,7 +1960,7 @@ AnimateRetreatingPlayerMon: ; 3cd97 (f:4d97) ret ; reads player's current mon's HP into wBattleMonHP -ReadPlayerMonCurHPAndStatus: ; 3ce08 (f:4e08) +ReadPlayerMonCurHPAndStatus: ld a, [wPlayerMonNumber] ld hl, wPartyMon1HP ld bc, wPartyMon2 - wPartyMon1 @@ -1971,11 +1971,11 @@ ReadPlayerMonCurHPAndStatus: ; 3ce08 (f:4e08) ld bc, $4 ; 2 bytes HP, 1 byte unknown (unused?), 1 byte status jp CopyData -DrawHUDsAndHPBars: ; 3ce1f (f:4e1f) +DrawHUDsAndHPBars: call DrawPlayerHUDAndHPBar jp DrawEnemyHUDAndHPBar -DrawPlayerHUDAndHPBar: ; 3ce25 (f:4e25) +DrawPlayerHUDAndHPBar: xor a ld [H_AUTOBGTRANSFERENABLED], a coord hl, 9, 7 @@ -2036,7 +2036,7 @@ DrawPlayerHUDAndHPBar: ; 3ce25 (f:4e25) set 7, [hl] ;enable low health alarm ret -DrawEnemyHUDAndHPBar: ; 3ceb1 (f:4eb1) +DrawEnemyHUDAndHPBar: xor a ld [H_AUTOBGTRANSFERENABLED], a coord hl, 0, 0 @@ -2126,7 +2126,7 @@ DrawEnemyHUDAndHPBar: ; 3ceb1 (f:4eb1) ld [H_AUTOBGTRANSFERENABLED], a ld hl, wEnemyHPBarColor -GetBattleHealthBarColor: ; 3cf55 (f:4f55) +GetBattleHealthBarColor: ld b, [hl] call GetHealthBarColor ld a, [hl] @@ -2140,7 +2140,7 @@ GetBattleHealthBarColor: ; 3cf55 (f:4f55) ; (i.e. for names longer than 4 letters) ; if the name is 3 or 4 letters long, it is printed 1 space more to the right than usual ; (i.e. for names longer than 4 letters) -CenterMonName: ; 3cf61 (f:4f61) +CenterMonName: push de inc hl inc hl @@ -2161,7 +2161,7 @@ CenterMonName: ; 3cf61 (f:4f61) pop de ret -DisplayBattleMenu: ; 3cf78 (f:4f78) +DisplayBattleMenu: call LoadScreenTilesFromBuffer1 ; restore saved screen ld a, [wBattleType] and a @@ -2376,7 +2376,7 @@ DisplayBattleMenu: ; 3cf78 (f:4f78) ld [wcf91], a jr UseBagItem -BagWasSelected: ; 3d10a (f:510a) +BagWasSelected: call LoadScreenTilesFromBuffer1 ld a, [wBattleType] and a ; is it a normal battle? @@ -2399,12 +2399,12 @@ BagWasSelected: ; 3d10a (f:510a) ld [wListPointer + 1], a jr DisplayBagMenu -SimulatedInputBattleItemList: ; 3c130 (f:5130) +SimulatedInputBattleItemList: db 1 ; # of items db POKE_BALL, 1 db $ff -DisplayPlayerBag: ; 3c134 (f:5134) +DisplayPlayerBag: ; get the pointer to player's bag when in a normal battle ld hl, wNumBagItems ld a, l @@ -2412,7 +2412,7 @@ DisplayPlayerBag: ; 3c134 (f:5134) ld a, h ld [wListPointer + 1], a -DisplayBagMenu: ; 3c13f (f:513f) +DisplayBagMenu: xor a ld [wPrintItemPrices], a ld a, ITEMLISTMENU @@ -2427,7 +2427,7 @@ DisplayBagMenu: ; 3c13f (f:513f) ld [wMenuItemToSwap], a jp c, DisplayBattleMenu ; go back to battle menu if an item was not selected -UseBagItem: ; 3c162 (f:5162) +UseBagItem: ; either use an item from the bag or use a safari zone item ld a, [wcf91] ld [wd11e], a @@ -2484,11 +2484,11 @@ UseBagItem: ; 3c162 (f:5162) scf ; set carry ret -ItemsCantBeUsedHereText: ; 3d1c8 (f:51c8) +ItemsCantBeUsedHereText: TX_FAR _ItemsCantBeUsedHereText db "@" -PartyMenuOrRockOrRun: ; 3d1cd (f:51cd) +PartyMenuOrRockOrRun: dec a ; was Run selected? jp nz, BattleMenu_RunWasSelected ; party menu or rock was selected @@ -2608,7 +2608,7 @@ PartyMenuOrRockOrRun: ; 3d1cd (f:51cd) call GBPalNormal ; fall through to SwitchPlayerMon -SwitchPlayerMon: ; 3d2c1 (f:52c1) +SwitchPlayerMon: callab RetreatMon ld c, 50 call DelayFrames @@ -2631,11 +2631,11 @@ SwitchPlayerMon: ; 3d2c1 (f:52c1) and a ret -AlreadyOutText: ; 3d2fc (f:52fc) +AlreadyOutText: TX_FAR _AlreadyOutText db "@" -BattleMenu_RunWasSelected: ; 3d301 (f:5301) +BattleMenu_RunWasSelected: call LoadScreenTilesFromBuffer1 ld a, $3 ld [wCurrentMenuItem], a @@ -2650,7 +2650,7 @@ BattleMenu_RunWasSelected: ; 3d301 (f:5301) ret nz ; return if the player couldn't escape jp DisplayBattleMenu -MoveSelectionMenu: ; 3d320 (f:5320) +MoveSelectionMenu: ld a, [wMoveMenuType] dec a jr z, .mimicmenu @@ -2764,7 +2764,7 @@ MoveSelectionMenu: ; 3d320 (f:5320) ld [hl], a ; fallthrough -SelectMenuItem: ; 3d3fe (f:53fe) +SelectMenuItem: ld a, [wMoveMenuType] and a jr z, .battleselect @@ -2859,18 +2859,18 @@ SelectMenuItem: ; 3d3fe (f:53fe) call LoadScreenTilesFromBuffer1 jp MoveSelectionMenu -MoveNoPPText: ; 3d4ae (f:54ae) +MoveNoPPText: TX_FAR _MoveNoPPText db "@" -MoveDisabledText: ; 3d4b3 (f:54b3) +MoveDisabledText: TX_FAR _MoveDisabledText db "@" -WhichTechniqueString: ; 3d4b8 (f:54b8) +WhichTechniqueString: db "WHICH TECHNIQUE?@" -SelectMenuItem_CursorUp: ; 3d4c9 (f:54c9) +SelectMenuItem_CursorUp: ld a, [wCurrentMenuItem] and a jp nz, SelectMenuItem @@ -2880,7 +2880,7 @@ SelectMenuItem_CursorUp: ; 3d4c9 (f:54c9) ld [wCurrentMenuItem], a jp SelectMenuItem -SelectMenuItem_CursorDown: ; 3d4dd (f:54dd) +SelectMenuItem_CursorDown: ld a, [wCurrentMenuItem] ld b, a ld a, [wNumMovesMinusOne] @@ -2893,7 +2893,7 @@ SelectMenuItem_CursorDown: ; 3d4dd (f:54dd) ld [wCurrentMenuItem], a jp SelectMenuItem -Func_3d4f5: ; 3d4f5 (f:54f5) +Func_3d4f5: bit 3, a ld a, $0 jr nz, .asm_3d4fd @@ -2912,19 +2912,19 @@ Func_3d4f5: ; 3d4f5 (f:54f5) callab Func_78e98 jp MoveSelectionMenu -Func_3d523: ; 3d523 (f:5523) +Func_3d523: ld a, [wTestBattlePlayerSelectedMove] dec a jr asm_3d52d -Func_3d529: ; 3d529 (f:5529) +Func_3d529: ld a, [wTestBattlePlayerSelectedMove] inc a -asm_3d52d: ; 3d52d (f:552d) +asm_3d52d: ld [wTestBattlePlayerSelectedMove], a call Func_3d536 jp MoveSelectionMenu -Func_3d536: ; 3d536 (f:5536) +Func_3d536: coord hl, 10, 16 lb bc, 2, 10 call ClearScreenArea @@ -2942,7 +2942,7 @@ Func_3d536: ; 3d536 (f:5536) coord hl, 13, 17 jp PlaceString -AnyMoveToSelect: ; 3d55f (f:555f) +AnyMoveToSelect: ; return z and Struggle as the selected move if all moves have 0 PP and/or are disabled ld a, STRUGGLE ld [wPlayerSelectedMove], a @@ -2988,11 +2988,11 @@ AnyMoveToSelect: ; 3d55f (f:555f) xor a ret -NoMovesLeftText: ; 3d59b (f:559b) +NoMovesLeftText: TX_FAR _NoMovesLeftText db "@" -SwapMovesInMenu: ; 3d5a0 (f:55a0) +SwapMovesInMenu: ld a, [wPlayerBattleStatus3] bit Transformed, a jp nz, MoveSelectionMenu @@ -3071,7 +3071,7 @@ SwapMovesInMenu: ; 3d5a0 (f:55a0) ld [wMenuItemToSwap], a ; select the current menu item for swapping jp MoveSelectionMenu -PrintMenuItem: ; 3d629 (f:5629) +PrintMenuItem: xor a ld [H_AUTOBGTRANSFERENABLED], a coord hl, 0, 8 @@ -3141,13 +3141,13 @@ PrintMenuItem: ; 3d629 (f:5629) ld [H_AUTOBGTRANSFERENABLED], a jp Delay3 -DisabledText: ; 3d6c7 (f:56c7) +DisabledText: db "Disabled!@" -TypeText: ; 3d6d1 (f:56d1) +TypeText: db "TYPE@" -SelectEnemyMove: ; 3d6d6 (f:56d6) +SelectEnemyMove: ld a, [wLinkState] sub LINK_STATE_BATTLING jr nz, .noLinkBattle @@ -3240,7 +3240,7 @@ SelectEnemyMove: ; 3d6d6 (f:56d6) jr .done ; this appears to exchange data with the other gameboy during link battles -LinkBattleExchangeData: ; 3d777 (f:5777) +LinkBattleExchangeData: ld a, $ff ld [wSerialExchangeNybbleReceiveData], a ld a, [wPlayerMoveListIndex] @@ -3288,7 +3288,7 @@ LinkBattleExchangeData: ; 3d777 (f:5777) jr nz, .syncLoop3 ret -ExecutePlayerMove: ; 3d7d0 (f:57d0) +ExecutePlayerMove: xor a ld [H_WHOSETURN], a ; set player's turn ld a, [wPlayerSelectedMove] @@ -3316,7 +3316,7 @@ ExecutePlayerMove: ; 3d7d0 (f:57d0) call CheckForDisobedience jp z, ExecutePlayerMoveDone -CheckIfPlayerNeedsToChargeUp: ; 3d80c (f:580c) +CheckIfPlayerNeedsToChargeUp: ld a, [wPlayerMoveEffect] cp CHARGE_EFFECT jp z, JumpMoveEffect @@ -3325,13 +3325,13 @@ CheckIfPlayerNeedsToChargeUp: ; 3d80c (f:580c) jr PlayerCanExecuteMove ; in-battle stuff -PlayerCanExecuteChargingMove: ; 3d81b (f:581b) +PlayerCanExecuteChargingMove: ld hl,wPlayerBattleStatus1 res ChargingUp,[hl] ; reset charging up and invulnerability statuses if mon was charging up for an attack ; being fully paralyzed or hurting oneself in confusion removes charging up status ; resulting in the Pokemon being invulnerable for the whole battle res Invulnerable,[hl] -PlayerCanExecuteMove: ; 3d822 (f:5822) +PlayerCanExecuteMove: call PrintMonName1Text ld hl,DecrementPP ld de,wPlayerSelectedMove ; pointer to the move just used @@ -3348,7 +3348,7 @@ PlayerCanExecuteMove: ; 3d822 (f:5822) ld de,1 call IsInArray call c,JumpMoveEffect ; execute the effects of SpecialEffectsCont moves (e.g. Wrap, Thrash) but don't skip anything -PlayerCalcMoveDamage: ; 3d84e (f:584e) +PlayerCalcMoveDamage: ld a,[wPlayerMoveEffect] ld hl,SetDamageEffects ld de,1 @@ -3365,7 +3365,7 @@ PlayerCalcMoveDamage: ; 3d84e (f:584e) call RandomizeDamage .moveHitTest call MoveHitTest -handleIfPlayerMoveMissed: ; 3d877 (f:5877) +handleIfPlayerMoveMissed: ld a,[wMoveMissed] and a jr z,getPlayerAnimationType @@ -3373,7 +3373,7 @@ handleIfPlayerMoveMissed: ; 3d877 (f:5877) sub a,EXPLODE_EFFECT jr z,playPlayerMoveAnimation ; don't play any animation if the move missed, unless it was EXPLODE_EFFECT jr playerCheckIfFlyOrChargeEffect -getPlayerAnimationType: ; 3d87b (f:587b) +getPlayerAnimationType: ld a,[wPlayerMoveEffect] and a ld a,4 ; move has no effect other than dealing damage @@ -3412,7 +3412,7 @@ playerCheckIfFlyOrChargeEffect ; 3d8bd (f:58bd) ld [wAnimationType],a ld a,STATUS_AFFECTED_ANIM call PlayMoveAnimation -MirrorMoveCheck: ; 3d8d8 (f:58d8) +MirrorMoveCheck: ld a,[wPlayerMoveEffect] cp a,MIRROR_MOVE_EFFECT jr nz,.metronomeCheck @@ -3485,17 +3485,17 @@ MirrorMoveCheck: ; 3d8d8 (f:58d8) ; Responsible for executing Twineedle's second side effect (poison). jp ExecutePlayerMoveDone -MultiHitText: ; 3d977 (f:5977) +MultiHitText: TX_FAR _MultiHitText db "@" -ExecutePlayerMoveDone: ; 3d97c (f:597c) +ExecutePlayerMoveDone: xor a ld [wActionResultOrTookBattleTurn],a ld b,1 ret -PrintGhostText: ; 3d983 (f:5983) +PrintGhostText: ; print the ghost battle messages call IsGhostBattle ret nz @@ -3515,15 +3515,15 @@ PrintGhostText: ; 3d983 (f:5983) xor a ret -ScaredText: ; 3d9a2 (f:59a2) +ScaredText: TX_FAR _ScaredText db "@" -GetOutText: ; 3d9a7 (f:59a7) +GetOutText: TX_FAR _GetOutText db "@" -IsGhostBattle: ; 3d9ac (f:59ac) +IsGhostBattle: ld a,[wIsInBattle] dec a ret nz @@ -3542,7 +3542,7 @@ IsGhostBattle: ; 3d9ac (f:59ac) ; checks for various status conditions affecting the player mon ; stores whether the mon cannot use a move this turn in Z flag -CheckPlayerStatusConditions: ; 3d9c6 (f:59c6) +CheckPlayerStatusConditions: ld hl,wBattleMonStatus ld a,[hl] and a,SLP ; sleep mask @@ -3803,67 +3803,67 @@ CheckPlayerStatusConditions: ; 3d9c6 (f:59c6) and a ret -FastAsleepText: ; 3dbaf (f:5baf) +FastAsleepText: TX_FAR _FastAsleepText db "@" -WokeUpText: ; 3dbb4 (f:5bb4) +WokeUpText: TX_FAR _WokeUpText db "@" -IsFrozenText: ; 3dbb9 (f:5bb9) +IsFrozenText: TX_FAR _IsFrozenText db "@" -FullyParalyzedText: ; 3dbbe (f:5bbe) +FullyParalyzedText: TX_FAR _FullyParalyzedText db "@" -FlinchedText: ; 3dbc3 (f:5bc3) +FlinchedText: TX_FAR _FlinchedText db "@" -MustRechargeText: ; 3dbc8 (f:5bc8) +MustRechargeText: TX_FAR _MustRechargeText db "@" -DisabledNoMoreText: ; 3dbcd (f:5bcd) +DisabledNoMoreText: TX_FAR _DisabledNoMoreText db "@" -IsConfusedText: ; 3dbd2 (f:5bd2) +IsConfusedText: TX_FAR _IsConfusedText db "@" -HurtItselfText: ; 3dbd7 (f:5bd7) +HurtItselfText: TX_FAR _HurtItselfText db "@" -ConfusedNoMoreText: ; 3dbdc (f:5bdc) +ConfusedNoMoreText: TX_FAR _ConfusedNoMoreText db "@" -SavingEnergyText: ; 3dbe1 (f:5be1) +SavingEnergyText: TX_FAR _SavingEnergyText db "@" -UnleashedEnergyText: ; 3dbe6 (f:5be6) +UnleashedEnergyText: TX_FAR _UnleashedEnergyText db "@" -ThrashingAboutText: ; 3dbeb (f:5beb) +ThrashingAboutText: TX_FAR _ThrashingAboutText db "@" -AttackContinuesText: ; 3dbf0 (f:5bf0) +AttackContinuesText: TX_FAR _AttackContinuesText db "@" -CantMoveText: ; 3dbf5 (f:5bf5) +CantMoveText: TX_FAR _CantMoveText db "@" -PrintMoveIsDisabledText: ; 3dbfa (f:5bfa) +PrintMoveIsDisabledText: ld hl, wPlayerSelectedMove ld de, wPlayerBattleStatus1 ld a, [H_WHOSETURN] @@ -3881,11 +3881,11 @@ PrintMoveIsDisabledText: ; 3dbfa (f:5bfa) ld hl, MoveIsDisabledText jp PrintText -MoveIsDisabledText: ; 3dc1a (f:5c1a) +MoveIsDisabledText: TX_FAR _MoveIsDisabledText db "@" -HandleSelfConfusionDamage: ; 3dc1f (f:5c1f) +HandleSelfConfusionDamage: ld hl, HurtItselfText call PrintText ld hl, wEnemyMonDefense @@ -3929,7 +3929,7 @@ HandleSelfConfusionDamage: ; 3dc1f (f:5c1f) ld [H_WHOSETURN], a jp ApplyDamageToPlayerPokemon -PrintMonName1Text: ; 3dc67 (f:5c67) +PrintMonName1Text: ld hl, MonName1Text jp PrintText @@ -3938,7 +3938,7 @@ PrintMonName1Text: ; 3dc67 (f:5c67) ; those text strings are identical and both continue at PrintInsteadText ; this likely had to do with Japanese grammar that got translated, ; but the functionality didn't get removed -MonName1Text: ; 3dc6d (f:5c6d) +MonName1Text: TX_FAR _MonName1Text TX_ASM ld a, [H_WHOSETURN] @@ -3963,33 +3963,33 @@ MonName1Text: ; 3dc6d (f:5c6d) ld hl, Used1Text ret -Used1Text: ; 3dc9f (f:5c9f) +Used1Text: TX_FAR _Used1Text TX_ASM jr PrintInsteadText -Used2Text: ; 3dca6 (f:5ca6) +Used2Text: TX_FAR _Used2Text TX_ASM ; fall through -PrintInsteadText: ; 3dcab (f:5cab) +PrintInsteadText: ld a, [wMonIsDisobedient] and a jr z, PrintMoveName ld hl, InsteadText ret -InsteadText: ; 3dcb5 (f:5cb5) +InsteadText: TX_FAR _InsteadText TX_ASM ; fall through -PrintMoveName: ; 3dcba (f:5cba) +PrintMoveName: ld hl, _PrintMoveName ret -_PrintMoveName: ; 3dcbe (f:5cbe) +_PrintMoveName: TX_FAR _CF4BText TX_ASM ld hl, ExclamationPointPointerTable @@ -4005,30 +4005,30 @@ _PrintMoveName: ; 3dcbe (f:5cbe) ld l, a ret -ExclamationPointPointerTable: ; 3dcd4 (f:5cd4) +ExclamationPointPointerTable: dw ExclamationPoint1Text dw ExclamationPoint2Text dw ExclamationPoint3Text dw ExclamationPoint4Text dw ExclamationPoint5Text -ExclamationPoint1Text: ; 3dcde (f:5cde) +ExclamationPoint1Text: TX_FAR _ExclamationPoint1Text db "@" -ExclamationPoint2Text: ; 3dce3 (f:5ce3) +ExclamationPoint2Text: TX_FAR _ExclamationPoint2Text db "@" -ExclamationPoint3Text: ; 3dce8 (f:5ce8) +ExclamationPoint3Text: TX_FAR _ExclamationPoint3Text db "@" -ExclamationPoint4Text: ; 3dced (f:5ced) +ExclamationPoint4Text: TX_FAR _ExclamationPoint4Text db "@" -ExclamationPoint5Text: ; 3dcf2 (f:5cf2) +ExclamationPoint5Text: TX_FAR _ExclamationPoint5Text db "@" @@ -4039,7 +4039,7 @@ ExclamationPoint5Text: ; 3dcf2 (f:5cf2) ; but all five text strings are identical ; this likely had to do with Japanese grammar that got translated, ; but the functionality didn't get removed -DetermineExclamationPointTextNum: ; 3dcf7 (f:5cf7) +DetermineExclamationPointTextNum: push bc ld a, [wd11e] ; move ID ld c, a @@ -4061,7 +4061,7 @@ DetermineExclamationPointTextNum: ; 3dcf7 (f:5cf7) pop bc ret -ExclamationPointMoveSets: ; 3dd15 (f:5d15) +ExclamationPointMoveSets: ; a grammar mistake was fixed (only concerning japanese) ; BIDE is in category 3, moved from category 2 db SWORDS_DANCE, GROWTH @@ -4078,7 +4078,7 @@ ExclamationPointMoveSets: ; 3dd15 (f:5d15) db $00 db $FF ; terminator -PrintMoveFailureText: ; 3dd54 (f:5d54) +PrintMoveFailureText: ld de, wPlayerMoveEffect ld a, [H_WHOSETURN] and a @@ -4135,28 +4135,28 @@ PrintMoveFailureText: ; 3dd54 (f:5d54) .enemyTurn jp ApplyDamageToEnemyPokemon -AttackMissedText: ; 3ddb4 (f:5db4) +AttackMissedText: TX_FAR _AttackMissedText db "@" -KeptGoingAndCrashedText: ; 3ddb9 (f:5db9) +KeptGoingAndCrashedText: TX_FAR _KeptGoingAndCrashedText db "@" -UnaffectedText: ; 3ddbe (f:5dbe) +UnaffectedText: TX_FAR _UnaffectedText db "@" -PrintDoesntAffectText: ; 3ddc3 (f:5dc3) +PrintDoesntAffectText: ld hl, DoesntAffectMonText jp PrintText -DoesntAffectMonText: ; 3ddc9 (f:5dc9) +DoesntAffectMonText: TX_FAR _DoesntAffectMonText db "@" ; if there was a critical hit or an OHKO was successful, print the corresponding text -PrintCriticalOHKOText: ; 3ddce (f:5dce) +PrintCriticalOHKOText: ld a, [wCriticalHitOrOHKO] and a jr z, .done ; do nothing if there was no critical hit or successful OHKO @@ -4176,21 +4176,21 @@ PrintCriticalOHKOText: ; 3ddce (f:5dce) ld c, 20 jp DelayFrames -CriticalOHKOTextPointers: ; 3ddec (f:5dec) +CriticalOHKOTextPointers: dw CriticalHitText dw OHKOText -CriticalHitText: ; 3ddf0 (f:5df0) +CriticalHitText: TX_FAR _CriticalHitText db "@" -OHKOText: ; 3ddf5 (f:5df5) +OHKOText: TX_FAR _OHKOText db "@" ; checks if a traded mon will disobey due to lack of badges ; stores whether the mon will use a move in Z flag -CheckForDisobedience: ; 3ddfa (f:5dfa) +CheckForDisobedience: xor a ld [wMonIsDisobedient], a ld a, [wLinkState] @@ -4369,28 +4369,28 @@ CheckForDisobedience: ; 3ddfa (f:5dfa) xor a ; set Z flag ret -LoafingAroundText: ; 3df28 (f:5f28) +LoafingAroundText: TX_FAR _LoafingAroundText db "@" -BeganToNapText: ; 3df2d (f:5f2d) +BeganToNapText: TX_FAR _BeganToNapText db "@" -WontObeyText: ; 3df32 (f:5f32) +WontObeyText: TX_FAR _WontObeyText db "@" -TurnedAwayText: ; 3df37 (f:5f37) +TurnedAwayText: TX_FAR _TurnedAwayText db "@" -IgnoredOrdersText: ; 3df3c (f:5f3c) +IgnoredOrdersText: TX_FAR _IgnoredOrdersText db "@" ; sets b, c, d, and e for the CalculateDamage routine in the case of an attack by the player mon -GetDamageVarsForPlayerAttack: ; 3df41 (f:5f41) +GetDamageVarsForPlayerAttack: xor a ld hl, wDamage ; damage to eventually inflict, initialise to zero ldi [hl], a @@ -4503,7 +4503,7 @@ GetDamageVarsForPlayerAttack: ; 3df41 (f:5f41) ret ; sets b, c, d, and e for the CalculateDamage routine in the case of an attack by the enemy mon -GetDamageVarsForEnemyAttack: ; 3dfe7 (f:5fe7) +GetDamageVarsForEnemyAttack: ld hl, wDamage ; damage to eventually inflict, initialise to zero xor a ld [hli], a @@ -4618,7 +4618,7 @@ GetDamageVarsForEnemyAttack: ; 3dfe7 (f:5fe7) ; get stat c of enemy mon ; c: stat to get (HP=1,Attack=2,Defense=3,Speed=4,Special=5) -GetEnemyMonStat: ; 3e08e (f:608e) +GetEnemyMonStat: push de push bc ld a, [wLinkState] @@ -4659,7 +4659,7 @@ GetEnemyMonStat: ; 3e08e (f:608e) pop de ret -CalculateDamage: ; 3d0d7 (f:60d7) +CalculateDamage: ; input: ; b: attack ; c: opponent defense @@ -4821,14 +4821,14 @@ CalculateDamage: ; 3d0d7 (f:60d7) and a ret -JumpToOHKOMoveEffect: ; 3e188 (f:6188) +JumpToOHKOMoveEffect: call JumpMoveEffect ld a, [wMoveMissed] dec a ret -UnusedHighCriticalMoves: ; 3e190 (f:6190) +UnusedHighCriticalMoves: db KARATE_CHOP db RAZOR_LEAF db CRABHAMMER @@ -4839,7 +4839,7 @@ UnusedHighCriticalMoves: ; 3e190 (f:6190) ; determines if attack is a critical hit ; azure heights claims "the fastest pokémon (who are, not coincidentally, ; among the most popular) tend to CH about 20 to 25% of the time." -CriticalHitTest: ; 3e195 (f:6195) +CriticalHitTest: xor a ld [wCriticalHitOrOHKO], a ld a, [H_WHOSETURN] @@ -4906,7 +4906,7 @@ CriticalHitTest: ; 3e195 (f:6195) ret ; high critical hit moves -HighCriticalMoves: ; 3e200 (f:6200) +HighCriticalMoves: db KARATE_CHOP db RAZOR_LEAF db CRABHAMMER @@ -4915,7 +4915,7 @@ HighCriticalMoves: ; 3e200 (f:6200) ; function to determine if Counter hits and if so, how much damage it does -HandleCounterMove: ; 3e205 (f:6205) +HandleCounterMove: ; The variables checked by Counter are updated whenever the cursor points to a new move in the battle selection menu. ; This is irrelevant for the opponent's side outside of link battles, since the move selection is controlled by the AI. ; However, in the scenario where the player switches out and the opponent uses Counter, @@ -4980,7 +4980,7 @@ HandleCounterMove: ; 3e205 (f:6205) xor a ret -ApplyAttackToEnemyPokemon: ; 3e251 (f:6251) +ApplyAttackToEnemyPokemon: ld a,[wPlayerMoveEffect] cp a,OHKO_EFFECT jr z,ApplyDamageToEnemyPokemon @@ -5046,7 +5046,7 @@ ApplyAttackToEnemyPokemon: ; 3e251 (f:6251) ld a,b ld [hl],a -ApplyDamageToEnemyPokemon: ; 3e2b4 (f:62b4) +ApplyDamageToEnemyPokemon: ld hl,wDamage ld a,[hli] ld b,a @@ -5096,10 +5096,10 @@ ApplyDamageToEnemyPokemon: ; 3e2b4 (f:62b4) xor a ld [wHPBarType],a predef UpdateHPBar2 ; animate the HP bar shortening -ApplyAttackToEnemyPokemonDone: ; 3e30f (f:630f) +ApplyAttackToEnemyPokemonDone: jp DrawHUDsAndHPBars -ApplyAttackToPlayerPokemon: ; 3e312 (f:6312) +ApplyAttackToPlayerPokemon: ld a,[wEnemyMoveEffect] cp a,OHKO_EFFECT jr z,ApplyDamageToPlayerPokemon @@ -5165,7 +5165,7 @@ ApplyAttackToPlayerPokemon: ; 3e312 (f:6312) ld a,b ld [hl],a -ApplyDamageToPlayerPokemon: ; 3e372 (f:6372) +ApplyDamageToPlayerPokemon: ld hl,wDamage ld a,[hli] ld b,a @@ -5214,10 +5214,10 @@ ApplyDamageToPlayerPokemon: ; 3e372 (f:6372) ld a,$01 ld [wHPBarType],a predef UpdateHPBar2 ; animate the HP bar shortening -ApplyAttackToPlayerPokemonDone: ; 3e3cd (f:63cd) +ApplyAttackToPlayerPokemonDone: jp DrawHUDsAndHPBars -AttackSubstitute: ; 3e3d0 (f:63d0) +AttackSubstitute: ; Unlike the two ApplyAttackToPokemon functions, Attack Substitute is shared by player and enemy. ; Self-confusion damage as well as Hi-Jump Kick and Jump Kick recoil cause a momentary turn swap before being applied. ; If the user has a Substitute up and would take damage because of that, @@ -5272,16 +5272,16 @@ AttackSubstitute: ; 3e3d0 (f:63d0) ld [hl],a ; zero the effect of the attacker's move jp DrawHUDsAndHPBars -SubstituteTookDamageText: ; 3e41e (f:641e) +SubstituteTookDamageText: TX_FAR _SubstituteTookDamageText db "@" -SubstituteBrokeText: ; 3e423 (f:6423) +SubstituteBrokeText: TX_FAR _SubstituteBrokeText db "@" ; this function raises the attack modifier of a pokemon using Rage when that pokemon is attacked -HandleBuildingRage: ; 3e428 (f:6428) +HandleBuildingRage: ; values for the player turn ld hl,wEnemyBattleStatus2 ld de,wEnemyMonStatMods @@ -5323,13 +5323,13 @@ HandleBuildingRage: ; 3e428 (f:6428) ld [H_WHOSETURN],a ret -BuildingRageText: ; 3e46a (f:646a) +BuildingRageText: TX_FAR _BuildingRageText db "@" ; copy last move for Mirror Move ; sets zero flag on failure and unsets zero flag on success -MirrorMoveCopyMove: ; 3e46f (f:646f) +MirrorMoveCopyMove: ; Mirror Move makes use of ccf1 (wPlayerUsedMove) and ccf2 (wEnemyUsedMove) addresses, ; which are mainly used to print the "[Pokemon] used [Move]" text. ; Both are set to 0 whenever a new Pokemon is sent out @@ -5359,12 +5359,12 @@ MirrorMoveCopyMove: ; 3e46f (f:646f) xor a ret -MirrorMoveFailedText: ; 3e496 (f:6496) +MirrorMoveFailedText: TX_FAR _MirrorMoveFailedText db "@" ; function used to reload move data for moves like Mirror Move and Metronome -ReloadMoveData: ; 3e49b (f:649b) +ReloadMoveData: ld [wd11e],a dec a ld hl,Moves @@ -5381,7 +5381,7 @@ ReloadMoveData: ; 3e49b (f:649b) ret ; function that picks a random move for metronome -MetronomePickMove: ; 3e4ba (f:64ba) +MetronomePickMove: xor a ld [wAnimationType],a ld a,METRONOME @@ -5410,7 +5410,7 @@ MetronomePickMove: ; 3e4ba (f:64ba) ; this function increments the current move's PP ; it's used to prevent moves that run another move within the same turn ; (like Mirror Move and Metronome) from losing 2 PP -IncrementMovePP: ; 3e4e5 (f:64e5) +IncrementMovePP: ld a,[H_WHOSETURN] and a ; values for player turn @@ -5442,7 +5442,7 @@ IncrementMovePP: ; 3e4e5 (f:64e5) ret ; function to adjust the base damage of an attack to account for type effectiveness -AdjustDamageForMoveType: ; 3e517 (f:6517) +AdjustDamageForMoveType: ; values for player turn ld hl,wBattleMonType ld a,[hli] @@ -5555,7 +5555,7 @@ AdjustDamageForMoveType: ; 3e517 (f:6517) .done ret -AIGetTypeEffectiveness: ; 3e5bb (f:65bb) +AIGetTypeEffectiveness: ld a,[wEnemyMoveType] ld d,a ; d = type of enemy move ld hl,wBattleMonType @@ -5602,7 +5602,7 @@ AIGetTypeEffectiveness: ; 3e5bb (f:65bb) INCLUDE "data/type_effects.asm" ; some tests that need to pass for a move to hit -MoveHitTest: ; 3e6f1 (f:66f1) +MoveHitTest: ; player's turn ld hl,wEnemyBattleStatus1 ld de,wPlayerMoveEffect @@ -5722,7 +5722,7 @@ MoveHitTest: ; 3e6f1 (f:66f1) ret ; values for player turn -CalcHitChance: ; 3e7aa (f:67aa) +CalcHitChance: ld hl,wPlayerMoveAccuracy ld a,[H_WHOSETURN] and a @@ -5794,7 +5794,7 @@ CalcHitChance: ; 3e7aa (f:67aa) ret ; multiplies damage by a random percentage from ~85% to 100% -RandomizeDamage: ; 3e80d (f:680d) +RandomizeDamage: ld hl, wDamage ld a, [hli] and a @@ -5831,7 +5831,7 @@ RandomizeDamage: ; 3e80d (f:680d) ret ; for more detailed commentary, see equivalent function for player side (ExecutePlayerMove) -ExecuteEnemyMove: ; 3e842 (f:6842) +ExecuteEnemyMove: ld a, [wEnemySelectedMove] inc a jp z, ExecuteEnemyMoveDone @@ -5863,14 +5863,14 @@ ExecuteEnemyMove: ; 3e842 (f:6842) jr nz, EnemyCanExecuteChargingMove ; if so, jump call GetCurrentMove -CheckIfEnemyNeedsToChargeUp: ; 3e882 (f:6882) +CheckIfEnemyNeedsToChargeUp: ld a, [wEnemyMoveEffect] cp CHARGE_EFFECT jp z, JumpMoveEffect cp FLY_EFFECT jp z, JumpMoveEffect jr EnemyCanExecuteMove -EnemyCanExecuteChargingMove: ; 3e891 (f:6891) +EnemyCanExecuteChargingMove: ld hl, wEnemyBattleStatus1 res ChargingUp, [hl] ; no longer charging up for attack res Invulnerable, [hl] ; no longer invulnerable to typical attacks @@ -5883,7 +5883,7 @@ EnemyCanExecuteChargingMove: ; 3e891 (f:6891) call GetName ld de, wcd6d call CopyStringToCF4B -EnemyCanExecuteMove: ; 3e8b1 (f:68b1) +EnemyCanExecuteMove: xor a ld [wMonIsDisobedient], a call PrintMonName1Text @@ -5897,7 +5897,7 @@ EnemyCanExecuteMove: ; 3e8b1 (f:68b1) ld de, $1 call IsInArray call c, JumpMoveEffect -EnemyCalcMoveDamage: ; 3e8d6 (f:68d6) +EnemyCalcMoveDamage: call SwapPlayerAndEnemyLevels ld a, [wEnemyMoveEffect] ld hl, SetDamageEffects @@ -5915,9 +5915,9 @@ EnemyCalcMoveDamage: ; 3e8d6 (f:68d6) call AdjustDamageForMoveType call RandomizeDamage -EnemyMoveHitTest: ; 3e905 (f:6905) +EnemyMoveHitTest: call MoveHitTest -handleIfEnemyMoveMissed: ; 3e908 (f:6908) +handleIfEnemyMoveMissed: ld a, [wMoveMissed] and a jr z, .moveDidNotMiss @@ -5928,17 +5928,17 @@ handleIfEnemyMoveMissed: ; 3e908 (f:6908) .moveDidNotMiss call SwapPlayerAndEnemyLevels -GetEnemyAnimationType: ; 3e91a (f:691a) +GetEnemyAnimationType: ld a, [wEnemyMoveEffect] and a ld a, $1 jr z, playEnemyMoveAnimation ld a, $2 jr playEnemyMoveAnimation -handleExplosionMiss: ; 3e926 (f:6926) +handleExplosionMiss: call SwapPlayerAndEnemyLevels xor a -playEnemyMoveAnimation: ; 3e92a (f:692a) +playEnemyMoveAnimation: push af ld a, [wEnemyBattleStatus2] bit HasSubstituteUp, a ; does mon have a substitute? @@ -5958,7 +5958,7 @@ playEnemyMoveAnimation: ; 3e92a (f:692a) call nz, Bankswitch ; slide the substitute's sprite out jr EnemyCheckIfMirrorMoveEffect -EnemyCheckIfFlyOrChargeEffect: ; 3e957 (f:6957) +EnemyCheckIfFlyOrChargeEffect: call SwapPlayerAndEnemyLevels ld c, 30 call DelayFrames @@ -5973,7 +5973,7 @@ EnemyCheckIfFlyOrChargeEffect: ; 3e957 (f:6957) ld [wAnimationType], a ld a,STATUS_AFFECTED_ANIM call PlayMoveAnimation -EnemyCheckIfMirrorMoveEffect: ; 3e975 (f:6975) +EnemyCheckIfMirrorMoveEffect: ld a, [wEnemyMoveEffect] cp MIRROR_MOVE_EFFECT jr nz, .notMirrorMoveEffect @@ -6040,17 +6040,17 @@ EnemyCheckIfMirrorMoveEffect: ; 3e975 (f:6975) call nc, JumpMoveEffect jr ExecuteEnemyMoveDone -HitXTimesText: ; 3ea0d (f:6a0d) +HitXTimesText: TX_FAR _HitXTimesText db "@" -ExecuteEnemyMoveDone: ; 3ea12 (f:6a12) +ExecuteEnemyMoveDone: ld b, $1 ret ; checks for various status conditions affecting the enemy mon ; stores whether the mon cannot use a move this turn in Z flag -CheckEnemyStatusConditions: ; 3ea15 (f:6a15) +CheckEnemyStatusConditions: ld hl, wEnemyMonStatus ld a, [hl] and SLP ; sleep mask @@ -6332,7 +6332,7 @@ CheckEnemyStatusConditions: ; 3ea15 (f:6a15) and a ; clear Z flag ret -GetCurrentMove: ; 3ec44 (f:6c44) +GetCurrentMove: ld a, [H_WHOSETURN] and a jp z, .player @@ -6363,7 +6363,7 @@ GetCurrentMove: ; 3ec44 (f:6c44) ld de, wcd6d jp CopyStringToCF4B -LoadEnemyMonData: ; 3ec87 (f:6c87) +LoadEnemyMonData: ld a, [wLinkState] cp LINK_STATE_BATTLING jp z, LoadEnemyMonFromParty @@ -6523,7 +6523,7 @@ LoadEnemyMonData: ; 3ec87 (f:6c87) ret ; calls BattleTransition to show the battle transition animation and initializes some battle variables -DoBattleTransitionAndInitBattleVariables: ; 3edb8 (f:6db8) +DoBattleTransitionAndInitBattleVariables: ld a, [wLinkState] cp LINK_STATE_BATTLING jr nz, .next @@ -6559,7 +6559,7 @@ DoBattleTransitionAndInitBattleVariables: ; 3edb8 (f:6db8) ret ; swaps the level values of the BattleMon and EnemyMon structs -SwapPlayerAndEnemyLevels: ; 3ee07 (f:6e07) +SwapPlayerAndEnemyLevels: push bc ld a, [wBattleMonLevel] ld b, a @@ -6573,7 +6573,7 @@ SwapPlayerAndEnemyLevels: ; 3ee07 (f:6e07) ; loads either red back pic or old man back pic ; also writes OAM data and loads tile patterns for the Red or Old Man back sprite's head ; (for use when scrolling the player sprite and enemy's silhouettes on screen) -LoadPlayerBackPic: ; 3ee18 (f:6e18) +LoadPlayerBackPic: ld a, [wBattleType] ld de, OldManPic cp BATTLE_TYPE_OLD_MAN ; is it the old man tutorial? @@ -6636,26 +6636,26 @@ LoadPlayerBackPic: ; 3ee18 (f:6e18) predef_jump CopyUncompressedPicToTilemap ; does nothing since no stats are ever selected (barring glitches) -DoubleOrHalveSelectedStats: ; 3ee8e (f:6e8e) +DoubleOrHalveSelectedStats: callab DoubleSelectedStats jpab HalveSelectedStats -ScrollTrainerPicAfterBattle: ; 3ee9e (f:6e9e) +ScrollTrainerPicAfterBattle: jpab _ScrollTrainerPicAfterBattle -ApplyBurnAndParalysisPenaltiesToPlayer: ; 3eea6 (f:6ea6) +ApplyBurnAndParalysisPenaltiesToPlayer: ld a, $1 jr ApplyBurnAndParalysisPenalties -ApplyBurnAndParalysisPenaltiesToEnemy: ; 3eeaa (f:6eaa) +ApplyBurnAndParalysisPenaltiesToEnemy: xor a -ApplyBurnAndParalysisPenalties: ; 3eeab (f:6eab) +ApplyBurnAndParalysisPenalties: ld [H_WHOSETURN], a call QuarterSpeedDueToParalysis jp HalveAttackDueToBurn -QuarterSpeedDueToParalysis: ; 3eeb3 (f:6eb3) +QuarterSpeedDueToParalysis: ld a, [H_WHOSETURN] and a jr z, .playerTurn @@ -6698,7 +6698,7 @@ QuarterSpeedDueToParalysis: ; 3eeb3 (f:6eb3) ld [hl], b ret -HalveAttackDueToBurn: ; 3eeef (f:6eef) +HalveAttackDueToBurn: ld a, [H_WHOSETURN] and a jr z, .playerTurn @@ -6737,7 +6737,7 @@ HalveAttackDueToBurn: ; 3eeef (f:6eef) ld [hl], b ret -CalculateModifiedStats: ; 3ef25 (f:6f25) +CalculateModifiedStats: ld c, 0 .loop call CalculateModifiedStat @@ -6748,7 +6748,7 @@ CalculateModifiedStats: ; 3ef25 (f:6f25) ret ; calculate modified stat for stat c (0 = attack, 1 = defense, 2 = speed, 3 = special) -CalculateModifiedStat: ; 3ef31 (f:6f31) +CalculateModifiedStat: push bc push bc ld a, [wCalculateWhoseStats] @@ -6826,7 +6826,7 @@ CalculateModifiedStat: ; 3ef31 (f:6f31) pop bc ret -ApplyBadgeStatBoosts: ; 3efa5 (f:6fa5) +ApplyBadgeStatBoosts: ld a, [wLinkState] cp LINK_STATE_BATTLING ret z ; return if link battle @@ -6879,10 +6879,10 @@ ApplyBadgeStatBoosts: ; 3efa5 (f:6fa5) ld [hld], a ret -LoadHudAndHpBarAndStatusTilePatterns: ; 3efe4 (f:6fe4) +LoadHudAndHpBarAndStatusTilePatterns: call LoadHpBarAndStatusTilePatterns -LoadHudTilePatterns: ; 3efe7 (f:6fe7) +LoadHudTilePatterns: ld a, [rLCDC] add a ; is LCD disabled? jr c, .lcdEnabled @@ -6907,14 +6907,14 @@ LoadHudTilePatterns: ; 3efe7 (f:6fe7) lb bc, BANK(BattleHudTiles2), (BattleHudTiles3End - BattleHudTiles2) / $8 jp CopyVideoDataDouble -PrintEmptyString: ; 3f020 (f:7020) +PrintEmptyString: ld hl, .emptyString jp PrintText .emptyString db "@" -BattleRandom: ; 3f027 (f:7027) +BattleRandom: ; Link battles use a shared PRNG. ld a, [wLinkState] @@ -6966,7 +6966,7 @@ BattleRandom: ; 3f027 (f:7027) ret -HandleExplodingAnimation: ; 3f05f (f:705f) +HandleExplodingAnimation: ld a, [H_WHOSETURN] and a ld hl, wEnemyMonType1 @@ -6997,19 +6997,19 @@ HandleExplodingAnimation: ; 3f05f (f:705f) ld a, 5 ld [wAnimationType], a -PlayMoveAnimation: ; 3f093 (f:7093) +PlayMoveAnimation: ld [wAnimationID],a call Delay3 predef MoveAnimation callab Func_78e98 ret -JumpMoveEffect: ; 3f0a7 (f:70a7) +JumpMoveEffect: call _JumpMoveEffect ld b, $1 ret -_JumpMoveEffect: ; 3f0ad (f:70ad) +_JumpMoveEffect: ld a, [H_WHOSETURN] and a ld a, [wPlayerMoveEffect] @@ -7027,7 +7027,7 @@ _JumpMoveEffect: ; 3f0ad (f:70ad) ld l, a jp [hl] ; jump to special effect handler -MoveEffectPointerTable: ; 3f0c5 (f:70c5) +MoveEffectPointerTable: dw SleepEffect ; unused effect dw PoisonEffect ; POISON_SIDE_EFFECT1 dw DrainHPEffect ; DRAIN_HP_EFFECT @@ -7115,7 +7115,7 @@ MoveEffectPointerTable: ; 3f0c5 (f:70c5) dw SplashEffect ; SPLASH_EFFECT dw DisableEffect ; DISABLE_EFFECT -SleepEffect: ; 3f171 (f:7171) +SleepEffect: ld de, wEnemyMonStatus ld bc, wEnemyBattleStatus2 ld a, [H_WHOSETURN] @@ -7169,7 +7169,7 @@ SleepEffect: ; 3f171 (f:7171) .didntAffect jp PrintDidntAffectText -FellAsleepText: ; 3f1c8 (f:71c8) +FellAsleepText: TX_FAR _FellAsleepText db "@" @@ -7177,7 +7177,7 @@ AlreadyAsleepText: ; 3f1cd (f:71cds) TX_FAR _AlreadyAsleepText db "@" -PoisonEffect: ; 3f1d2 (f:71d2) +PoisonEffect: ld hl, wEnemyMonStatus ld de, wPlayerMoveEffect ld a, [H_WHOSETURN] @@ -7263,18 +7263,18 @@ PoisonEffect: ; 3f1d2 (f:71d2) call DelayFrames jp PrintDidntAffectText -PoisonedText: ; 3f262 (f:7262) +PoisonedText: TX_FAR _PoisonedText db "@" -BadlyPoisonedText: ; 3f267 (f:7267) +BadlyPoisonedText: TX_FAR _BadlyPoisonedText db "@" -DrainHPEffect: ; 3f26c (f:726c) +DrainHPEffect: jpab DrainHPEffect_ -ExplodeEffect: ; 3f274 (f:7274) +ExplodeEffect: ld hl, wBattleMonHP ld de, wPlayerBattleStatus2 ld a, [H_WHOSETURN] @@ -7293,7 +7293,7 @@ ExplodeEffect: ; 3f274 (f:7274) ld [de], a ret -FreezeBurnParalyzeEffect: ; 3f28f (f:728f) +FreezeBurnParalyzeEffect: xor a ld [wAnimationType], a call CheckTargetSubstitute ; test bit 4 of d063/d068 flags [target has substitute flag] @@ -7424,15 +7424,15 @@ FreezeBurnParalyzeEffect: ; 3f28f (f:728f) ld hl, FrozenText jp PrintText -BurnedText: ; 3f38e (f:738e) +BurnedText: TX_FAR _BurnedText db "@" -FrozenText: ; 3f393 (f:7393) +FrozenText: TX_FAR _FrozenText db "@" -CheckDefrost: ; 3f398 (f:7398) +CheckDefrost: ; any fire-type move that has a chance inflict burn (all but Fire Spin) will defrost a frozen target and a, 1 << FRZ ; are they frozen? ret z ; return if so @@ -7467,11 +7467,11 @@ CheckDefrost: ; 3f398 (f:7398) .common jp PrintText -FireDefrostedText: ; 3f3d9 (f:73d9) +FireDefrostedText: TX_FAR _FireDefrostedText db "@" -StatModifierUpEffect: ; 3f3de (f:73de) +StatModifierUpEffect: ld hl, wPlayerMonStatMods ld de, wPlayerMoveEffect ld a, [H_WHOSETURN] @@ -7570,13 +7570,13 @@ StatModifierUpEffect: ; 3f3de (f:73de) ld a, 999 % $100 ld [H_MULTIPLICAND + 2], a -UpdateStat: ; 3f479 (f:7479) +UpdateStat: ld a, [H_PRODUCT + 2] ld [hli], a ld a, [H_PRODUCT + 3] ld [hl], a pop hl -UpdateStatDone: ; 3f480 (f:7480) +UpdateStatDone: ld b, c inc b call PrintStatText @@ -7627,15 +7627,15 @@ UpdateStatDone: ; 3f480 (f:7480) call QuarterSpeedDueToParalysis ; apply speed penalty to the player whose turn is not, if it's paralyzed jp HalveAttackDueToBurn ; apply attack penalty to the player whose turn is not, if it's burned -RestoreOriginalStatModifier: ; 3f4d6 (f:74d6) +RestoreOriginalStatModifier: pop hl dec [hl] -PrintNothingHappenedText: ; 3f4d8 (f:74d8) +PrintNothingHappenedText: ld hl, NothingHappenedText jp PrintText -MonsStatsRoseText: ; 3f4de (f:74de) +MonsStatsRoseText: TX_FAR _MonsStatsRoseText TX_ASM ld hl, GreatlyRoseText @@ -7650,15 +7650,15 @@ MonsStatsRoseText: ; 3f4de (f:74de) ld hl, RoseText ret -GreatlyRoseText: ; 3f4f8 (f:74f8) +GreatlyRoseText: db $0a TX_FAR _GreatlyRoseText ; fallthrough -RoseText: ; 3f4fd (f:74fd) +RoseText: TX_FAR _RoseText db "@" -StatModifierDownEffect: ; 3f502 (f:7502) +StatModifierDownEffect: ld hl, wEnemyMonStatMods ld de, wPlayerMoveEffect ld bc, wEnemyBattleStatus1 @@ -7788,14 +7788,14 @@ StatModifierDownEffect: ; 3f502 (f:7502) ld a, $1 ld [H_MULTIPLICAND + 2], a -UpdateLoweredStat: ; 3f5da (f:75da) +UpdateLoweredStat: ld a, [H_PRODUCT + 2] ld [hli], a ld a, [H_PRODUCT + 3] ld [hl], a pop de pop hl -UpdateLoweredStatDone: ; 3f5e2 (f:75e2) +UpdateLoweredStatDone: ld b, c inc b push de @@ -7819,25 +7819,25 @@ UpdateLoweredStatDone: ; 3f5e2 (f:75e2) call QuarterSpeedDueToParalysis jp HalveAttackDueToBurn -CantLowerAnymore_Pop: ; 3f603 (f:7603) +CantLowerAnymore_Pop: pop de pop hl inc [hl] -CantLowerAnymore: ; 3f606 (f:7606) +CantLowerAnymore: ld a, [de] cp ATTACK_DOWN_SIDE_EFFECT ret nc ld hl, NothingHappenedText jp PrintText -MoveMissed: ; 3f610 (f:7610) +MoveMissed: ld a, [de] cp $44 ret nc jp ConditionalPrintButItFailed -MonsStatsFellText: ; 3f617 (f:7617) +MonsStatsFellText: TX_FAR _MonsStatsFellText TX_ASM ld hl, FellText @@ -7855,15 +7855,15 @@ MonsStatsFellText: ; 3f617 (f:7617) ld hl, GreatlyFellText ret -GreatlyFellText: ; 3f634 (f:7634) +GreatlyFellText: db $0a TX_FAR _GreatlyFellText ; fallthrough -FellText: ; 3f639 (f:7639) +FellText: TX_FAR _FellText db "@" -PrintStatText: ; 3f63e (f:763e) +PrintStatText: ld hl, StatsTextStrings ld c, "@" .findStatName_outer @@ -7879,7 +7879,7 @@ PrintStatText: ; 3f63e (f:763e) ld bc, $a jp CopyData -StatsTextStrings: ; 3f655 (f:7655) +StatsTextStrings: db "ATTACK@" db "DEFENSE@" db "SPEED@" @@ -7887,7 +7887,7 @@ StatsTextStrings: ; 3f655 (f:7655) db "ACCURACY@" db "EVADE@" -StatModifierRatios: ; 3f681 (f:7681) +StatModifierRatios: ; first byte is numerator, second byte is denominator db 25, 100 ; 0.25 db 28, 100 ; 0.28 @@ -7903,7 +7903,7 @@ StatModifierRatios: ; 3f681 (f:7681) db 35, 10 ; 3.50 db 4, 1 ; 4.00 -BideEffect: ; 3f69b (f:769b) +BideEffect: ld hl, wPlayerBattleStatus1 ld de, wPlayerBideAccumulatedDamage ld bc, wPlayerNumAttacksLeft @@ -7930,7 +7930,7 @@ BideEffect: ; 3f69b (f:769b) add XSTATITEM_ANIM jp PlayBattleAnimation2 -ThrashPetalDanceEffect: ; 3f7cd (f:77cd) +ThrashPetalDanceEffect: ld hl, wPlayerBattleStatus1 ld de, wPlayerNumAttacksLeft ld a, [H_WHOSETURN] @@ -7949,7 +7949,7 @@ ThrashPetalDanceEffect: ; 3f7cd (f:77cd) add ANIM_B0 jp PlayBattleAnimation2 -SwitchAndTeleportEffect: ; 3f6ef (f:76ef) +SwitchAndTeleportEffect: ld a, [H_WHOSETURN] and a jr nz, .handleEnemy @@ -8053,19 +8053,19 @@ SwitchAndTeleportEffect: ; 3f6ef (f:76ef) .printText jp PrintText -RanFromBattleText: ; 3f7b8 (f:77b8) +RanFromBattleText: TX_FAR _RanFromBattleText db "@" -RanAwayScaredText: ; 3f7bd (f:77bd) +RanAwayScaredText: TX_FAR _RanAwayScaredText db "@" -WasBlownAwayText: ; 3f7c2 (f:77c2) +WasBlownAwayText: TX_FAR _WasBlownAwayText db "@" -TwoToFiveAttacksEffect: ; 3f7c7 (f:77c7) +TwoToFiveAttacksEffect: ld hl, wPlayerBattleStatus1 ld de, wPlayerNumAttacksLeft ld bc, wPlayerNumHits @@ -8111,7 +8111,7 @@ TwoToFiveAttacksEffect: ; 3f7c7 (f:77c7) ld [hl], a ; set Twineedle's effect to poison effect jr .saveNumberOfHits -FlinchSideEffect: ; 3f811 (f:7811) +FlinchSideEffect: call CheckTargetSubstitute ret nz ld hl, wEnemyBattleStatus1 @@ -8138,10 +8138,10 @@ FlinchSideEffect: ; 3f811 (f:7811) call ClearHyperBeam ret -OneHitKOEffect: ; 3f842 (f:7842) +OneHitKOEffect: jpab OneHitKOEffect_ -ChargeEffect: ; 3f84a (f:784a) +ChargeEffect: ld hl, wPlayerBattleStatus1 ld de, wPlayerMoveEffect ld a, [H_WHOSETURN] @@ -8192,7 +8192,7 @@ ChargeEffect: ; 3f84a (f:784a) ld hl, ChargeMoveEffectText jp PrintText -ChargeMoveEffectText: ; 3f8a3 (f:78a3) +ChargeMoveEffectText: TX_FAR _ChargeMoveEffectText TX_ASM ld a, [wChargeMoveNum] @@ -8216,31 +8216,31 @@ ChargeMoveEffectText: ; 3f8a3 (f:78a3) .gotText ret -MadeWhirlwindText: ; 3f8d4 (f:78d4) +MadeWhirlwindText: TX_FAR _MadeWhirlwindText db "@" -TookInSunlightText: ; 3f8d9 (f:78d9) +TookInSunlightText: TX_FAR _TookInSunlightText db "@" -LoweredItsHeadText: ; 3f8de (f:78de) +LoweredItsHeadText: TX_FAR _LoweredItsHeadText db "@" -SkyAttackGlowingText: ; 3f8e3 (f:78e3) +SkyAttackGlowingText: TX_FAR _SkyAttackGlowingText db "@" -FlewUpHighText: ; 3f8e8 (f:78e8) +FlewUpHighText: TX_FAR _FlewUpHighText db "@" -DugAHoleText: ; 3f8ed (f:78ed) +DugAHoleText: TX_FAR _DugAHoleText db "@" -TrappingEffect: ; 3f8f2 (f:78f2) +TrappingEffect: ld hl, wPlayerBattleStatus1 ld de, wPlayerNumAttacksLeft ld a, [H_WHOSETURN] @@ -8265,22 +8265,22 @@ TrappingEffect: ; 3f8f2 (f:78f2) ld [de], a ret -MistEffect: ; 3f91c (f:791c) +MistEffect: jpab MistEffect_ -FocusEnergyEffect: ; 3f924 (f:7924) +FocusEnergyEffect: jpab FocusEnergyEffect_ -RecoilEffect: ; 3f92c (f:792c) +RecoilEffect: jpab RecoilEffect_ -ConfusionSideEffect: ; 3f934 (f:7934) +ConfusionSideEffect: call BattleRandom cp $19 ; ~10% chance ret nc jr ConfusionSideEffectSuccess -ConfusionEffect: ; 3f93c (f:793c) +ConfusionEffect: call CheckTargetSubstitute jr nz, ConfusionEffectFailed call MoveHitTest @@ -8288,7 +8288,7 @@ ConfusionEffect: ; 3f93c (f:793c) and a jr nz, ConfusionEffectFailed -ConfusionSideEffectSuccess: ; 3f94a (f:794a) +ConfusionSideEffectSuccess: ld a, [H_WHOSETURN] and a ld hl, wEnemyBattleStatus1 @@ -8314,24 +8314,24 @@ ConfusionSideEffectSuccess: ; 3f94a (f:794a) ld hl, BecameConfusedText jp PrintText -BecameConfusedText: ; 3f97c (f:797c) +BecameConfusedText: TX_FAR _BecameConfusedText db "@" -ConfusionEffectFailed: ; 3f981 (f:7981) +ConfusionEffectFailed: cp CONFUSION_SIDE_EFFECT ret z ld c, 50 call DelayFrames jp ConditionalPrintButItFailed -ParalyzeEffect: ; 3f98c (f:798c) +ParalyzeEffect: jpab ParalyzeEffect_ -SubstituteEffect: ; 3f994 (f:7994) +SubstituteEffect: jpab SubstituteEffect_ -HyperBeamEffect: ; 3f99c (f:799c) +HyperBeamEffect: ld hl, wPlayerBattleStatus2 ld a, [H_WHOSETURN] and a @@ -8341,7 +8341,7 @@ HyperBeamEffect: ; 3f99c (f:799c) set NeedsToRecharge, [hl] ; mon now needs to recharge ret -ClearHyperBeam: ; 3f9aa (f:79aa) +ClearHyperBeam: push hl ld hl, wEnemyBattleStatus2 ld a, [H_WHOSETURN] @@ -8353,7 +8353,7 @@ ClearHyperBeam: ; 3f9aa (f:79aa) pop hl ret -RageEffect: ; 3f9ba (f:79ba) +RageEffect: ld hl, wPlayerBattleStatus2 ld a, [H_WHOSETURN] and a @@ -8363,7 +8363,7 @@ RageEffect: ; 3f9ba (f:79ba) set UsingRage, [hl] ; mon is now in "rage" mode ret -MimicEffect: ; 3f9c8 (f:79c8) +MimicEffect: ld c, 50 call DelayFrames call MoveHitTest @@ -8435,18 +8435,18 @@ MimicEffect: ; 3f9c8 (f:79c8) .mimicMissed jp PrintButItFailedText_ -MimicLearnedMoveText: ; 3fa52 (f:7a52) +MimicLearnedMoveText: TX_FAR _MimicLearnedMoveText db "@" -LeechSeedEffect: ; 3fa57 (f:7a57) +LeechSeedEffect: jpab LeechSeedEffect_ -SplashEffect: ; 3fa5f (f:7a5f) +SplashEffect: call PlayCurrentMoveAnimation jp PrintNoEffectText -DisableEffect: ; 3fa65 (f:7a65) +DisableEffect: call MoveHitTest ld a, [wMoveMissed] and a @@ -8529,74 +8529,74 @@ DisableEffect: ; 3fa65 (f:7a65) .moveMissed jp PrintButItFailedText_ -MoveWasDisabledText: ; 3fae4 (f:7ae4) +MoveWasDisabledText: TX_FAR _MoveWasDisabledText db "@" -PayDayEffect: ; 3fae9 (f:7ae9) +PayDayEffect: jpab PayDayEffect_ -ConversionEffect: ; 3faf1 (f:7af1) +ConversionEffect: jpab ConversionEffect_ -HazeEffect: ; 3faf9 (f:7af9) +HazeEffect: jpab HazeEffect_ -HealEffect: ; 3fb01 (f:7b01) +HealEffect: jpab HealEffect_ -TransformEffect: ; 3fb09 (f:7b09) +TransformEffect: jpab TransformEffect_ -ReflectLightScreenEffect: ; 3fb11 (f:7b11) +ReflectLightScreenEffect: jpab ReflectLightScreenEffect_ -NothingHappenedText: ; 3fb19 (f:7b19) +NothingHappenedText: TX_FAR _NothingHappenedText db "@" -PrintNoEffectText: ; 3fb1e (f:7b1e) +PrintNoEffectText: ld hl, NoEffectText jp PrintText -NoEffectText: ; 3fb24 (f:7b24) +NoEffectText: TX_FAR _NoEffectText db "@" -ConditionalPrintButItFailed: ; 3fb29 (f:7b29) +ConditionalPrintButItFailed: ld a, [wMoveDidntMiss] and a ret nz ; return if the side effect failed, yet the attack was successful -PrintButItFailedText_: ; 3fb2e (f:7b2e) +PrintButItFailedText_: ld hl, ButItFailedText jp PrintText -ButItFailedText: ; 3fb34 (f:7b34) +ButItFailedText: TX_FAR _ButItFailedText db "@" -PrintDidntAffectText: ; 3fb39 (f:7b39) +PrintDidntAffectText: ld hl, DidntAffectText jp PrintText -DidntAffectText: ; 3fb3f (f:7b3f) +DidntAffectText: TX_FAR _DidntAffectText db "@" -IsUnaffectedText: ; 3fb44 (f:7b44) +IsUnaffectedText: TX_FAR _IsUnaffectedText db "@" -PrintMayNotAttackText: ; 3fb49 (f:7b49) +PrintMayNotAttackText: ld hl, ParalyzedMayNotAttackText jp PrintText -ParalyzedMayNotAttackText: ; 3fb4f (f:7b4f) +ParalyzedMayNotAttackText: TX_FAR _ParalyzedMayNotAttackText db "@" -CheckTargetSubstitute: ; 3fb54 (f:7b54) +CheckTargetSubstitute: push hl ld hl, wEnemyBattleStatus2 ld a, [H_WHOSETURN] @@ -8608,7 +8608,7 @@ CheckTargetSubstitute: ; 3fb54 (f:7b54) pop hl ret -PlayCurrentMoveAnimation2: ; 3fb64 (f:7b64) +PlayCurrentMoveAnimation2: ; animation at MOVENUM will be played unless MOVENUM is 0 ; plays wAnimationType 3 or 6 ld a, [H_WHOSETURN] @@ -8620,7 +8620,7 @@ PlayCurrentMoveAnimation2: ; 3fb64 (f:7b64) and a ret z -PlayBattleAnimation2: ; 3fb71 (f:7b71) +PlayBattleAnimation2: ; play animation ID at a and animation type 6 or 3 ld [wAnimationID], a ld a, [H_WHOSETURN] @@ -8632,7 +8632,7 @@ PlayBattleAnimation2: ; 3fb71 (f:7b71) ld [wAnimationType], a jp PlayBattleAnimationGotID -PlayCurrentMoveAnimation: ; 3fb83 (f:7b83) +PlayCurrentMoveAnimation: ; animation at MOVENUM will be played unless MOVENUM is 0 ; resets wAnimationType xor a @@ -8646,11 +8646,11 @@ PlayCurrentMoveAnimation: ; 3fb83 (f:7b83) and a ret z -PlayBattleAnimation: ; 3fb94 (f:7b94) +PlayBattleAnimation: ; play animation ID at a and predefined animation type ld [wAnimationID], a -PlayBattleAnimationGotID: ; 3fb97 (f:7b97) +PlayBattleAnimationGotID: ; play animation at wAnimationID push hl push de @@ -8660,4 +8660,4 @@ PlayBattleAnimationGotID: ; 3fb97 (f:7b97) pop bc pop de pop hl - ret
\ No newline at end of file + ret diff --git a/engine/battle/decrement_pp.asm b/engine/battle/decrement_pp.asm index da1910ee..fd1a3184 100644 --- a/engine/battle/decrement_pp.asm +++ b/engine/battle/decrement_pp.asm @@ -1,4 +1,4 @@ -DecrementPP: ; f42db (3d:42db) +DecrementPP: ; after using a move, decrement pp in battle and (if not transformed?) in party ld a, [de] cp a, STRUGGLE diff --git a/engine/battle/display_effectiveness.asm b/engine/battle/display_effectiveness.asm index 1ef9873c..85f2bc3e 100644 --- a/engine/battle/display_effectiveness.asm +++ b/engine/battle/display_effectiveness.asm @@ -1,4 +1,4 @@ -DisplayEffectiveness: ; 2fd25 (b:7d25) +DisplayEffectiveness: ld a, [wDamageMultipliers] and a, $7F cp a, $0A @@ -9,10 +9,10 @@ DisplayEffectiveness: ; 2fd25 (b:7d25) .done jp PrintText -SuperEffectiveText: ; 2fd38 (b:7d38) +SuperEffectiveText: TX_FAR _SuperEffectiveText db "@" -NotVeryEffectiveText: ; 2fd3d (b:7d3d) +NotVeryEffectiveText: TX_FAR _NotVeryEffectiveText db "@" diff --git a/engine/battle/draw_hud_pokeball_gfx.asm b/engine/battle/draw_hud_pokeball_gfx.asm index f9db556d..8f9dce46 100644 --- a/engine/battle/draw_hud_pokeball_gfx.asm +++ b/engine/battle/draw_hud_pokeball_gfx.asm @@ -1,4 +1,4 @@ -DrawAllPokeballs: ; 3a8df (e:68df) +DrawAllPokeballs: call LoadPartyPokeballGfx call SetupOwnPartyPokeballs ld a, [wIsInBattle] @@ -6,17 +6,17 @@ DrawAllPokeballs: ; 3a8df (e:68df) ret z ; return if wild pokémon jp SetupEnemyPartyPokeballs -DrawEnemyPokeballs: ; 3a8ed (e:68ed) +DrawEnemyPokeballs: call LoadPartyPokeballGfx jp SetupEnemyPartyPokeballs -LoadPartyPokeballGfx: ; 3a8f3 (e:68f3) +LoadPartyPokeballGfx: ld de, PokeballTileGraphics ld hl, vSprites + $310 lb bc, BANK(PokeballTileGraphics), (PokeballTileGraphicsEnd - PokeballTileGraphics) / $10 jp CopyVideoData -SetupOwnPartyPokeballs: ; 3a8ff (e:68ff) +SetupOwnPartyPokeballs: call PlacePlayerHUDTiles ld hl, wPartyMon1 ld de, wPartyCount @@ -32,7 +32,7 @@ SetupOwnPartyPokeballs: ; 3a8ff (e:68ff) ld hl, wOAMBuffer jp WritePokeballOAMData -SetupEnemyPartyPokeballs: ; 3a921 (e:6921) +SetupEnemyPartyPokeballs: call PlaceEnemyHUDTiles ld hl, wEnemyMons ld de, wEnemyPartyCount @@ -48,7 +48,7 @@ SetupEnemyPartyPokeballs: ; 3a921 (e:6921) ld hl, wOAMBuffer + PARTY_LENGTH * 4 jp WritePokeballOAMData -SetupPokeballs: ; 3a945 (e:6945) +SetupPokeballs: ld a, [de] push af ld de, wBuffer @@ -70,7 +70,7 @@ SetupPokeballs: ; 3a945 (e:6945) jr nz, .monloop ret -PickPokeball: ; 3a961 (e:6961) +PickPokeball: inc hl ld a, [hli] and a @@ -98,7 +98,7 @@ PickPokeball: ; 3a961 (e:6961) add hl, bc ; next mon struct ret -WritePokeballOAMData: ; 3a980 (e:6980) +WritePokeballOAMData: ld de, wBuffer ld c, PARTY_LENGTH .loop @@ -120,7 +120,7 @@ WritePokeballOAMData: ; 3a980 (e:6980) jr nz, .loop ret -PlacePlayerHUDTiles: ; 3a9a3 (e:69a3) +PlacePlayerHUDTiles: ld hl, PlayerBattleHUDGraphicsTiles ld de, wHUDGraphicsTiles ld bc, $3 @@ -129,13 +129,13 @@ PlacePlayerHUDTiles: ; 3a9a3 (e:69a3) ld de, -1 jr PlaceHUDTiles -PlayerBattleHUDGraphicsTiles: ; 3a9b7 (e:69b7) +PlayerBattleHUDGraphicsTiles: ; The tile numbers for specific parts of the battle display for the player's pokemon db $73 ; unused ($73 is hardcoded into the routine that uses these bytes) db $77 ; lower-right corner tile of the HUD db $6F ; lower-left triangle tile of the HUD -PlaceEnemyHUDTiles: ; 3a9ba (e:69ba) +PlaceEnemyHUDTiles: ld hl, EnemyBattleHUDGraphicsTiles ld de, wHUDGraphicsTiles ld bc, $3 @@ -144,13 +144,13 @@ PlaceEnemyHUDTiles: ; 3a9ba (e:69ba) ld de, $1 jr PlaceHUDTiles -EnemyBattleHUDGraphicsTiles: ; 3a9ce (e:69ce) +EnemyBattleHUDGraphicsTiles: ; The tile numbers for specific parts of the battle display for the enemy db $73 ; unused ($73 is hardcoded in the routine that uses these bytes) db $74 ; lower-left corner tile of the HUD db $78 ; lower-right triangle tile of the HUD -PlaceHUDTiles: ; 3a9d1 (e:69d1) +PlaceHUDTiles: ld [hl], $73 ld bc, SCREEN_WIDTH add hl, bc @@ -167,7 +167,7 @@ PlaceHUDTiles: ; 3a9d1 (e:69d1) ld [hl], a ret -SetupPlayerAndEnemyPokeballs: ; 3a9e9 (e:69e9) +SetupPlayerAndEnemyPokeballs: call LoadPartyPokeballGfx ld hl, wPartyMons ld de, wPartyCount @@ -195,6 +195,6 @@ SetupPlayerAndEnemyPokeballs: ; 3a9e9 (e:69e9) jp WritePokeballOAMData ; four tiles: pokeball, black pokeball (status ailment), crossed out pokeball (faited) and pokeball slot (no mon) -PokeballTileGraphics:: ; 3aa28 (e:6a28) +PokeballTileGraphics:: INCBIN "gfx/pokeball.2bpp" PokeballTileGraphicsEnd: diff --git a/engine/battle/end_of_battle.asm b/engine/battle/end_of_battle.asm index f4c99e3d..47c9fa5d 100755 --- a/engine/battle/end_of_battle.asm +++ b/engine/battle/end_of_battle.asm @@ -1,4 +1,4 @@ -EndOfBattle: ; 13765 (4:7765) +EndOfBattle: ld a, [wLinkState] cp LINK_STATE_BATTLING jr nz, .notLinkBattle @@ -78,15 +78,15 @@ EndOfBattle: ; 13765 (4:7765) ld [wDestinationWarpID], a ret -YouWinText: ; 1381d (4:781d) +YouWinText: db "YOU WIN@" -YouLoseText: ; 13825 (4:7825) +YouLoseText: db "YOU LOSE@" -DrawText: ; 1382e (4:782e) +DrawText: db " DRAW@" -PickUpPayDayMoneyText: ; 13835 (4:7835) +PickUpPayDayMoneyText: TX_FAR _PickUpPayDayMoneyText db "@" diff --git a/engine/battle/experience.asm b/engine/battle/experience.asm index f43a7354..9946c6c6 100644 --- a/engine/battle/experience.asm +++ b/engine/battle/experience.asm @@ -1,4 +1,4 @@ -GainExperience: ; 5524f (15:525f) +GainExperience: ld a, [wLinkState] cp LINK_STATE_BATTLING ret z ; return if link battle @@ -297,7 +297,7 @@ GainExperience: ; 5524f (15:525f) predef_jump FlagActionPredef ; set the fought current enemy flag for the mon that is currently out ; divide enemy base stats, catch rate, and base exp by the number of mons gaining exp -DivideExpDataByNumMonsGainingExp: ; 5547b (15:547b) +DivideExpDataByNumMonsGainingExp: ld a, [wPartyGainExpFlags] ld b, a xor a @@ -331,7 +331,7 @@ DivideExpDataByNumMonsGainingExp: ; 5547b (15:547b) ret ; multiplies exp by 1.5 -BoostExp: ; 554ae (15:54ae) +BoostExp: ld a, [H_QUOTIENT + 2] ld b, a ld a, [H_QUOTIENT + 3] @@ -345,11 +345,11 @@ BoostExp: ; 554ae (15:54ae) ld [H_QUOTIENT + 2], a ret -Bankswitch15ToF: ; 554c1 (15:54c1) +Bankswitch15ToF: ld b, BANK(BattleCore) jp Bankswitch -GainedText: ; 554c6 (15:54c6) +GainedText: TX_FAR _GainedText TX_ASM ld a, [wBoostExpByExpAll] @@ -363,20 +363,20 @@ GainedText: ; 554c6 (15:54c6) ld hl, BoostedText ret -WithExpAllText: ; 554df (15:54df) +WithExpAllText: TX_FAR _WithExpAllText TX_ASM ld hl, ExpPointsText ret -BoostedText: ; 554e8 (15:54e8) +BoostedText: TX_FAR _BoostedText -ExpPointsText: ; 554ec (15:54ec) +ExpPointsText: TX_FAR _ExpPointsText db "@" -GrewLevelText: ; 554f1 (15:54f1) +GrewLevelText: TX_FAR _GrewLevelText db $0b db "@" diff --git a/engine/battle/get_trainer_name.asm b/engine/battle/get_trainer_name.asm index cacf7ee8..e051a02a 100644 --- a/engine/battle/get_trainer_name.asm +++ b/engine/battle/get_trainer_name.asm @@ -1,4 +1,4 @@ -GetTrainerName_: ; f67a5 (3d:67a5) +GetTrainerName_: ld hl, wGrassRate ld a, [wLinkState] and a diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm index d61e5fec..5bb3e308 100644 --- a/engine/battle/ghost_marowak_anim.asm +++ b/engine/battle/ghost_marowak_anim.asm @@ -1,4 +1,4 @@ -MarowakAnim: ; 7092b (1c:492b) +MarowakAnim: ; animate the ghost being unveiled as a Marowak ld a, $e4 ld [rOBP1], a @@ -52,7 +52,7 @@ MarowakAnim: ; 7092b (1c:492b) jp ClearSprites ; copies a mon pic's from background VRAM to sprite VRAM and sets up OAM -CopyMonPicFromBGToSpriteVRAM: ; 70994 (1c:4994) +CopyMonPicFromBGToSpriteVRAM: ld de, vFrontPic ld hl, vSprites ld bc, 7 * 7 diff --git a/engine/battle/init_battle_variables.asm b/engine/battle/init_battle_variables.asm index 74ea3814..bdd5d8f4 100644 --- a/engine/battle/init_battle_variables.asm +++ b/engine/battle/init_battle_variables.asm @@ -1,4 +1,4 @@ -InitBattleVariables: ; f6236 (3d:6236) +InitBattleVariables: ld a, [hTilesetType] ld [wSavedTilesetType], a xor a diff --git a/engine/battle/link_battle_versus_text.asm b/engine/battle/link_battle_versus_text.asm index 9849cc9a..5edf13e6 100644 --- a/engine/battle/link_battle_versus_text.asm +++ b/engine/battle/link_battle_versus_text.asm @@ -1,5 +1,5 @@ ; display "[player] VS [enemy]" text box with pokeballs representing their parties next to the names -DisplayLinkBattleVersusTextBox: ; f41cf (3d:41cf) +DisplayLinkBattleVersusTextBox: call LoadTextBoxTilePatterns coord hl, 3, 4 ld bc, $70c diff --git a/engine/battle/moveEffects/conversion_effect.asm b/engine/battle/moveEffects/conversion_effect.asm index 5965f2a8..9c347876 100644 --- a/engine/battle/moveEffects/conversion_effect.asm +++ b/engine/battle/moveEffects/conversion_effect.asm @@ -1,4 +1,4 @@ -ConversionEffect_: ; 1396d (4:796d) +ConversionEffect_: ld hl, wEnemyMonType1 ld de, wBattleMonType1 ld a, [H_WHOSETURN] @@ -24,12 +24,12 @@ ConversionEffect_: ; 1396d (4:796d) ld hl, ConvertedTypeText jp PrintText -ConvertedTypeText: ; 13997 (4:7997) +ConvertedTypeText: TX_FAR _ConvertedTypeText db "@" -PrintButItFailedText: ; 1399c (4:799c) +PrintButItFailedText: ld hl, PrintButItFailedText_ -CallBankF: ; 1399f (4:799f) +CallBankF: ld b, BANK(PrintButItFailedText_) jp Bankswitch diff --git a/engine/battle/moveEffects/drain_hp_effect.asm b/engine/battle/moveEffects/drain_hp_effect.asm index 2af286a8..e5f4681a 100644 --- a/engine/battle/moveEffects/drain_hp_effect.asm +++ b/engine/battle/moveEffects/drain_hp_effect.asm @@ -1,4 +1,4 @@ -DrainHPEffect_: ; 76e7 (1:76e7) +DrainHPEffect_: ld hl, wDamage ld a, [hl] srl a ; divide damage by 2 @@ -95,10 +95,10 @@ DrainHPEffect_: ; 76e7 (1:76e7) .printText jp PrintText -SuckedHealthText: ; 7784 (1:7784) +SuckedHealthText: TX_FAR _SuckedHealthText db "@" -DreamWasEatenText: ; 7789 (1:7789) +DreamWasEatenText: TX_FAR _DreamWasEatenText db "@" diff --git a/engine/battle/moveEffects/focus_energy_effect.asm b/engine/battle/moveEffects/focus_energy_effect.asm index e7f30794..9ba0ade0 100644 --- a/engine/battle/moveEffects/focus_energy_effect.asm +++ b/engine/battle/moveEffects/focus_energy_effect.asm @@ -1,4 +1,4 @@ -FocusEnergyEffect_: ; f628b (3d:628b) +FocusEnergyEffect_: ld hl, wPlayerBattleStatus2 ld a, [H_WHOSETURN] and a @@ -16,7 +16,7 @@ FocusEnergyEffect_: ; f628b (3d:628b) call DelayFrames jpab PrintButItFailedText_ -GettingPumpedText: ; f62b5 (3d:62b5) +GettingPumpedText: db $0a TX_FAR _GettingPumpedText db "@" diff --git a/engine/battle/moveEffects/haze_effect.asm b/engine/battle/moveEffects/haze_effect.asm index eec68182..bd20f231 100644 --- a/engine/battle/moveEffects/haze_effect.asm +++ b/engine/battle/moveEffects/haze_effect.asm @@ -1,4 +1,4 @@ -HazeEffect_: ; 139a4 (4:79a4) +HazeEffect_: ld a, $7 ; store 7 on every stat mod ld hl, wPlayerMonAttackMod @@ -45,7 +45,7 @@ HazeEffect_: ; 139a4 (4:79a4) ld hl, StatusChangesEliminatedText jp PrintText -CureVolatileStatuses: ; 13a01 (4:7a01) +CureVolatileStatuses: ; only cures statuses of the Pokemon not using Haze res Confused, [hl] inc hl ; BATTSTATUS2 @@ -58,7 +58,7 @@ CureVolatileStatuses: ; 13a01 (4:7a01) ld [hl], a ret -ResetStatMods: ; 13a0d (4:7a0d) +ResetStatMods: ld b, $8 .loop ld [hli], a @@ -66,7 +66,7 @@ ResetStatMods: ; 13a0d (4:7a0d) jr nz, .loop ret -ResetStats: ; 13a14 (4:7a14) +ResetStats: ld b, $8 .loop ld a, [hli] @@ -76,6 +76,6 @@ ResetStats: ; 13a14 (4:7a14) jr nz, .loop ret -StatusChangesEliminatedText: ; 13a1d (4:7a1d) +StatusChangesEliminatedText: TX_FAR _StatusChangesEliminatedText db "@" diff --git a/engine/battle/moveEffects/heal_effect.asm b/engine/battle/moveEffects/heal_effect.asm index 418f7df7..377c14c4 100644 --- a/engine/battle/moveEffects/heal_effect.asm +++ b/engine/battle/moveEffects/heal_effect.asm @@ -1,4 +1,4 @@ -HealEffect_: ; f62ba (3d:62ba) +HealEffect_: ld a, [H_WHOSETURN] and a ld de, wBattleMonHP @@ -107,14 +107,14 @@ HealEffect_: ; f62ba (3d:62ba) ld hl, PrintButItFailedText_ jp Bankswitch3DtoF -StartedSleepingEffect: ; f6370 (3d:6370) +StartedSleepingEffect: TX_FAR _StartedSleepingEffect db "@" -FellAsleepBecameHealthyText: ; f6375 (3d:6375) +FellAsleepBecameHealthyText: TX_FAR _FellAsleepBecameHealthyText db "@" -RegainedHealthText: ; f637a (3d:637a) +RegainedHealthText: TX_FAR _RegainedHealthText db "@" diff --git a/engine/battle/moveEffects/leech_seed_effect.asm b/engine/battle/moveEffects/leech_seed_effect.asm index ef649ff6..0f3a2666 100644 --- a/engine/battle/moveEffects/leech_seed_effect.asm +++ b/engine/battle/moveEffects/leech_seed_effect.asm @@ -1,4 +1,4 @@ -LeechSeedEffect_: ; 2bdba (a:7dba) +LeechSeedEffect_: callab MoveHitTest ld a, [wMoveMissed] and a @@ -31,10 +31,10 @@ LeechSeedEffect_: ; 2bdba (a:7dba) ld hl, EvadedAttackText jp PrintText -WasSeededText: ; 2be03 (a:7e03) +WasSeededText: TX_FAR _WasSeededText db "@" -EvadedAttackText: ; 2be08 (a:7e08) +EvadedAttackText: TX_FAR _EvadedAttackText db "@" diff --git a/engine/battle/moveEffects/mist_effect.asm b/engine/battle/moveEffects/mist_effect.asm index 022606bb..b92777de 100644 --- a/engine/battle/moveEffects/mist_effect.asm +++ b/engine/battle/moveEffects/mist_effect.asm @@ -1,4 +1,4 @@ -MistEffect_: ; f64ac (3d:64ac) +MistEffect_: ld hl, wPlayerBattleStatus2 ld a, [H_WHOSETURN] and a @@ -14,6 +14,6 @@ MistEffect_: ; f64ac (3d:64ac) .mistAlreadyInUse jpab PrintButItFailedText_ -ShroudedInMistText: ; f64d3 (3d:64d3) +ShroudedInMistText: TX_FAR _ShroudedInMistText db "@" diff --git a/engine/battle/moveEffects/one_hit_ko_effect.asm b/engine/battle/moveEffects/one_hit_ko_effect.asm index a60d573a..827e2197 100644 --- a/engine/battle/moveEffects/one_hit_ko_effect.asm +++ b/engine/battle/moveEffects/one_hit_ko_effect.asm @@ -1,4 +1,4 @@ -OneHitKOEffect_: ; f64db (3d:64db) +OneHitKOEffect_: ld hl, wDamage xor a ld [hli], a diff --git a/engine/battle/moveEffects/paralyze_effect.asm b/engine/battle/moveEffects/paralyze_effect.asm index 5cec6b02..95979ae6 100644 --- a/engine/battle/moveEffects/paralyze_effect.asm +++ b/engine/battle/moveEffects/paralyze_effect.asm @@ -1,4 +1,4 @@ -ParalyzeEffect_: ; f6562 (3d:6562) +ParalyzeEffect_: ld hl, wEnemyMonStatus ld de, wPlayerMoveType ld a, [H_WHOSETURN] diff --git a/engine/battle/moveEffects/pay_day_effect.asm b/engine/battle/moveEffects/pay_day_effect.asm index 0236e3e4..e5daf014 100644 --- a/engine/battle/moveEffects/pay_day_effect.asm +++ b/engine/battle/moveEffects/pay_day_effect.asm @@ -1,4 +1,4 @@ -PayDayEffect_: ; f6511 (3d:6511) +PayDayEffect_: xor a ld hl, wcd6d ld [hli], a @@ -40,6 +40,6 @@ PayDayEffect_: ; f6511 (3d:6511) ld hl, CoinsScatteredText jp PrintText -CoinsScatteredText: ; f655d (3d:655d) +CoinsScatteredText: TX_FAR _CoinsScatteredText db "@" diff --git a/engine/battle/moveEffects/recoil_effect.asm b/engine/battle/moveEffects/recoil_effect.asm index d65696e2..7fc90c44 100644 --- a/engine/battle/moveEffects/recoil_effect.asm +++ b/engine/battle/moveEffects/recoil_effect.asm @@ -1,4 +1,4 @@ -RecoilEffect_: ; 138f6 (4:78f6) +RecoilEffect_: ld a, [H_WHOSETURN] and a ld a, [wPlayerMoveNum] @@ -65,6 +65,6 @@ RecoilEffect_: ; 138f6 (4:78f6) predef UpdateHPBar2 ld hl, HitWithRecoilText jp PrintText -HitWithRecoilText: ; 13968 (4:7968) +HitWithRecoilText: TX_FAR _HitWithRecoilText db "@" diff --git a/engine/battle/moveEffects/reflect_light_screen_effect.asm b/engine/battle/moveEffects/reflect_light_screen_effect.asm index 1c2db0a0..f2165956 100644 --- a/engine/battle/moveEffects/reflect_light_screen_effect.asm +++ b/engine/battle/moveEffects/reflect_light_screen_effect.asm @@ -1,4 +1,4 @@ -ReflectLightScreenEffect_: ; f645d (3d:645d) +ReflectLightScreenEffect_: ld hl, wPlayerBattleStatus3 ld de, wPlayerMoveEffect ld a, [H_WHOSETURN] @@ -32,14 +32,14 @@ ReflectLightScreenEffect_: ; f645d (3d:645d) ld hl, PrintButItFailedText_ jp Bankswitch3DtoF -LightScreenProtectedText: ; f649d (3d:649d) +LightScreenProtectedText: TX_FAR _LightScreenProtectedText db "@" -ReflectGainedArmorText: ; f64a2 (3d:64a2) +ReflectGainedArmorText: TX_FAR _ReflectGainedArmorText db "@" -Bankswitch3DtoF: ; f64a7 (3d:64a7) +Bankswitch3DtoF: ld b, BANK(BattleCore) jp Bankswitch diff --git a/engine/battle/moveEffects/substitute_effect.asm b/engine/battle/moveEffects/substitute_effect.asm index a4cd0264..03314ebf 100644 --- a/engine/battle/moveEffects/substitute_effect.asm +++ b/engine/battle/moveEffects/substitute_effect.asm @@ -1,4 +1,4 @@ -SubstituteEffect_: ; 17c31 (5:7c31) +SubstituteEffect_: ld c, 50 call DelayFrames ld hl, wBattleMonMaxHP @@ -64,14 +64,14 @@ SubstituteEffect_: ; 17c31 (5:7c31) .printText jp PrintText -SubstituteText: ; 17ca1 (5:7ca1) +SubstituteText: TX_FAR _SubstituteText db "@" -HasSubstituteText: ; 17ca6 (5:7ca6) +HasSubstituteText: TX_FAR _HasSubstituteText db "@" -TooWeakSubstituteText: ; 17cab (5:7cab) +TooWeakSubstituteText: TX_FAR _TooWeakSubstituteText db "@" diff --git a/engine/battle/moveEffects/transform_effect.asm b/engine/battle/moveEffects/transform_effect.asm index d77f43a3..2906de11 100644 --- a/engine/battle/moveEffects/transform_effect.asm +++ b/engine/battle/moveEffects/transform_effect.asm @@ -1,4 +1,4 @@ -TransformEffect_: ; f637f (3d:637f) +TransformEffect_: ld hl, wBattleMonSpecies ld de, wEnemyMonSpecies ld bc, wEnemyBattleStatus3 @@ -136,6 +136,6 @@ TransformEffect_: ; f637f (3d:637f) ld hl, PrintButItFailedText_ jp Bankswitch3DtoF -TransformedText: ; f6458 (3d:6458) +TransformedText: TX_FAR _TransformedText db "@" diff --git a/engine/battle/print_type.asm b/engine/battle/print_type.asm index 7b581905..f717f871 100644 --- a/engine/battle/print_type.asm +++ b/engine/battle/print_type.asm @@ -1,6 +1,6 @@ ; [wd0b5] = pokemon ID ; hl = dest addr -PrintMonType: ; 27d20 (9:7d20) +PrintMonType: call GetPredefRegisters push hl call GetMonHeader @@ -19,25 +19,25 @@ PrintMonType: ; 27d20 (9:7d20) ; a = type ; hl = dest addr -PrintType: ; 27d3e (9:7d3e) +PrintType: push hl jr PrintType_ ; erase "TYPE2/" if the mon only has 1 type -EraseType2Text: ; 27d41 (9:7d41) +EraseType2Text: ld a, " " ld bc, $13 add hl, bc ld bc, $6 jp FillMemory -PrintMoveType: ; 27d4d (9:7d4d) +PrintMoveType: call GetPredefRegisters push hl ld a, [wPlayerMoveType] ; fall through -PrintType_: ; 27d54 (9:7d54) +PrintType_: add a ld hl, TypeNames ld e, a diff --git a/engine/battle/read_trainer_party.asm b/engine/battle/read_trainer_party.asm index a4843417..3f10a85d 100755 --- a/engine/battle/read_trainer_party.asm +++ b/engine/battle/read_trainer_party.asm @@ -1,4 +1,4 @@ -ReadTrainer: ; 39bb6 (e:5bb6) +ReadTrainer: ; don't change any moves in a link battle ld a,[wLinkState] diff --git a/engine/battle/safari_zone.asm b/engine/battle/safari_zone.asm index 69439199..c6c0fa80 100755 --- a/engine/battle/safari_zone.asm +++ b/engine/battle/safari_zone.asm @@ -1,4 +1,4 @@ -PrintSafariZoneBattleText: ; 4111 (1:4111) +PrintSafariZoneBattleText: ld hl, wSafariBaitFactor ld a, [hl] and a @@ -27,10 +27,10 @@ PrintSafariZoneBattleText: ; 4111 (1:4111) pop hl jp PrintText -SafariZoneEatingText: ; 4141 (1:4141) +SafariZoneEatingText: TX_FAR _SafariZoneEatingText db "@" -SafariZoneAngryText: ; 4146 (1:4146) +SafariZoneAngryText: TX_FAR _SafariZoneAngryText db "@" diff --git a/engine/battle/save_trainer_name.asm b/engine/battle/save_trainer_name.asm index 227dbbcb..7e2c911c 100644 --- a/engine/battle/save_trainer_name.asm +++ b/engine/battle/save_trainer_name.asm @@ -1,4 +1,4 @@ -SaveTrainerName: ; 27dff (9:7dff) +SaveTrainerName: ld hl,TrainerNamePointers ld a,[wTrainerClass] dec a @@ -18,7 +18,7 @@ SaveTrainerName: ; 27dff (9:7dff) jr nz,.CopyCharacter ret -TrainerNamePointers: ; 27e19 (9:7e19) +TrainerNamePointers: ; what is the point of these? dw YoungsterName dw BugCatcherName @@ -68,45 +68,45 @@ TrainerNamePointers: ; 27e19 (9:7e19) dw wTrainerName dw wTrainerName -YoungsterName: ; 27e77 (9:7e77) +YoungsterName: db "YOUNGSTER@" -BugCatcherName: ; 27e81 (9:7e81) +BugCatcherName: db "BUG CATCHER@" -LassName: ; 27e8d (9:7e8d) +LassName: db "LASS@" -JrTrainerMName: ; 27e92 (9:7e92) +JrTrainerMName: db "JR.TRAINER♂@" -JrTrainerFName: ; 27e9e (9:7e9e) +JrTrainerFName: db "JR.TRAINER♀@" -PokemaniacName: ; 27eaa (9:7eaa) +PokemaniacName: db "POKéMANIAC@" -SuperNerdName: ; 27eb5 (9:7eb5) +SuperNerdName: db "SUPER NERD@" -BurglarName: ; 27ec0 (9:7ec0) +BurglarName: db "BURGLAR@" -EngineerName: ; 27ec8 (9:7ec8) +EngineerName: db "ENGINEER@" -JugglerXName: ; 27ed1 (9:7ed1) +JugglerXName: db "JUGGLER@" -SwimmerName: ; 27ed9 (9:7ed9) +SwimmerName: db "SWIMMER@" -BeautyName: ; 27ee1 (9:7ee1) +BeautyName: db "BEAUTY@" -RockerName: ; 27ee8 (9:7ee8) +RockerName: db "ROCKER@" -JugglerName: ; 27eef (9:7eef) +JugglerName: db "JUGGLER@" -BlackbeltName: ; 27ef7 (9:7ef7) +BlackbeltName: db "BLACKBELT@" -ProfOakName: ; 27f01 (9:7f01) +ProfOakName: db "PROF.OAK@" -ChiefName: ; 27f0a (9:7f0a) +ChiefName: db "CHIEF@" -ScientistName: ; 27f10 (9:7f10) +ScientistName: db "SCIENTIST@" -RocketName: ; 27f1a (9:7f1a) +RocketName: db "ROCKET@" -CooltrainerMName: ; 27f21 (9:7f21) +CooltrainerMName: db "COOLTRAINER♂@" -CooltrainerFName: ; 27f2e (9:7f2e) +CooltrainerFName: db "COOLTRAINER♀@" diff --git a/engine/battle/scale_sprites.asm b/engine/battle/scale_sprites.asm index c829fa13..c614d638 100644 --- a/engine/battle/scale_sprites.asm +++ b/engine/battle/scale_sprites.asm @@ -1,14 +1,14 @@ ; scales both uncompressed sprite chunks by two in every dimension (creating 2x2 output pixels per input pixel) ; assumes that input sprite chunks are 4x4 tiles, and the rightmost and bottommost 4 pixels will be ignored ; resulting in a 7*7 tile output sprite chunk -ScaleSpriteByTwo: ; 2fd79 (b:7d79) +ScaleSpriteByTwo: ld a, $0 call SwitchSRAMBankAndLatchClockData call ScaleSpriteByTwo_ call PrepareRTCDataAndDisableSRAM ret -ScaleSpriteByTwo_: ; 2fd85 (b:7d85) +ScaleSpriteByTwo_: ld de, sSpriteBuffer1 + (4*4*8) - 5 ; last byte of input data, last 4 rows already skipped ld hl, sSpriteBuffer0 + SPRITEBUFFERSIZE - 1 ; end of destination buffer call ScaleLastSpriteColumnByTwo ; last tile column is special case @@ -17,7 +17,7 @@ ScaleSpriteByTwo_: ; 2fd85 (b:7d85) ld hl, sSpriteBuffer1 + SPRITEBUFFERSIZE - 1 ; end of destination buffer call ScaleLastSpriteColumnByTwo ; last tile column is special case -ScaleFirstThreeSpriteColumnsByTwo: ; 2fd9a (b:7d9a) +ScaleFirstThreeSpriteColumnsByTwo: ld b, $3 ; 3 tile columns .columnLoop ld c, 4*8 - 4 ; $1c, 4 tiles minus 4 unused rows @@ -46,7 +46,7 @@ ScaleFirstThreeSpriteColumnsByTwo: ; 2fd9a (b:7d9a) jr nz, .columnLoop ret -ScaleLastSpriteColumnByTwo: ; 2fdc2 (b:7dc2) +ScaleLastSpriteColumnByTwo: ld a, 4*8 - 4 ; $1c, 4 tiles minus 4 unused rows ld [H_SPRITEINTERLACECOUNTER], a ld bc, -1 @@ -68,7 +68,7 @@ ScaleLastSpriteColumnByTwo: ; 2fdc2 (b:7dc2) ; scales the given 4 bits in a (4x1 pixels) to 2 output bytes (8x2 pixels) ; hl: destination pointer ; bc: destination pointer offset (added after the two bytes have been written) -ScalePixelsByTwo: ; 2fddc (b:7ddc) +ScalePixelsByTwo: push hl and $f ld hl, DuplicateBitsTable @@ -85,7 +85,7 @@ ScalePixelsByTwo: ; 2fddc (b:7ddc) ret ; repeats each input bit twice -DuplicateBitsTable: ; 2fded (b:7ded) +DuplicateBitsTable: db $00, $03, $0c, $0f db $30, $33, $3c, $3f db $c0, $c3, $cc, $cf diff --git a/engine/battle/scroll_draw_trainer_pic.asm b/engine/battle/scroll_draw_trainer_pic.asm index 8e65c973..98893dcf 100644 --- a/engine/battle/scroll_draw_trainer_pic.asm +++ b/engine/battle/scroll_draw_trainer_pic.asm @@ -1,4 +1,4 @@ -_ScrollTrainerPicAfterBattle: ; f4259 (3d:4259) +_ScrollTrainerPicAfterBattle: ; Load the enemy trainer's pic and scrolls it into ; the screen from the right. xor a @@ -32,7 +32,7 @@ _ScrollTrainerPicAfterBattle: ; f4259 (3d:4259) jr .scrollLoop ; write one 7-tile column of the trainer pic to the tilemap -DrawTrainerPicColumn: ; f428d (3d:428d) +DrawTrainerPicColumn: push hl push de push bc diff --git a/engine/battle/trainer_ai.asm b/engine/battle/trainer_ai.asm index 6b6247c9..3624f5ea 100644 --- a/engine/battle/trainer_ai.asm +++ b/engine/battle/trainer_ai.asm @@ -1,6 +1,6 @@ ; creates a set of moves that may be used and returns its address in hl ; unused slots are filled with 0, all used slots may be chosen with equal probability -AIEnemyTrainerChooseMoves: ; 3969c (e:569c) +AIEnemyTrainerChooseMoves: ld a, $a ld hl, wBuffer ; init temporary move selection array. Only the moves with the lowest numbers are chosen in the end ld [hli], a ; move 1 @@ -103,14 +103,14 @@ AIEnemyTrainerChooseMoves: ; 3969c (e:569c) ld hl, wEnemyMonMoves ; use original move set ret -AIMoveChoiceModificationFunctionPointers: ; 39726 (e:5726) +AIMoveChoiceModificationFunctionPointers: dw AIMoveChoiceModification1 dw AIMoveChoiceModification2 dw AIMoveChoiceModification3 dw AIMoveChoiceModification4 ; unused, does nothing ; discourages moves that cause no damage but only a status ailment if player's mon already has one -AIMoveChoiceModification1: ; 3972e (e:572e) +AIMoveChoiceModification1: ld a, [wBattleMonStatus] and a ret z ; return if no status ailment on player's mon @@ -145,7 +145,7 @@ AIMoveChoiceModification1: ; 3972e (e:572e) ld [hl], a jr .nextMove -StatusAilmentMoveEffects: ; 39765 (e:5765) +StatusAilmentMoveEffects: db $01 ; unused sleep effect db SLEEP_EFFECT db POISON_EFFECT @@ -155,7 +155,7 @@ StatusAilmentMoveEffects: ; 39765 (e:5765) ; slightly encourage moves with specific effects. ; in particular, stat-modifying moves and other move effects ; that fall in-bewteen -AIMoveChoiceModification2: ; 3976a (e:576a) +AIMoveChoiceModification2: ld a, [wAILayer2Encouragement] cp $1 ret nz @@ -188,7 +188,7 @@ AIMoveChoiceModification2: ; 3976a (e:576a) ; encourages moves that are effective against the player's mon (even if non-damaging). ; discourage damaging moves that are ineffective or not very effective against the player's mon, ; unless there's no damaging move that deals at least neutral damage -AIMoveChoiceModification3: ; 3979a (e:579a) +AIMoveChoiceModification3: ld hl, wBuffer - 1 ; temp move selection array (-1 byte offset) ld de, wEnemyMonMoves ; enemy moves ld b, NUM_MOVES + 1 @@ -255,10 +255,10 @@ AIMoveChoiceModification3: ; 3979a (e:579a) jr z, .nextMove inc [hl] ; sligthly discourage this move jr .nextMove -AIMoveChoiceModification4: ; 39806 (e:5806) +AIMoveChoiceModification4: ret -ReadMove: ; 39807 (e:5807) +ReadMove: push hl push de push bc @@ -275,7 +275,7 @@ ReadMove: ; 39807 (e:5807) ; move choice modification methods that are applied for each trainer class ; 0 is sentinel value -TrainerClassMoveChoiceModifications: ; 3981e (e:581e) +TrainerClassMoveChoiceModifications: db 0 ; YOUNGSTER db 1,0 ; BUG CATCHER db 1,0 ; LASS @@ -336,7 +336,7 @@ INCLUDE "data/trainer_moves.asm" INCLUDE "data/trainer_parties.asm" -TrainerAI: ; 3a5b2 (e:65b2) +TrainerAI: ld a,[wIsInBattle] dec a jr z, .done ; if not a trainer, we're done here @@ -377,7 +377,7 @@ TrainerAI: ; 3a5b2 (e:65b2) and a ret -TrainerAIPointers: ; 3a5f2 (e:65f2) +TrainerAIPointers: ; one entry per trainer class ; first byte, number of times (per Pokémon) it can occur ; next two bytes, pointer to AI subroutine for trainer class @@ -429,27 +429,27 @@ TrainerAIPointers: ; 3a5f2 (e:65f2) dbw 2,AgathaAI ; agatha dbw 1,LanceAI ; lance -JugglerAI: ; 3a67f (e:667f) +JugglerAI: cp $40 ret nc jp AISwitchIfEnoughMons -BlackbeltAI: ; 3a685 (e:6685) +BlackbeltAI: cp $20 ret nc jp AIUseXAttack -GiovanniAI: ; 3a68b (e:668b) +GiovanniAI: cp $40 ret nc jp AIUseGuardSpec -CooltrainerMAI: ; 3a691 (e:6691) +CooltrainerMAI: cp $40 ret nc jp AIUseXAttack -CooltrainerFAI: ; 3a697 (e:6697) +CooltrainerFAI: cp $40 ld a,$A call AICheckIfHPBelowFraction @@ -459,24 +459,24 @@ CooltrainerFAI: ; 3a697 (e:6697) ret nc jp AISwitchIfEnoughMons -BrockAI: ; 3a6aa (e:66aa) +BrockAI: ; if his active monster has a status condition, use a full heal ld a,[wEnemyMonStatus] and a ret z jp AIUseFullHeal -MistyAI: ; 3a6b2 (e:66b2) +MistyAI: cp $40 ret nc jp AIUseXDefend -LtSurgeAI: ; 3a6b8 (e:66b8) +LtSurgeAI: cp $40 ret nc jp AIUseXSpeed -ErikaAI: ; 3a6be (e:66be) +ErikaAI: cp $80 ret nc ld a,$A @@ -484,12 +484,12 @@ ErikaAI: ; 3a6be (e:66be) ret nc jp AIUseSuperPotion -KogaAI: ; 3a6ca (e:66ca) +KogaAI: cp $20 ret nc jp AIUseXAttack -BlaineAI: ; 3a6d0 (e:66d0) +BlaineAI: cp $40 ret nc ld a,$A @@ -497,12 +497,12 @@ BlaineAI: ; 3a6d0 (e:66d0) ret nc jp AIUseSuperPotion -SabrinaAI: ; 3a6dc (e:66dc) +SabrinaAI: cp $40 ret nc jp AIUseXDefend -Sony2AI: ; 3a6e2 (e:66e2) +Sony2AI: cp $20 ret nc ld a,5 @@ -510,7 +510,7 @@ Sony2AI: ; 3a6e2 (e:66e2) ret nc jp AIUsePotion -Sony3AI: ; 3a6ee (e:66ee) +Sony3AI: cp $20 ret nc ld a,5 @@ -518,7 +518,7 @@ Sony3AI: ; 3a6ee (e:66ee) ret nc jp AIUseFullRestore -LoreleiAI: ; 3a6fa (e:66fa) +LoreleiAI: cp $80 ret nc ld a,5 @@ -526,12 +526,12 @@ LoreleiAI: ; 3a6fa (e:66fa) ret nc jp AIUseSuperPotion -BrunoAI: ; 3a706 (e:6706) +BrunoAI: cp $40 ret nc jp AIUseXDefend -AgathaAI: ; 3a70c (e:670c) +AgathaAI: cp $14 jp c,AISwitchIfEnoughMons cp $80 @@ -541,7 +541,7 @@ AgathaAI: ; 3a70c (e:670c) ret nc jp AIUseSuperPotion -LanceAI: ; 3a71d (e:671d) +LanceAI: cp $80 ret nc ld a,5 @@ -549,23 +549,23 @@ LanceAI: ; 3a71d (e:671d) ret nc jp AIUseHyperPotion -GenericAI: ; 3a729 (e:6729) +GenericAI: and a ; clear carry ret ; end of individual trainer AI routines -DecrementAICount: ; 3a72b (e:672b) +DecrementAICount: ld hl,wAICount dec [hl] scf ret -AIPlayRestoringSFX: ; 3a731 (e:6731) +AIPlayRestoringSFX: ld a,SFX_HEAL_AILMENT jp PlaySoundWaitForCurrent -AIUseFullRestore: ; 3a736 (e:6736) +AIUseFullRestore: call AICureStatus ld a,FULL_RESTORE ld [wAIItem],a @@ -589,25 +589,25 @@ AIUseFullRestore: ; 3a736 (e:6736) ld [wEnemyMonHP],a jr AIPrintItemUseAndUpdateHPBar -AIUsePotion: ; 3a760 (e:6760) +AIUsePotion: ; enemy trainer heals his monster with a potion ld a,POTION ld b,20 jr AIRecoverHP -AIUseSuperPotion: ; 3a766 (e:6766) +AIUseSuperPotion: ; enemy trainer heals his monster with a super potion ld a,SUPER_POTION ld b,50 jr AIRecoverHP -AIUseHyperPotion: ; 3a76c (e:676c) +AIUseHyperPotion: ; enemy trainer heals his monster with a hyper potion ld a,HYPER_POTION ld b,200 ; fallthrough -AIRecoverHP: ; 3a770 (e:6770) +AIRecoverHP: ; heal b HP and print "trainer used $(a) on pokemon!" ld [wAIItem],a ld hl,wEnemyMonHP + 1 @@ -648,7 +648,7 @@ AIRecoverHP: ; 3a770 (e:6770) ld [wHPBarNewHP+1],a ; fallthrough -AIPrintItemUseAndUpdateHPBar: ; 3a7ae (e:67ae) +AIPrintItemUseAndUpdateHPBar: call AIPrintItemUse_ coord hl, 2, 2 xor a @@ -656,7 +656,7 @@ AIPrintItemUseAndUpdateHPBar: ; 3a7ae (e:67ae) predef UpdateHPBar2 jp DecrementAICount -AISwitchIfEnoughMons: ; 3a7c0 (e:67c0) +AISwitchIfEnoughMons: ; enemy trainer switches if there are 3 or more unfainted mons in party ld a,[wEnemyPartyCount] ld c,a @@ -686,7 +686,7 @@ AISwitchIfEnoughMons: ; 3a7c0 (e:67c0) and a ret -SwitchEnemyMon: ; 3a7e1 (e:67e1) +SwitchEnemyMon: ; prepare to withdraw the active monster: copy hp, number, and status to roster @@ -717,17 +717,17 @@ SwitchEnemyMon: ; 3a7e1 (e:67e1) scf ret -AIBattleWithdrawText: ; 3a817 (e:6817) +AIBattleWithdrawText: TX_FAR _AIBattleWithdrawText db "@" -AIUseFullHeal: ; 3a81c (e:681c) +AIUseFullHeal: call AIPlayRestoringSFX call AICureStatus ld a,FULL_HEAL jp AIPrintItemUse -AICureStatus: ; 3a827 (e:6827) +AICureStatus: ; cures the status of enemy's active pokemon ld a,[wEnemyMonPartyPos] ld hl,wEnemyMon1Status @@ -740,7 +740,7 @@ AICureStatus: ; 3a827 (e:6827) res 0,[hl] ret -AIUseXAccuracy: ; 3a83e (e:683e) +AIUseXAccuracy: ; unused call AIPlayRestoringSFX ld hl,wEnemyBattleStatus2 @@ -748,14 +748,14 @@ AIUseXAccuracy: ; 3a83e (e:683e) ld a,X_ACCURACY jp AIPrintItemUse -AIUseGuardSpec: ; 3a84b (e:684b) +AIUseGuardSpec: call AIPlayRestoringSFX ld hl,wEnemyBattleStatus2 set 1,[hl] ld a,GUARD_SPEC jp AIPrintItemUse -AIUseDireHit: ; 3a858 (e:6858) +AIUseDireHit: ; unused call AIPlayRestoringSFX ld hl,wEnemyBattleStatus2 @@ -763,7 +763,7 @@ AIUseDireHit: ; 3a858 (e:6858) ld a,DIRE_HIT jp AIPrintItemUse -AICheckIfHPBelowFraction: ; 3a865 (e:6865) +AICheckIfHPBelowFraction: ; return carry if enemy trainer's current HP is below 1 / a of the maximum ld [H_DIVISOR],a ld hl,wEnemyMonMaxHP @@ -789,27 +789,27 @@ AICheckIfHPBelowFraction: ; 3a865 (e:6865) sub c ret -AIUseXAttack: ; 3a888 (e:6888) +AIUseXAttack: ld b,$A ld a,X_ATTACK jr AIIncreaseStat -AIUseXDefend: ; 3a88e (e:688e) +AIUseXDefend: ld b,$B ld a,X_DEFEND jr AIIncreaseStat -AIUseXSpeed: ; 3a894 (e:6894) +AIUseXSpeed: ld b,$C ld a,X_SPEED jr AIIncreaseStat -AIUseXSpecial: ; 3a89a (e:689a) +AIUseXSpecial: ld b,$D ld a,X_SPECIAL ; fallthrough -AIIncreaseStat: ; 3a89e (e:689e) +AIIncreaseStat: ld [wAIItem],a push bc call AIPrintItemUse_ @@ -831,12 +831,12 @@ AIIncreaseStat: ; 3a89e (e:689e) ld [hl],a jp DecrementAICount -AIPrintItemUse: ; 3a8c2 (e:68c2) +AIPrintItemUse: ld [wAIItem],a call AIPrintItemUse_ jp DecrementAICount -AIPrintItemUse_: ; 3a8cb (e:68cb) +AIPrintItemUse_: ; print "x used [wAIItem] on z!" ld a,[wAIItem] ld [wd11e],a @@ -844,6 +844,6 @@ AIPrintItemUse_: ; 3a8cb (e:68cb) ld hl, AIBattleUseItemText jp PrintText -AIBattleUseItemText: ; 3a8da (e:68da) +AIBattleUseItemText: TX_FAR _AIBattleUseItemText db "@" diff --git a/engine/battle/trainer_pic_money_pointers.asm b/engine/battle/trainer_pic_money_pointers.asm index 69599dc0..37678e74 100755 --- a/engine/battle/trainer_pic_money_pointers.asm +++ b/engine/battle/trainer_pic_money_pointers.asm @@ -1,4 +1,4 @@ -TrainerPicAndMoneyPointers: ; 39893 (e:5893) +TrainerPicAndMoneyPointers: ; trainer pic pointers and base money. ; money received after battle = base money × level of highest-level enemy mon dw YoungsterPic diff --git a/engine/battle/unused_stats_functions.asm b/engine/battle/unused_stats_functions.asm index 5b2e5e0e..55f78fd3 100644 --- a/engine/battle/unused_stats_functions.asm +++ b/engine/battle/unused_stats_functions.asm @@ -1,5 +1,5 @@ ; does nothing since no stats are ever selected (barring glitches) -DoubleSelectedStats: ; f4206 (3d:4206) +DoubleSelectedStats: ld a, [H_WHOSETURN] and a ld a, [wPlayerStatsToDouble] @@ -29,7 +29,7 @@ DoubleSelectedStats: ; f4206 (3d:4206) ret ; does nothing since no stats are ever selected (barring glitches) -HalveSelectedStats: ; f422d (3d:422d) +HalveSelectedStats: ld a, [H_WHOSETURN] and a ld a, [wPlayerStatsToHalve] diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm index f2f2f457..0285346e 100644 --- a/engine/battle/wild_encounters.asm +++ b/engine/battle/wild_encounters.asm @@ -1,6 +1,6 @@ ; try to initiate a wild pokemon encounter ; returns success in Z -TryDoWildEncounter: ; 1383a (4:783a) +TryDoWildEncounter: ld a, [wNPCMovementScriptPointerTableNum] and a ret nz @@ -100,7 +100,7 @@ TryDoWildEncounter: ; 1383a (4:783a) xor a ret -WildMonEncounterSlotChances: ; 138e2 (4:78e2) +WildMonEncounterSlotChances: ; There are 10 slots for wild pokemon, and this is the table that defines how common each of ; those 10 slots is. A random number is generated and then the first byte of each pair in this ; table is compared against that random number. If the random number is less than or equal |