From 772fcc7588a4e1fbe146a02b429cf64282c81dcb Mon Sep 17 00:00:00 2001 From: Rangi Date: Mon, 6 Jul 2020 19:03:05 -0400 Subject: Specify the ldh instruction, don't turn ld into ldh --- engine/battle/animations.asm | 152 ++++---- engine/battle/battle_transitions.asm | 30 +- engine/battle/common_text.asm | 22 +- engine/battle/core.asm | 406 ++++++++++----------- engine/battle/effects.asm | 122 +++---- engine/battle/experience.asm | 38 +- engine/battle/ghost_marowak_anim.asm | 16 +- engine/battle/init_battle_variables.asm | 2 +- engine/battle/move_effects/conversion.asm | 2 +- engine/battle/move_effects/drain_hp.asm | 6 +- engine/battle/move_effects/focus_energy.asm | 2 +- engine/battle/move_effects/haze.asm | 2 +- engine/battle/move_effects/heal.asm | 6 +- engine/battle/move_effects/leech_seed.asm | 2 +- engine/battle/move_effects/mist.asm | 2 +- engine/battle/move_effects/one_hit_ko.asm | 2 +- engine/battle/move_effects/paralyze.asm | 2 +- engine/battle/move_effects/pay_day.asm | 24 +- engine/battle/move_effects/recoil.asm | 4 +- .../battle/move_effects/reflect_light_screen.asm | 2 +- engine/battle/move_effects/substitute.asm | 2 +- engine/battle/move_effects/transform.asm | 8 +- engine/battle/scale_sprites.asm | 6 +- engine/battle/trainer_ai.asm | 10 +- engine/battle/unused_stats_functions.asm | 4 +- engine/battle/wild_encounters.asm | 6 +- 26 files changed, 440 insertions(+), 440 deletions(-) (limited to 'engine/battle') diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index 78301b2e..c9f53961 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -163,7 +163,7 @@ DrawFrameBlock: PlayAnimation: xor a - ld [hROMBankTemp], a ; it looks like nothing reads this + ldh [hROMBankTemp], a ; it looks like nothing reads this ld [wSubAnimTransform], a ld a, [wAnimationID] ; get animation number dec a @@ -241,15 +241,15 @@ PlayAnimation: ld l, c ld h, b push hl - ld a, [rOBP0] + ldh a, [rOBP0] push af ld a, [wAnimPalette] - ld [rOBP0], a + ldh [rOBP0], a call LoadAnimationTileset call LoadSubanimation call PlaySubanimation pop af - ld [rOBP0], a + ldh [rOBP0], a .nextAnimationCommand pop hl jr .animationLoop @@ -308,7 +308,7 @@ LoadSubanimation: ; sets the transform to the subanimation type if it's the enemy's turn GetSubanimationTransform1: ld b, a - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, b ret nz @@ -319,7 +319,7 @@ GetSubanimationTransform1: ; 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: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, 2 << 5 ret z @@ -421,7 +421,7 @@ MoveAnimation: ShareMoveAnimations: ; some moves just reuse animations from status conditions - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ret z @@ -497,18 +497,18 @@ AnimationShakeScreenHorizontallySlow: push bc push bc .loop1 - ld a, [rWX] + ldh a, [rWX] inc a - ld [rWX], a + ldh [rWX], a ld c, 2 call DelayFrames dec b jr nz, .loop1 pop bc .loop2 - ld a, [rWX] + ldh a, [rWX] dec a - ld [rWX], a + ldh [rWX], a ld c, 2 call DelayFrames dec b @@ -534,16 +534,16 @@ SetAnimationPalette: ld b, $f0 .next ld a, b - ld [rOBP0], a + ldh [rOBP0], a ld a, $6c - ld [rOBP1], a + ldh [rOBP1], a ret .notSGB ld a, $e4 ld [wAnimPalette], a - ld [rOBP0], a + ldh [rOBP0], a ld a, $6c - ld [rOBP1], a + ldh [rOBP1], a ret PlaySubanimation: @@ -656,9 +656,9 @@ DoBallTossSpecialEffects: cp 3 ; is it a Master Ball or Ultra Ball? jr nc, .skipFlashingEffect .flashingEffect ; do a flashing effect if it's Master Ball or Ultra Ball - ld a, [rOBP0] + ldh a, [rOBP0] xor %00111100 ; complement colors 1 and 2 - ld [rOBP0], a + ldh [rOBP0], a .skipFlashingEffect ld a, [wSubAnimCounter] cp 11 ; is it the beginning of the subanimation? @@ -695,7 +695,7 @@ DoBallTossSpecialEffects: dec b jr nz, .loop ld a, %00001000 - ld [rNR10], a ; Channel 1 sweep register + ldh [rNR10], a ; Channel 1 sweep register ret .isTrainerBattle ; if it's a trainer battle, shorten the animation by one frame ld a, [wSubAnimCounter] @@ -882,9 +882,9 @@ TradeJumpPokeball: ld c, 5 call DelayFrames pop bc - ld a, [hSCX] ; background scroll X + ldh a, [hSCX] ; background scroll X sub 8 ; scroll to the left - ld [hSCX], a + ldh [hSCX], a pop de jr .loop @@ -920,16 +920,16 @@ AnimationDelay10: ; calls a function with the turn flipped from player to enemy or vice versa ; input - hl - address of function to call CallWithTurnFlipped: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] push af xor 1 - ld [hWhoseTurn], a + ldh [hWhoseTurn], a ld de, .returnAddress push de jp hl .returnAddress pop af - ld [hWhoseTurn], a + ldh [hWhoseTurn], a ret ; flashes the screen for an extended period (48 frames) @@ -947,7 +947,7 @@ AnimationFlashScreenLong: ld a, [hli] cp $01 ; is it the end of the palettes? jr z, .endOfPalettes - ld [rBGP], a + ldh [rBGP], a call FlashScreenLongDelay jr .innerLoop .endOfPalettes @@ -1006,18 +1006,18 @@ FlashScreenLongDelay: jp DelayFrames AnimationFlashScreen: - ld a, [rBGP] + ldh a, [rBGP] push af ; save initial palette ld a, %00011011 ; 0, 1, 2, 3 (inverted colors) - ld [rBGP], a + ldh [rBGP], a ld c, 2 call DelayFrames xor a ; white out background - ld [rBGP], a + ldh [rBGP], a ld c, 2 call DelayFrames pop af - ld [rBGP], a ; restore initial palette + ldh [rBGP], a ; restore initial palette ret AnimationDarkScreenPalette: @@ -1062,7 +1062,7 @@ SetAnimationBGPalette: jr z, .next ld a, c .next - ld [rBGP], a + ldh [rBGP], a ret ld b, $5 @@ -1133,7 +1133,7 @@ _AnimationWaterDroplets: AnimationSlideMonUp: ; Slides the mon's sprite upwards. ld c, 7 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a coord hl, 1, 6 coord de, 1, 5 @@ -1201,7 +1201,7 @@ _AnimationSlideMonUp: jr nz, .slideLoop ; Fill in the bottom row of the mon pic with the next row's tile IDs. - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a coord hl, 1, 11 jr z, .next @@ -1370,7 +1370,7 @@ AnimationShowEnemyMonPic: 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, [hWhoseTurn] + ldh a, [hWhoseTurn] and a coord hl, 0, 5 coord de, 2, 5 @@ -1418,7 +1418,7 @@ AnimationMoveMonHorizontally: ; Shifts the mon's sprite horizontally to a fixed location. Used by lots of ; animations like Tackle/Body Slam. call AnimationHideMonPic - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a coord hl, 2, 5 jr z, .next @@ -1434,7 +1434,7 @@ AnimationMoveMonHorizontally: AnimationResetMonPosition: ; Resets the mon's sprites to be located at the normal coordinates. - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, 5 * SCREEN_WIDTH + 2 jr z, .next @@ -1446,7 +1446,7 @@ AnimationResetMonPosition: AnimationSpiralBallsInward: ; Creates an effect that looks like energy balls spiralling into the ; player mon's sprite. Used in Focus Energy, for example. - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playerTurn ld a, -40 @@ -1530,7 +1530,7 @@ AnimationSquishMonPic: ld c, 4 .loop push bc - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playerTurn coord hl, 16, 0 @@ -1583,7 +1583,7 @@ _AnimationSquishMonPic: AnimationShootBallsUpward: ; Shoots one pillar of "energy" balls upwards. Used in Teleport/Sky Attack ; animations. - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playerTurn lb bc, 0, 16 * 8 @@ -1651,7 +1651,7 @@ _AnimationShootBallsUpward: AnimationShootManyBallsUpward: ; Shoots several pillars of "energy" balls upward. - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld hl, UpwardBallsAnimXCoordinatesPlayerTurn ld a, $50 ; y coordinate for "energy" ball pillar @@ -1743,7 +1743,7 @@ AnimationSlideMonDownAndHide: _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, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playerTurn coord hl, 12, 0 @@ -1758,7 +1758,7 @@ _AnimationSlideMonOff: .rowLoop ; iterates once for each row ld c, 8 .tileLoop ; iterates once for each tile in the row - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playerTurn2 call .EnemyNextTile @@ -1821,7 +1821,7 @@ AnimationSlideMonHalfOff: jp Delay3 CopyTempPicToMonPic: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld hl, vBackPic ; player turn jr z, .next @@ -1837,9 +1837,9 @@ AnimationWavyScreen: call BattleAnimCopyTileMapToVRAM call Delay3 xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ld a, SCREEN_HEIGHT_PX - ld [hWY], a + ldh [hWY], a ld d, $80 ; terminator ld e, SCREEN_HEIGHT_PX - 1 ld c, $ff @@ -1848,7 +1848,7 @@ AnimationWavyScreen: push hl .innerLoop call WavyScreen_SetSCX - ld a, [rLY] + ldh a, [rLY] cp e ; is it the last visible line in the frame? jr nz, .innerLoop ; keep going if not pop hl @@ -1861,11 +1861,11 @@ AnimationWavyScreen: dec c jr nz, .loop xor a - ld [hWY], a + ldh [hWY], a call SaveScreenTilesToBuffer2 call ClearScreen ld a, 1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a call Delay3 call LoadScreenTilesFromBuffer2 ld hl, vBGMap1 @@ -1873,11 +1873,11 @@ AnimationWavyScreen: ret WavyScreen_SetSCX: - ld a, [rSTAT] + ldh a, [rSTAT] and $3 ; is it H-blank? jr nz, WavyScreen_SetSCX ; wait until it's H-blank ld a, [hl] - ld [rSCX], a + ldh [rSCX], a inc hl ld a, [hl] cp d ; have we reached the end? @@ -1898,7 +1898,7 @@ AnimationSubstitute: xor a ld bc, $310 call FillMemory - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playerTurn ld hl, SlowbroSprite ; facing down sprite @@ -1937,7 +1937,7 @@ CopySlowbroSpriteData: jp FarCopyData2 HideSubstituteShowMonAnim: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld hl, wPlayerMonMinimized ld a, [wPlayerBattleStatus2] @@ -1987,7 +1987,7 @@ AnimationTransformMon: ld [wChangeMonPicEnemyTurnSpecies], a ChangeMonPic: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playerTurn ld a, [wChangeMonPicEnemyTurnSpecies] @@ -2020,11 +2020,11 @@ ChangeMonPic: AnimationHideEnemyMonPic: ; Hides the enemy mon's sprite xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ld hl, AnimationHideMonPic call CallWithTurnFlipped ld a, $1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a jp Delay3 InitMultipleObjectsOAM: @@ -2050,7 +2050,7 @@ InitMultipleObjectsOAM: AnimationHideMonPic: ; Hides the mon's sprite. - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playerTurn ld a, 12 @@ -2078,7 +2078,7 @@ ClearMonPicFromTileMap: ; in order to show only a portion of the mon sprite. GetMonSpriteTileMapPointerFromRowCount: push de - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr nz, .enemyTurn ld a, 20 * 5 + 1 @@ -2166,7 +2166,7 @@ GetMoveSound: ld b, a call IsCryMove jr nc, .NotCryMove - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr nz, .next ld a, [wBattleMonSpecies] ; get number of current monster @@ -2211,14 +2211,14 @@ IsCryMove: INCLUDE "data/moves/sfx.asm" CopyPicTiles: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, $31 ; base tile ID of player mon sprite jr z, .next ; enemy turn xor a ; base tile ID of enemy mon sprite .next - ld [hBaseTileID], a + ldh [hBaseTileID], a jr CopyTileIDs_NoBGTransfer ; copy the tiles used when a mon is being sent out of or into a pokeball @@ -2235,7 +2235,7 @@ CopyDownscaledMonTiles: CopyTileIDs_NoBGTransfer: xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ; fall through ; b = number of rows @@ -2245,7 +2245,7 @@ CopyTileIDs: .rowLoop push bc push hl - ld a, [hBaseTileID] + ldh a, [hBaseTileID] ld b, a .columnLoop ld a, [de] @@ -2261,7 +2261,7 @@ CopyTileIDs: dec b jr nz, .rowLoop ld a, $1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a pop hl ret @@ -2361,16 +2361,16 @@ Unknown_79c50: AnimationLeavesFalling: ; Makes leaves float down from the top of the screen. This is used ; in Razor Leaf's animation. - ld a, [rOBP0] + ldh a, [rOBP0] push af ld a, [wAnimPalette] - ld [rOBP0], a + ldh [rOBP0], a ld d, $37 ; leaf tile ld a, 3 ; number of leaves ld [wNumFallingObjects], a call AnimationFallingObjects pop af - ld [rOBP0], a + ldh [rOBP0], a ret AnimationPetalsFalling: @@ -2529,7 +2529,7 @@ AnimationShakeEnemyHUD: call CopyVideoData xor a - ld [hSCX], a + ldh [hSCX], a ; Copy wTileMap to BG map 0. The regular BG (not the window) is set to use ; map 0 and can be scrolled with SCX, which allows a shaking effect. @@ -2539,7 +2539,7 @@ AnimationShakeEnemyHUD: ; Now that the regular BG is showing the same thing the window was, move the ; window off the screen so that we can modify its contents below. ld a, SCREEN_HEIGHT_PX - ld [hWY], a + ldh [hWY], a ; Copy wTileMap to VRAM such that the row below the enemy HUD (in wTileMap) is ; lined up with row 0 of the window. @@ -2551,7 +2551,7 @@ AnimationShakeEnemyHUD: ; covers everything below the enemy HD with a copy that looks just like what ; was there before. ld a, 7 * 8 - ld [hWY], a + ldh [hWY], a ; Write OAM entries so that the copy of the back pic from the top of this ; function shows up on screen. We need this because the back pic's Y coordinates @@ -2576,11 +2576,11 @@ AnimationShakeEnemyHUD: call AnimationShowMonPic call ClearSprites ld a, SCREEN_HEIGHT_PX - ld [hWY], a + ldh [hWY], a ld hl, vBGMap1 call BattleAnimCopyTileMapToVRAM xor a - ld [hWY], a + ldh [hWY], a call SaveScreenTilesToBuffer1 ld hl, vBGMap0 call BattleAnimCopyTileMapToVRAM @@ -2595,7 +2595,7 @@ AnimationShakeEnemyHUD: CopyTileIDsFromList: call GetPredefRegisters ld a, c - ld [hBaseTileID], a + ldh [hBaseTileID], a ld a, b push hl call GetTileIDList @@ -2603,30 +2603,30 @@ CopyTileIDsFromList: jp CopyTileIDs ShakeEnemyHUD_ShakeBG: - ld a, [hSCX] + ldh a, [hSCX] ld [wTempSCX], a .loop ld a, [wTempSCX] add d - ld [hSCX], a + ldh [hSCX], a ld c, 2 call DelayFrames ld a, [wTempSCX] sub d - ld [hSCX], a + ldh [hSCX], a ld c, 2 call DelayFrames dec e jr nz, .loop ld a, [wTempSCX] - ld [hSCX], a + ldh [hSCX], a ret BattleAnimCopyTileMapToVRAM: ld a, h - ld [hAutoBGTransferDest + 1], a + ldh [hAutoBGTransferDest + 1], a ld a, l - ld [hAutoBGTransferDest], a + ldh [hAutoBGTransferDest], a jp Delay3 TossBallAnimation: diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index 548e85fb..8a22e70f 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -1,9 +1,9 @@ BattleTransition: ld a, 1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a call Delay3 xor a - ld [hWY], a + ldh [hWY], a dec a ld [wUpdateSpritesEnabled], a call DelayFrame @@ -11,7 +11,7 @@ BattleTransition: ; Determine which OAM block is being used by the enemy trainer sprite (if there ; is one). ld hl, wSpritePlayerStateData1ImageIndex - ld a, [hSpriteIndexOrTextID] ; enemy trainer sprite index (0 if wild battle) + ldh a, [hSpriteIndexOrTextID] ; enemy trainer sprite index (0 if wild battle) ld c, a ld b, 0 ld de, $10 @@ -165,9 +165,9 @@ BattleTransitionTileEnd: BattleTransition_BlackScreen: ld a, $ff - ld [rBGP], a - ld [rOBP0], a - ld [rOBP1], a + ldh [rBGP], a + ldh [rOBP0], a + ldh [rOBP1], a ret ; for non-dungeon trainer battles @@ -330,7 +330,7 @@ BattleTransition_FlashScreen_: ld a, [hli] cp $1 jr z, .done - ld [rBGP], a + ldh [rBGP], a ld c, 2 call DelayFrames jr .loop @@ -349,7 +349,7 @@ BattleTransition_Shrink: .loop push bc xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a coord hl, 0, 7 coord de, 0, 8 ld bc, -SCREEN_WIDTH * 2 @@ -367,7 +367,7 @@ BattleTransition_Shrink: ld bc, 2 call BattleTransition_CopyTiles2 ld a, $1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ld c, 6 call DelayFrames pop bc @@ -381,7 +381,7 @@ BattleTransition_Shrink: BattleTransition_Split: ld c, SCREEN_HEIGHT / 2 xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a .loop push bc coord hl, 0, 16 @@ -496,7 +496,7 @@ BattleTransition_VerticalStripes: coord hl, 0, 0 coord de, 1, 17 xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a .loop push bc push hl @@ -535,7 +535,7 @@ BattleTransition_HorizontalStripes: coord hl, 0, 0 coord de, 19, 1 xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a .loop push bc push hl @@ -582,7 +582,7 @@ BattleTransition_FlashScreen: ld b, $3 call BattleTransition_FlashScreen_ xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ret BattleTransition_Circle_Sub1: @@ -601,10 +601,10 @@ BattleTransition_Circle_Sub1: BattleTransition_TransferDelay3: ld a, 1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a call Delay3 xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ret ; used for low level wild non-dungeon battles diff --git a/engine/battle/common_text.asm b/engine/battle/common_text.asm index 1cb455f3..b65bb84b 100644 --- a/engine/battle/common_text.asm +++ b/engine/battle/common_text.asm @@ -101,16 +101,16 @@ PrintSendOutMonMessage: ld hl, GoText jr z, .printText xor a - ld [hMultiplicand], a + ldh [hMultiplicand], a ld hl, wEnemyMonHP ld a, [hli] ld [wLastSwitchInEnemyMonHP], a - ld [hMultiplicand + 1], a + ldh [hMultiplicand + 1], a ld a, [hl] ld [wLastSwitchInEnemyMonHP + 1], a - ld [hMultiplicand + 2], a + ldh [hMultiplicand + 2], a ld a, 25 - ld [hMultiplier], a + ldh [hMultiplier], a call Multiply ld hl, wEnemyMonMaxHP ld a, [hli] @@ -121,9 +121,9 @@ PrintSendOutMonMessage: rr b ld a, b ld b, 4 - ld [hDivisor], a ; enemy mon max HP divided by 4 + ldh [hDivisor], a ; enemy mon max HP divided by 4 call Divide - ld a, [hQuotient + 3] ; a = (enemy mon current HP * 25) / (enemy max HP / 4); this approximates the current percentage of max HP + ldh a, [hQuotient + 3] ; a = (enemy mon current HP * 25) / (enemy max HP / 4); this approximates the current percentage of max HP ld hl, GoText ; 70% or greater cp 70 jr nc, .printText @@ -179,14 +179,14 @@ PlayerMon2Text: dec hl ld a, [de] sub b - ld [hMultiplicand + 2], a + ldh [hMultiplicand + 2], a dec de ld b, [hl] ld a, [de] sbc b - ld [hMultiplicand + 1], a + ldh [hMultiplicand + 1], a ld a, 25 - ld [hMultiplier], a + ldh [hMultiplier], a call Multiply ld hl, wEnemyMonMaxHP ld a, [hli] @@ -197,11 +197,11 @@ PlayerMon2Text: rr b ld a, b ld b, 4 - ld [hDivisor], a + ldh [hDivisor], a call Divide pop bc pop de - ld a, [hQuotient + 3] ; a = ((LastSwitchInEnemyMonHP - CurrentEnemyMonHP) / 25) / (EnemyMonMaxHP / 4) + ldh a, [hQuotient + 3] ; a = ((LastSwitchInEnemyMonHP - CurrentEnemyMonHP) / 25) / (EnemyMonMaxHP / 4) ; Assuming that the enemy mon hasn't gained HP since the last switch in, ; a approximates the percentage that the enemy mon's total HP has decreased ; since the last switch in. diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 935764aa..24ae8dfc 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -48,25 +48,25 @@ SlidePlayerAndEnemySilhouettesOnScreen: jr nz, .copyRowLoop call EnableLCD ld a, $90 - ld [hWY], a - ld [rWY], a + ldh [hWY], a + ldh [rWY], a xor a - ld [hTilesetType], a - ld [hSCY], a + ldh [hTilesetType], a + ldh [hSCY], a dec a ld [wUpdateSpritesEnabled], a call Delay3 xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ld b, $70 ld c, $90 ld a, c - ld [hSCX], a + ldh [hSCX], a call DelayFrame ld a, %11100100 ; inverted palette for silhouette effect - ld [rBGP], a - ld [rOBP0], a - ld [rOBP1], a + ldh [rBGP], a + ldh [rOBP0], a + ldh [rOBP1], a .slideSilhouettesLoop ; slide silhouettes of the player's pic and the enemy's pic onto the screen ld h, b ld l, $40 @@ -78,21 +78,21 @@ SlidePlayerAndEnemySilhouettesOnScreen: call SetScrollXForSlidingPlayerBodyLeft ; end background scrolling on line $60 call SlidePlayerHeadLeft ld a, c - ld [hSCX], a + ldh [hSCX], a dec c dec c jr nz, .slideSilhouettesLoop ld a, $1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ld a, $31 - ld [hStartTileID], a + ldh [hStartTileID], a coord hl, 1, 5 predef CopyUncompressedPicToTilemap xor a - ld [hWY], a - ld [rWY], a + ldh [hWY], a + ldh [rWY], a inc a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a call Delay3 ld b, SET_PAL_BATTLE call RunPaletteCommand @@ -118,13 +118,13 @@ SlidePlayerHeadLeft: ret SetScrollXForSlidingPlayerBodyLeft: - ld a, [rLY] + ldh a, [rLY] cp l jr nz, SetScrollXForSlidingPlayerBodyLeft ld a, h - ld [rSCX], a + ldh [rSCX], a .loop - ld a, [rLY] + ldh a, [rLY] cp h jr z, .loop ret @@ -266,7 +266,7 @@ EnemyRan: ld a, SFX_RUN call PlaySoundWaitForCurrent xor a - ld [hWhoseTurn], a + ldh [hWhoseTurn], a jpab AnimationSlideEnemyMonOff WildRanText: @@ -398,7 +398,7 @@ MainInBattleLoop: jr nc, .playerMovesFirst ; if player is faster jr .enemyMovesFirst ; if enemy is faster .speedEqual ; 50/50 chance for both players - ld a, [hSerialConnectionStatus] + ldh a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK jr z, .invertOutcome call BattleRandom @@ -412,7 +412,7 @@ MainInBattleLoop: jr .playerMovesFirst .enemyMovesFirst ld a, $1 - ld [hWhoseTurn], a + ldh [hWhoseTurn], a callab TrainerAI jr c, .AIActionUsedEnemyFirst call ExecuteEnemyMove @@ -450,7 +450,7 @@ MainInBattleLoop: jp z, HandlePlayerMonFainted call DrawHUDsAndHPBars ld a, $1 - ld [hWhoseTurn], a + ldh [hWhoseTurn], a callab TrainerAI jr c, .AIActionUsedPlayerFirst call ExecuteEnemyMove @@ -470,7 +470,7 @@ MainInBattleLoop: HandlePoisonBurnLeechSeed: ld hl, wBattleMonHP ld de, wBattleMonStatus - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playersTurn ld hl, wEnemyMonHP @@ -495,7 +495,7 @@ HandlePoisonBurnLeechSeed: call HandlePoisonBurnLeechSeed_DecreaseOwnHP .notBurnedOrPoisoned ld de, wPlayerBattleStatus2 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playersTurn2 ld de, wEnemyBattleStatus2 @@ -504,16 +504,16 @@ HandlePoisonBurnLeechSeed: add a jr nc, .notLeechSeeded push hl - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] push af xor $1 - ld [hWhoseTurn], a + ldh [hWhoseTurn], a xor a ld [wAnimationType], a ld a, ABSORB call PlayMoveAnimation ; play leech seed animation (from opposing mon) pop af - ld [hWhoseTurn], a + ldh [hWhoseTurn], a pop hl call HandlePoisonBurnLeechSeed_DecreaseOwnHP call HandlePoisonBurnLeechSeed_IncreaseEnemyHP @@ -571,7 +571,7 @@ HandlePoisonBurnLeechSeed_DecreaseOwnHP: .nonZeroDamage ld hl, wPlayerBattleStatus3 ld de, wPlayerToxicCounter - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playersTurn ld hl, wEnemyBattleStatus3 @@ -618,7 +618,7 @@ HandlePoisonBurnLeechSeed_DecreaseOwnHP: HandlePoisonBurnLeechSeed_IncreaseEnemyHP: push hl ld hl, wEnemyMonMaxHP - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playersTurn ld hl, wBattleMonMaxHP @@ -655,19 +655,19 @@ HandlePoisonBurnLeechSeed_IncreaseEnemyHP: ld [hl], a ld [wHPBarNewHP], a .noOverfullHeal - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] xor $1 - ld [hWhoseTurn], a + ldh [hWhoseTurn], a call UpdateCurMonHPBar - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] xor $1 - ld [hWhoseTurn], a + ldh [hWhoseTurn], a pop hl ret UpdateCurMonHPBar: coord hl, 10, 9 ; tile pointer to player HP bar - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, $1 jr z, .playersTurn @@ -1232,7 +1232,7 @@ SevenSpacesText: ; if a is 8, the slide is to the right, else it is to the left ; bug: when this is called, [hAutoBGTransferEnabled] is non-zero, so there is screen tearing SlideTrainerPicOffScreen: - ld [hSlideAmount], a + ldh [hSlideAmount], a ld c, a .slideStepLoop ; each iteration, the trainer pic is slid one tile left/right push bc @@ -1240,10 +1240,10 @@ SlideTrainerPicOffScreen: ld b, 7 ; number of rows .rowLoop push hl - ld a, [hSlideAmount] + ldh a, [hSlideAmount] ld c, a .columnLoop - ld a, [hSlideAmount] + ldh a, [hSlideAmount] cp 8 jr z, .slideRight .slideLeft ; slide player sprite off screen @@ -1426,7 +1426,7 @@ EnemySendOutFirstMon: ld de, vFrontPic call LoadMonFrontSprite ld a, -$31 - ld [hStartTileID], a + ldh [hStartTileID], a coord hl, 15, 6 predef AnimateSendingOutMon ld a, [wEnemyMonSpecies2] @@ -1508,14 +1508,14 @@ TryRunningFromBattle: inc a ld [wNumRunAttempts], a ld a, [hli] - ld [hMultiplicand + 1], a + ldh [hMultiplicand + 1], a ld a, [hl] - ld [hMultiplicand + 2], a + ldh [hMultiplicand + 2], a ld a, [de] - ld [hEnemySpeed], a + ldh [hEnemySpeed], a inc de ld a, [de] - ld [hEnemySpeed + 1], a + ldh [hEnemySpeed + 1], a call LoadScreenTilesFromBuffer1 ld de, hMultiplicand + 1 ld hl, hEnemySpeed @@ -1523,17 +1523,17 @@ TryRunningFromBattle: call StringCmp jr nc, .canEscape ; jump if player speed greater than enemy speed xor a - ld [hMultiplicand], a + ldh [hMultiplicand], a ld a, 32 - ld [hMultiplier], a + ldh [hMultiplier], a call Multiply ; multiply player speed by 32 - ld a, [hProduct + 2] - ld [hDividend], a - ld a, [hProduct + 3] - ld [hDividend + 1], a - ld a, [hEnemySpeed] + ldh a, [hProduct + 2] + ldh [hDividend], a + ldh a, [hProduct + 3] + ldh [hDividend + 1], a + ldh a, [hEnemySpeed] ld b, a - ld a, [hEnemySpeed + 1] + ldh a, [hEnemySpeed + 1] ; divide enemy speed by 4 srl b rr a @@ -1541,10 +1541,10 @@ TryRunningFromBattle: rr a and a jr z, .canEscape ; jump if enemy speed divided by 4, mod 256 is 0 - ld [hDivisor], a ; ((enemy speed / 4) % 256) + ldh [hDivisor], a ; ((enemy speed / 4) % 256) ld b, $2 call Divide ; divide (player speed * 32) by ((enemy speed / 4) % 256) - ld a, [hQuotient + 2] + ldh a, [hQuotient + 2] and a ; is the quotient greater than 256? jr nz, .canEscape ; if so, the player can escape ld a, [wNumRunAttempts] @@ -1554,15 +1554,15 @@ TryRunningFromBattle: dec c jr z, .compareWithRandomValue ld b, 30 - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] add b - ld [hQuotient + 3], a + ldh [hQuotient + 3], a jr c, .canEscape jr .loop .compareWithRandomValue call BattleRandom ld b, a - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] cp b jr nc, .canEscape ; if the random value was less than or equal to the quotient ; plus 30 times the number of attempts, the player can escape @@ -1730,7 +1730,7 @@ SendOutMon: call DrawPlayerHUDAndHPBar predef LoadMonBackPic xor a - ld [hStartTileID], a + ldh [hStartTileID], a ld hl, wBattleAndStartSavedMenuItem ld [hli], a ld [hl], a @@ -1754,7 +1754,7 @@ SendOutMon: ld hl, wEnemyBattleStatus1 res USING_TRAPPING_MOVE, [hl] ld a, $1 - ld [hWhoseTurn], a + ldh [hWhoseTurn], a ld a, POOF_ANIM call PlayMoveAnimation coord hl, 4, 11 @@ -1773,7 +1773,7 @@ AnimateRetreatingPlayerMon: lb bc, 5, 5 xor a ld [wDownscaledMonSize], a - ld [hBaseTileID], a + ldh [hBaseTileID], a predef CopyDownscaledMonTiles ld c, 4 call DelayFrames @@ -1783,7 +1783,7 @@ AnimateRetreatingPlayerMon: ld a, 1 ld [wDownscaledMonSize], a xor a - ld [hBaseTileID], a + ldh [hBaseTileID], a predef CopyDownscaledMonTiles call Delay3 call .clearScreenArea @@ -1812,7 +1812,7 @@ DrawHUDsAndHPBars: DrawPlayerHUDAndHPBar: xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a coord hl, 9, 7 lb bc, 5, 11 call ClearScreenArea @@ -1845,7 +1845,7 @@ DrawPlayerHUDAndHPBar: coord hl, 10, 9 predef DrawHP ld a, $1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ld hl, wPlayerHPBarColor call GetBattleHealthBarColor ld hl, wBattleMonHP @@ -1873,7 +1873,7 @@ DrawPlayerHUDAndHPBar: DrawEnemyHUDAndHPBar: xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a coord hl, 0, 0 lb bc, 4, 12 call ClearScreenArea @@ -1895,9 +1895,9 @@ DrawEnemyHUDAndHPBar: .skipPrintLevel ld hl, wEnemyMonHP ld a, [hli] - ld [hMultiplicand + 1], a + ldh [hMultiplicand + 1], a ld a, [hld] - ld [hMultiplicand + 2], a + ldh [hMultiplicand + 2], a or [hl] ; is current HP zero? jr nz, .hpNonzero ; current HP is 0 @@ -1908,45 +1908,45 @@ DrawEnemyHUDAndHPBar: jp .drawHPBar .hpNonzero xor a - ld [hMultiplicand], a + ldh [hMultiplicand], a ld a, 48 - ld [hMultiplier], a + ldh [hMultiplier], a call Multiply ; multiply current HP by 48 ld hl, wEnemyMonMaxHP ld a, [hli] ld b, a ld a, [hl] - ld [hDivisor], a + ldh [hDivisor], a ld a, b and a ; is max HP > 255? jr z, .doDivide ; if max HP > 255, scale both (current HP * 48) and max HP by dividing by 4 so that max HP fits in one byte ; (it needs to be one byte so it can be used as the divisor for the Divide function) - ld a, [hDivisor] + ldh a, [hDivisor] srl b rr a srl b rr a - ld [hDivisor], a - ld a, [hProduct + 2] + ldh [hDivisor], a + ldh a, [hProduct + 2] ld b, a srl b - ld a, [hProduct + 3] + ldh a, [hProduct + 3] rr a srl b rr a - ld [hProduct + 3], a + ldh [hProduct + 3], a ld a, b - ld [hProduct + 2], a + ldh [hProduct + 2], a .doDivide - ld a, [hProduct + 2] - ld [hDividend], a - ld a, [hProduct + 3] - ld [hDividend + 1], a + ldh a, [hProduct + 2] + ldh [hDividend], a + ldh a, [hProduct + 3] + ldh [hDividend + 1], a ld a, $2 ld b, a call Divide ; divide (current HP * 48) by max HP - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] ; set variables for DrawHPBar ld e, a ld a, $6 @@ -1958,7 +1958,7 @@ DrawEnemyHUDAndHPBar: coord hl, 2, 2 call DrawHPBar ld a, $1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ld hl, wEnemyHPBarColor GetBattleHealthBarColor: @@ -2469,13 +2469,13 @@ MoveSelectionMenu: .writemoves ld de, wMovesString - ld a, [hFlagsFFF6] + ldh a, [hFlagsFFF6] set 2, a - ld [hFlagsFFF6], a + ldh [hFlagsFFF6], a call PlaceString - ld a, [hFlagsFFF6] + ldh a, [hFlagsFFF6] res 2, a - ld [hFlagsFFF6], a + ldh [hFlagsFFF6], a ret .regularmenu @@ -2825,7 +2825,7 @@ SwapMovesInMenu: PrintMenuItem: xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a coord hl, 0, 8 ld b, 3 ld c, 9 @@ -2847,7 +2847,7 @@ PrintMenuItem: ld hl, wCurrentMenuItem dec [hl] xor a - ld [hWhoseTurn], a + ldh [hWhoseTurn], a ld hl, wBattleMonMoves ld a, [wCurrentMenuItem] ld c, a @@ -2891,7 +2891,7 @@ PrintMenuItem: predef PrintMoveType .moveDisabled ld a, $1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a jp Delay3 DisabledText: @@ -3043,7 +3043,7 @@ LinkBattleExchangeData: ExecutePlayerMove: xor a - ld [hWhoseTurn], a ; set player's turn + ldh [hWhoseTurn], a ; set player's turn ld a, [wPlayerSelectedMove] inc a jp z, ExecutePlayerMoveDone ; for selected move = FF, skip most of player's turn @@ -3252,7 +3252,7 @@ PrintGhostText: ; print the ghost battle messages call IsGhostBattle ret nz - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr nz, .Ghost ld a, [wBattleMonStatus] ; player’s turn @@ -3619,7 +3619,7 @@ CantMoveText: PrintMoveIsDisabledText: ld hl, wPlayerSelectedMove ld de, wPlayerBattleStatus1 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .removeChargingUp inc hl @@ -3675,11 +3675,11 @@ HandleSelfConfusionDamage: xor a ld [wAnimationType], a inc a - ld [hWhoseTurn], a + ldh [hWhoseTurn], a call PlayMoveAnimation call DrawPlayerHUDAndHPBar xor a - ld [hWhoseTurn], a + ldh [hWhoseTurn], a jp ApplyDamageToPlayerPokemon PrintMonName1Text: @@ -3694,7 +3694,7 @@ PrintMonName1Text: MonName1Text: text_far _MonName1Text text_asm - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, [wPlayerMoveNum] ld hl, wPlayerUsedMove @@ -3818,7 +3818,7 @@ INCLUDE "data/moves/grammar.asm" PrintMoveFailureText: ld de, wPlayerMoveEffect - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playersTurn ld de, wEnemyMoveEffect @@ -3866,7 +3866,7 @@ PrintMoveFailureText: call PrintText ld b, $4 predef PredefShakeScreenHorizontally - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr nz, .enemyTurn jp ApplyDamageToPlayerPokemon @@ -4160,9 +4160,9 @@ GetDamageVarsForPlayerAttack: ; in the case of a critical hit, reset the player's attack and the enemy's defense to their base values ld c, 3 ; defense stat call GetEnemyMonStat - ld a, [hProduct + 2] + ldh a, [hProduct + 2] ld b, a - ld a, [hProduct + 3] + ldh a, [hProduct + 3] ld c, a push bc ld hl, wPartyMon1Attack @@ -4192,9 +4192,9 @@ GetDamageVarsForPlayerAttack: ; in the case of a critical hit, reset the player's and enemy's specials to their base values ld c, 5 ; special stat call GetEnemyMonStat - ld a, [hProduct + 2] + ldh a, [hProduct + 2] ld b, a - ld a, [hProduct + 3] + ldh a, [hProduct + 3] ld c, a push bc ld hl, wPartyMon1Special @@ -4371,9 +4371,9 @@ GetEnemyMonStat: ld bc, wEnemyMon2 - wEnemyMon1 call AddNTimes ld a, [hli] - ld [hMultiplicand + 1], a + ldh [hMultiplicand + 1], a ld a, [hl] - ld [hMultiplicand + 2], a + ldh [hMultiplicand + 2], a pop bc pop de ret @@ -4404,7 +4404,7 @@ CalculateDamage: ; d: base power ; e: level - ld a, [hWhoseTurn] ; whose turn? + ldh a, [hWhoseTurn] ; whose turn? and a ld a, [wPlayerMoveEffect] jr z, .effect @@ -4489,44 +4489,44 @@ CalculateDamage: ; Capped at MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE: 999 - 2 = 997. ld hl, wDamage ld b, [hl] - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] add b - ld [hQuotient + 3], a + ldh [hQuotient + 3], a jr nc, .dont_cap_1 - ld a, [hQuotient + 2] + ldh a, [hQuotient + 2] inc a - ld [hQuotient + 2], a + ldh [hQuotient + 2], a and a jr z, .cap .dont_cap_1 - ld a, [hQuotient] + ldh a, [hQuotient] ld b, a - ld a, [hQuotient + 1] + ldh a, [hQuotient + 1] or a jr nz, .cap - ld a, [hQuotient + 2] + ldh a, [hQuotient + 2] cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) / $100 jr c, .dont_cap_2 cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) / $100 + 1 jr nc, .cap - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) % $100 jr nc, .cap .dont_cap_2 inc hl - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] ld b, [hl] add b ld [hld], a - ld a, [hQuotient + 2] + ldh a, [hQuotient + 2] ld b, [hl] adc b ld [hl], a @@ -4579,7 +4579,7 @@ INCLUDE "data/battle/unused_critical_hit_moves.asm" CriticalHitTest: xor a ld [wCriticalHitOrOHKO], a - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, [wEnemyMonSpecies] jr nz, .handleEnemy @@ -4590,7 +4590,7 @@ CriticalHitTest: ld a, [wMonHBaseSpeed] ld b, a srl b ; (effective (base speed/2)) - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld hl, wPlayerMovePower ld de, wPlayerBattleStatus2 @@ -4652,7 +4652,7 @@ HandleCounterMove: ; the outcome may be affected by the player's actions in the move selection menu prior to switching the Pokemon. ; This might also lead to desync glitches in link battles. - ld a, [hWhoseTurn] ; whose turn + ldh a, [hWhoseTurn] ; whose turn and a ; player's turn ld hl, wEnemySelectedMove @@ -4960,7 +4960,7 @@ AttackSubstitute: ; values for player turn ld de, wEnemySubstituteHP ld bc, wEnemyBattleStatus2 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .applyDamageToSubstitute ; values for enemy turn @@ -4985,14 +4985,14 @@ AttackSubstitute: ld hl, SubstituteBrokeText call PrintText ; flip whose turn it is for the next function call - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] xor $01 - ld [hWhoseTurn], a + ldh [hWhoseTurn], a callab HideSubstituteShowMonAnim ; animate the substitute breaking ; flip the turn back to the way it was - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] xor $01 - ld [hWhoseTurn], a + ldh [hWhoseTurn], a ld hl, wPlayerMoveEffect ; value for player's turn and a jr z, .nullifyEffect @@ -5016,7 +5016,7 @@ HandleBuildingRage: ld hl, wEnemyBattleStatus2 ld de, wEnemyMonStatMods ld bc, wEnemyMoveNum - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .next ; values for the enemy turn @@ -5029,9 +5029,9 @@ HandleBuildingRage: ld a, [de] cp $0d ; maximum stat modifier value ret z ; return if attack modifier is already maxed - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] xor $01 ; flip turn for the stat modifier raising function - ld [hWhoseTurn], a + ldh [hWhoseTurn], a ; temporarily change the target pokemon's move to $00 and the effect to the one ; that causes the attack modifier to go up one stage ld h, b @@ -5048,9 +5048,9 @@ HandleBuildingRage: ldd [hl], a ; null move effect ld a, RAGE ld [hl], a ; restore the target pokemon's move number to Rage - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] xor $01 ; flip turn back to the way it was - ld [hWhoseTurn], a + ldh [hWhoseTurn], a ret BuildingRageText: @@ -5066,7 +5066,7 @@ MirrorMoveCopyMove: ; wPlayerUsedMove is also set to 0 whenever the player is fast asleep or frozen solid. ; wEnemyUsedMove is also set to 0 whenever the enemy is fast asleep or frozen solid. - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ; values for player turn ld a, [wEnemyUsedMove] @@ -5119,7 +5119,7 @@ MetronomePickMove: ; values for player turn ld de, wPlayerMoveNum ld hl, wPlayerSelectedMove - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .pickMoveLoop ; values for enemy turn @@ -5141,7 +5141,7 @@ MetronomePickMove: ; it's used to prevent moves that run another move within the same turn ; (like Mirror Move and Metronome) from losing 2 PP IncrementMovePP: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ; values for player turn ld hl, wBattleMonPP @@ -5160,7 +5160,7 @@ IncrementMovePP: ld h, d ld l, e add hl, bc - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, [wPlayerMonNumber] ; value for player turn jr z, .updatePP @@ -5184,7 +5184,7 @@ AdjustDamageForMoveType: ld e, [hl] ; e = type 2 of defender ld a, [wPlayerMoveType] ld [wMoveType], a - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .next ; values for enemy turn @@ -5248,25 +5248,25 @@ AdjustDamageForMoveType: and $80 ld b, a ld a, [hl] ; a = damage multiplier - ld [hMultiplier], a + ldh [hMultiplier], a add b ld [wDamageMultipliers], a xor a - ld [hMultiplicand], a + ldh [hMultiplicand], a ld hl, wDamage ld a, [hli] - ld [hMultiplicand + 1], a + ldh [hMultiplicand + 1], a ld a, [hld] - ld [hMultiplicand + 2], a + ldh [hMultiplicand + 2], a call Multiply ld a, 10 - ld [hDivisor], a + ldh [hDivisor], a ld b, $04 call Divide - ld a, [hQuotient + 2] + ldh a, [hQuotient + 2] ld [hli], a ld b, a - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] ld [hl], a or b ; is damage 0? jr nz, .skipTypeImmunity @@ -5331,7 +5331,7 @@ MoveHitTest: ld hl, wEnemyBattleStatus1 ld de, wPlayerMoveEffect ld bc, wEnemyMonStatus - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .dreamEaterCheck ; enemy's turn @@ -5360,7 +5360,7 @@ MoveHitTest: .checkForDigOrFlyStatus bit INVULNERABLE, [hl] jp nz, .moveMissed - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr nz, .enemyTurn .playerTurn @@ -5414,7 +5414,7 @@ MoveHitTest: call CalcHitChance ; scale the move accuracy according to attacker's accuracy and target's evasion ld a, [wPlayerMoveAccuracy] ld b, a - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .doAccuracyCheck ld a, [wEnemyMoveAccuracy] @@ -5433,7 +5433,7 @@ MoveHitTest: ld [hl], a inc a ld [wMoveMissed], a - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playerTurn2 .enemyTurn2 @@ -5448,7 +5448,7 @@ MoveHitTest: ; values for player turn CalcHitChance: ld hl, wPlayerMoveAccuracy - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, [wPlayerMonAccuracyMod] ld b, a @@ -5468,10 +5468,10 @@ CalcHitChance: ; decreases the hit chance instead of increasing the hit chance) ; zero the high bytes of the multiplicand xor a - ld [hMultiplicand], a - ld [hMultiplicand + 1], a + ldh [hMultiplicand], a + ldh [hMultiplicand + 1], a ld a, [hl] - ld [hMultiplicand + 2], a ; set multiplicand to move accuracy + ldh [hMultiplicand + 2], a ; set multiplicand to move accuracy push hl ld d, $02 ; loop has two iterations ; loop to do the calculations, the first iteration multiplies by the accuracy ratio and @@ -5486,29 +5486,29 @@ CalcHitChance: add hl, bc ; hl = address of stat modifier ratio pop bc ld a, [hli] - ld [hMultiplier], a ; set multiplier to the numerator of the ratio + ldh [hMultiplier], a ; set multiplier to the numerator of the ratio call Multiply ld a, [hl] - ld [hDivisor], a ; set divisor to the the denominator of the ratio + ldh [hDivisor], a ; set divisor to the the denominator of the ratio ; (the dividend is the product of the previous multiplication) ld b, $04 ; number of bytes in the dividend call Divide - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] ld b, a - ld a, [hQuotient + 2] + ldh a, [hQuotient + 2] or b jp nz, .nextCalculation ; make sure the result is always at least one - ld [hQuotient + 2], a + ldh [hQuotient + 2], a ld a, $01 - ld [hQuotient + 3], a + ldh [hQuotient + 3], a .nextCalculation ld b, c dec d jr nz, .loop - ld a, [hQuotient + 2] + ldh a, [hQuotient + 2] and a ; is the calculated hit chance over 0xFF? - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] jr z, .storeAccuracy ; if calculated hit chance over 0xFF ld a, $ff ; set the hit chance to 0xFF @@ -5528,29 +5528,29 @@ RandomizeDamage: ret c ; return if damage is equal to 0 or 1 .DamageGreaterThanOne xor a - ld [hMultiplicand], a + ldh [hMultiplicand], a dec hl ld a, [hli] - ld [hMultiplicand + 1], a + ldh [hMultiplicand + 1], a ld a, [hl] - ld [hMultiplicand + 2], a + ldh [hMultiplicand + 2], a ; loop until a random number greater than or equal to 217 is generated .loop call BattleRandom rrca cp 217 jr c, .loop - ld [hMultiplier], a + ldh [hMultiplier], a call Multiply ; multiply damage by the random number, which is in the range [217, 255] ld a, 255 - ld [hDivisor], a + ldh [hDivisor], a ld b, $4 call Divide ; divide the result by 255 ; store the modified damage - ld a, [hQuotient + 2] + ldh a, [hQuotient + 2] ld hl, wDamage ld [hli], a - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] ld [hl], a ret @@ -5906,11 +5906,11 @@ CheckEnemyStatusConditions: ld [hl], a xor a ld [wAnimationType], a - ld [hWhoseTurn], a + ldh [hWhoseTurn], a ld a, POUND call PlayMoveAnimation ld a, $1 - ld [hWhoseTurn], a + ldh [hWhoseTurn], a call ApplyDamageToEnemyPokemon jr .monHurtItselfOrFullyParalysed .checkIfTriedToUseDisabledMove @@ -6057,7 +6057,7 @@ CheckEnemyStatusConditions: ret GetCurrentMove: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jp z, .player ld de, wEnemyMoveNum @@ -6263,16 +6263,16 @@ DoBattleTransitionAndInitBattleVariables: predef BattleTransition callab LoadHudAndHpBarAndStatusTilePatterns ld a, $1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ld a, $ff ld [wUpdateSpritesEnabled], a call ClearSprites call ClearScreen xor a - ld [hAutoBGTransferEnabled], a - ld [hWY], a - ld [rWY], a - ld [hTilesetType], a + ldh [hAutoBGTransferEnabled], a + ldh [hWY], a + ldh [rWY], a + ldh [hTilesetType], a ld hl, wPlayerStatsToDouble ld [hli], a ld [hli], a @@ -6309,7 +6309,7 @@ LoadPlayerBackPic: predef ScaleSpriteByTwo ld hl, wOAMBuffer xor a - ld [hOAMTile], a ; initial tile number + ldh [hOAMTile], a ; initial tile number ld b, $7 ; 7 columns ld e, $a0 ; X for the left-most column .loop ; each loop iteration writes 3 OAM entries in a vertical column @@ -6323,16 +6323,16 @@ LoadPlayerBackPic: add d ; increase Y by height of tile ld d, a inc hl - ld a, [hOAMTile] + ldh a, [hOAMTile] ld [hli], a ; OAM tile number inc a ; increment tile number - ld [hOAMTile], a + ldh [hOAMTile], a inc hl dec c jr nz, .innerLoop - ld a, [hOAMTile] + ldh a, [hOAMTile] add $4 ; increase tile number by 4 - ld [hOAMTile], a + ldh [hOAMTile], a ld a, $8 ; width of tile add e ; increase X by width of tile ld e, a @@ -6346,14 +6346,14 @@ LoadPlayerBackPic: ld [MBC1SRamBank], a ld hl, vSprites ld de, sSpriteBuffer1 - ld a, [hLoadedROMBank] + ldh a, [hLoadedROMBank] ld b, a ld c, 7 * 7 call CopyVideoData xor a ld [MBC1SRamEnable], a ld a, $31 - ld [hStartTileID], a + ldh [hStartTileID], a coord hl, 1, 5 predef_jump CopyUncompressedPicToTilemap @@ -6373,12 +6373,12 @@ ApplyBurnAndParalysisPenaltiesToEnemy: xor a ApplyBurnAndParalysisPenalties: - ld [hWhoseTurn], a + ldh [hWhoseTurn], a call QuarterSpeedDueToParalysis jp HalveAttackDueToBurn QuarterSpeedDueToParalysis: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playerTurn .enemyTurn ; quarter the player's speed @@ -6421,7 +6421,7 @@ QuarterSpeedDueToParalysis: ret HalveAttackDueToBurn: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playerTurn .enemyTurn ; halve the player's attack @@ -6511,35 +6511,35 @@ CalculateModifiedStat: ld b, 0 add hl, bc xor a - ld [hMultiplicand], a + ldh [hMultiplicand], a ld a, [de] - ld [hMultiplicand + 1], a + ldh [hMultiplicand + 1], a inc de ld a, [de] - ld [hMultiplicand + 2], a + ldh [hMultiplicand + 2], a ld a, [hli] - ld [hMultiplier], a + ldh [hMultiplier], a call Multiply ld a, [hl] - ld [hDivisor], a + ldh [hDivisor], a ld b, $4 call Divide pop hl - ld a, [hDividend + 3] + ldh a, [hDividend + 3] sub 999 % $100 - ld a, [hDividend + 2] + ldh a, [hDividend + 2] sbc 999 / $100 jp c, .storeNewStatValue ; cap the stat at 999 ld a, 999 / $100 - ld [hDividend + 2], a + ldh [hDividend + 2], a ld a, 999 % $100 - ld [hDividend + 3], a + ldh [hDividend + 3], a .storeNewStatValue - ld a, [hDividend + 2] + ldh a, [hDividend + 2] ld [hli], a ld b, a - ld a, [hDividend + 3] + ldh a, [hDividend + 3] ld [hl], a or b jr nz, .done @@ -6605,7 +6605,7 @@ LoadHudAndHpBarAndStatusTilePatterns: call LoadHpBarAndStatusTilePatterns LoadHudTilePatterns: - ld a, [rLCDC] + ldh a, [rLCDC] add a ; is LCD disabled? jr c, .lcdEnabled .lcdDisabled @@ -6690,7 +6690,7 @@ BattleRandom: HandleExplodingAnimation: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld hl, wEnemyMonType1 ld de, wEnemyBattleStatus1 @@ -6740,7 +6740,7 @@ DetermineWildOpponent: ld a, [wd732] bit 1, a jr z, .asm_3ef2f - ld a, [hJoyHeld] + ldh a, [hJoyHeld] bit 1, a ; B button pressed? ret nz .asm_3ef2f @@ -6767,7 +6767,7 @@ InitBattleCommon: call _LoadTrainerPic xor a ld [wEnemyMonSpecies2], a - ld [hStartTileID], a + ldh [hStartTileID], a dec a ld [wAICount], a coord hl, 12, 0 @@ -6823,7 +6823,7 @@ InitWildBattle: .spriteLoaded xor a ld [wTrainerClass], a - ld [hStartTileID], a + ldh [hStartTileID], a coord hl, 12, 0 predef CopyUncompressedPicToTilemap @@ -6833,18 +6833,18 @@ _InitBattleCommon: call RunPaletteCommand call SlidePlayerAndEnemySilhouettesOnScreen xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ld hl, .emptyString call PrintText call SaveScreenTilesToBuffer1 call ClearScreen ld a, $98 - ld [hAutoBGTransferDest + 1], a + ldh [hAutoBGTransferDest + 1], a ld a, $1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a call Delay3 ld a, $9c - ld [hAutoBGTransferDest + 1], a + ldh [hAutoBGTransferDest + 1], a call LoadScreenTilesFromBuffer1 coord hl, 9, 7 lb bc, 5, 10 @@ -6863,7 +6863,7 @@ _InitBattleCommon: pop af ld [wMapPalOffset], a ld a, [wSavedTilesetType] - ld [hTilesetType], a + ldh [hTilesetType], a scf ret .emptyString @@ -6900,8 +6900,8 @@ AnimateSendingOutMon: ld h, a ld a, [wPredefRegisters + 1] ld l, a - ld a, [hStartTileID] - ld [hBaseTileID], a + ldh a, [hStartTileID] + ldh [hBaseTileID], a ld b, $4c ld a, [wIsInBattle] and a @@ -6931,7 +6931,7 @@ AnimateSendingOutMon: ld bc, -(SCREEN_WIDTH * 6 + 3) .next add hl, bc - ld a, [hBaseTileID] + ldh a, [hBaseTileID] add $31 jr CopyUncompressedPicToHL @@ -6940,7 +6940,7 @@ CopyUncompressedPicToTilemap: ld h, a ld a, [wPredefRegisters + 1] ld l, a - ld a, [hStartTileID] + ldh a, [hStartTileID] CopyUncompressedPicToHL:: lb bc, 7, 7 ld de, SCREEN_WIDTH @@ -7005,6 +7005,6 @@ LoadMonBackPic: ld hl, vSprites ld de, vBackPic ld c, (2*SPRITEBUFFERSIZE)/16 ; count of 16-byte chunks to be copied - ld a, [hLoadedROMBank] + ldh a, [hLoadedROMBank] ld b, a jp CopyVideoData diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm index 22fadb42..c3a2a213 100644 --- a/engine/battle/effects.asm +++ b/engine/battle/effects.asm @@ -4,7 +4,7 @@ JumpMoveEffect: ret _JumpMoveEffect: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, [wPlayerMoveEffect] jr z, .next1 @@ -26,7 +26,7 @@ INCLUDE "data/moves/effects_pointers.asm" SleepEffect: ld de, wEnemyMonStatus ld bc, wEnemyBattleStatus2 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jp z, .sleepEffect ld de, wBattleMonStatus @@ -78,7 +78,7 @@ AlreadyAsleepText: PoisonEffect: ld hl, wEnemyMonStatus ld de, wPlayerMoveEffect - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .poisonEffect ld hl, wBattleMonStatus @@ -121,7 +121,7 @@ PoisonEffect: set 3, [hl] ; mon is now poisoned push de dec de - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld b, ANIM_C7 ld hl, wPlayerBattleStatus3 @@ -175,7 +175,7 @@ DrainHPEffect: ExplodeEffect: ld hl, wBattleMonHP ld de, wPlayerBattleStatus2 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .faintUser ld hl, wEnemyMonHP @@ -196,7 +196,7 @@ FreezeBurnParalyzeEffect: ld [wAnimationType], a call CheckTargetSubstitute ; test bit 4 of d063/d068 flags [target has substitute flag] ret nz ; return if they have a substitute, can't effect them - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jp nz, opponentAttacker ld a, [wEnemyMonStatus] @@ -308,7 +308,7 @@ CheckDefrost: ; any fire-type move that has a chance inflict burn (all but Fire Spin) will defrost a frozen target and 1 << FRZ ; are they frozen? ret z ; return if so - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr nz, .opponent ;player [attacker] @@ -346,7 +346,7 @@ FireDefrostedText: StatModifierUpEffect: ld hl, wPlayerMonStatMods ld de, wPlayerMoveEffect - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .statModifierUpEffect ld hl, wEnemyMonStatMods @@ -382,7 +382,7 @@ StatModifierUpEffect: push hl ld hl, wBattleMonAttack + 1 ld de, wPlayerMonUnmodifiedAttack - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .pointToStats ld hl, wEnemyMonAttack + 1 @@ -417,35 +417,35 @@ StatModifierUpEffect: add hl, bc pop bc xor a - ld [hMultiplicand], a + ldh [hMultiplicand], a ld a, [de] - ld [hMultiplicand + 1], a + ldh [hMultiplicand + 1], a inc de ld a, [de] - ld [hMultiplicand + 2], a + ldh [hMultiplicand + 2], a ld a, [hli] - ld [hMultiplier], a + ldh [hMultiplier], a call Multiply ld a, [hl] - ld [hDivisor], a + ldh [hDivisor], a ld b, $4 call Divide pop hl ; cap at 999 - ld a, [hProduct + 3] + ldh a, [hProduct + 3] sub 999 % $100 - ld a, [hProduct + 2] + ldh a, [hProduct + 2] sbc 999 / $100 jp c, UpdateStat ld a, 999 / $100 - ld [hMultiplicand + 1], a + ldh [hMultiplicand + 1], a ld a, 999 % $100 - ld [hMultiplicand + 2], a + ldh [hMultiplicand + 2], a UpdateStat: - ld a, [hProduct + 2] + ldh a, [hProduct + 2] ld [hli], a - ld a, [hProduct + 3] + ldh a, [hProduct + 3] ld [hl], a pop hl UpdateStatDone: @@ -455,7 +455,7 @@ UpdateStatDone: ld hl, wPlayerBattleStatus2 ld de, wPlayerMoveNum ld bc, wPlayerMonMinimized - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .asm_3f4e6 ld hl, wEnemyBattleStatus2 @@ -488,7 +488,7 @@ UpdateStatDone: pop af call nz, Bankswitch .applyBadgeBoostsAndStatusPenalties - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a call z, ApplyBadgeStatBoosts ; whenever the player uses a stat-up move, badge boosts get reapplied again to every stat, ; even to those not affected by the stat-up move (will be boosted further) @@ -511,7 +511,7 @@ MonsStatsRoseText: text_far _MonsStatsRoseText text_asm ld hl, GreatlyRoseText - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, [wPlayerMoveEffect] jr z, .playerTurn @@ -534,7 +534,7 @@ StatModifierDownEffect: ld hl, wEnemyMonStatMods ld de, wPlayerMoveEffect ld bc, wEnemyBattleStatus1 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .statModifierDownEffect ld hl, wPlayerMonStatMods @@ -601,7 +601,7 @@ StatModifierDownEffect: push de ld hl, wEnemyMonAttack + 1 ld de, wEnemyMonUnmodifiedAttack - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .pointToStat ld hl, wBattleMonAttack + 1 @@ -637,33 +637,33 @@ StatModifierDownEffect: add hl, bc pop bc xor a - ld [hMultiplicand], a + ldh [hMultiplicand], a ld a, [de] - ld [hMultiplicand + 1], a + ldh [hMultiplicand + 1], a inc de ld a, [de] - ld [hMultiplicand + 2], a + ldh [hMultiplicand + 2], a ld a, [hli] - ld [hMultiplier], a + ldh [hMultiplier], a call Multiply ld a, [hl] - ld [hDivisor], a + ldh [hDivisor], a ld b, $4 call Divide pop hl - ld a, [hProduct + 3] + ldh a, [hProduct + 3] ld b, a - ld a, [hProduct + 2] + ldh a, [hProduct + 2] or b jp nz, UpdateLoweredStat - ld [hMultiplicand + 1], a + ldh [hMultiplicand + 1], a ld a, $1 - ld [hMultiplicand + 2], a + ldh [hMultiplicand + 2], a UpdateLoweredStat: - ld a, [hProduct + 2] + ldh a, [hProduct + 2] ld [hli], a - ld a, [hProduct + 3] + ldh a, [hProduct + 3] ld [hl], a pop de pop hl @@ -678,7 +678,7 @@ UpdateLoweredStatDone: jr nc, .ApplyBadgeBoostsAndStatusPenalties call PlayCurrentMoveAnimation2 .ApplyBadgeBoostsAndStatusPenalties - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a call nz, ApplyBadgeStatBoosts ; whenever the player uses a stat-down move, badge boosts get reapplied again to every stat, ; even to those not affected by the stat-up move (will be boosted further) @@ -713,7 +713,7 @@ MonsStatsFellText: text_far _MonsStatsFellText text_asm ld hl, FellText - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, [wPlayerMoveEffect] jr z, .playerTurn @@ -759,7 +759,7 @@ BideEffect: ld hl, wPlayerBattleStatus1 ld de, wPlayerBideAccumulatedDamage ld bc, wPlayerNumAttacksLeft - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .bideEffect ld hl, wEnemyBattleStatus1 @@ -778,14 +778,14 @@ BideEffect: inc a inc a ld [bc], a ; set Bide counter to 2 or 3 at random - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] add XSTATITEM_ANIM jp PlayBattleAnimation2 ThrashPetalDanceEffect: ld hl, wPlayerBattleStatus1 ld de, wPlayerNumAttacksLeft - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .thrashPetalDanceEffect ld hl, wEnemyBattleStatus1 @@ -797,12 +797,12 @@ ThrashPetalDanceEffect: inc a inc a ld [de], a ; set thrash/petal dance counter to 2 or 3 at random - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] add ANIM_B0 jp PlayBattleAnimation2 SwitchAndTeleportEffect: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr nz, .handleEnemy ld a, [wIsInBattle] @@ -920,7 +920,7 @@ TwoToFiveAttacksEffect: ld hl, wPlayerBattleStatus1 ld de, wPlayerNumAttacksLeft ld bc, wPlayerNumHits - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .twoToFiveAttacksEffect ld hl, wEnemyBattleStatus1 @@ -931,7 +931,7 @@ TwoToFiveAttacksEffect: ret nz set ATTACKING_MULTIPLE_TIMES, [hl] ; mon is now attacking multiple times ld hl, wPlayerMoveEffect - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .setNumberOfHits ld hl, wEnemyMoveEffect @@ -967,7 +967,7 @@ FlinchSideEffect: ret nz ld hl, wEnemyBattleStatus1 ld de, wPlayerMoveEffect - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .flinchSideEffect ld hl, wPlayerBattleStatus1 @@ -992,7 +992,7 @@ OneHitKOEffect: ChargeEffect: ld hl, wPlayerBattleStatus1 ld de, wPlayerMoveEffect - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld b, XSTATITEM_ANIM jr z, .chargeEffect @@ -1074,7 +1074,7 @@ DugAHoleText: TrappingEffect: ld hl, wPlayerBattleStatus1 ld de, wPlayerNumAttacksLeft - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .trappingEffect ld hl, wEnemyBattleStatus1 @@ -1120,7 +1120,7 @@ ConfusionEffect: jr nz, ConfusionEffectFailed ConfusionSideEffectSuccess: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld hl, wEnemyBattleStatus1 ld bc, wEnemyConfusedCounter @@ -1164,7 +1164,7 @@ SubstituteEffect: HyperBeamEffect: ld hl, wPlayerBattleStatus2 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .hyperBeamEffect ld hl, wEnemyBattleStatus2 @@ -1175,7 +1175,7 @@ HyperBeamEffect: ClearHyperBeam: push hl ld hl, wEnemyBattleStatus2 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .playerTurn ld hl, wPlayerBattleStatus2 @@ -1186,7 +1186,7 @@ ClearHyperBeam: RageEffect: ld hl, wPlayerBattleStatus2 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .player ld hl, wEnemyBattleStatus2 @@ -1201,7 +1201,7 @@ MimicEffect: ld a, [wMoveMissed] and a jr nz, .mimicMissed - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld hl, wBattleMonMoves ld a, [wPlayerBattleStatus1] @@ -1226,7 +1226,7 @@ MimicEffect: and a jr z, .getRandomMove ld d, a - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld hl, wBattleMonMoves ld a, [wPlayerMoveListIndex] @@ -1284,7 +1284,7 @@ DisableEffect: jr nz, .moveMissed ld de, wEnemyDisabledMove ld hl, wEnemyMonMoves - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .disableEffect ld de, wPlayerDisabledMove @@ -1307,7 +1307,7 @@ DisableEffect: jr z, .pickMoveToDisable ; loop until a non-00 move slot is found ld [wd11e], a ; store move number push hl - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld hl, wBattleMonPP jr nz, .enemyTurn @@ -1345,7 +1345,7 @@ DisableEffect: ld [de], a call PlayCurrentMoveAnimation2 ld hl, wPlayerDisabledMoveNumber - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr nz, .printDisableText inc hl ; wEnemyDisabledMoveNumber @@ -1430,7 +1430,7 @@ ParalyzedMayNotAttackText: CheckTargetSubstitute: push hl ld hl, wEnemyBattleStatus2 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .next1 ld hl, wPlayerBattleStatus2 @@ -1442,7 +1442,7 @@ CheckTargetSubstitute: PlayCurrentMoveAnimation2: ; animation at MOVENUM will be played unless MOVENUM is 0 ; plays wAnimationType 3 or 6 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, [wPlayerMoveNum] jr z, .notEnemyTurn @@ -1454,7 +1454,7 @@ PlayCurrentMoveAnimation2: PlayBattleAnimation2: ; play animation ID at a and animation type 6 or 3 ld [wAnimationID], a - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, $6 jr z, .storeAnimationType @@ -1468,7 +1468,7 @@ PlayCurrentMoveAnimation: ; resets wAnimationType xor a ld [wAnimationType], a - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, [wPlayerMoveNum] jr z, .notEnemyTurn diff --git a/engine/battle/experience.asm b/engine/battle/experience.asm index 6bc0a019..2e21d874 100644 --- a/engine/battle/experience.asm +++ b/engine/battle/experience.asm @@ -55,15 +55,15 @@ GainExperience: jr .gainStatExpLoop .statExpDone xor a - ld [hMultiplicand], a - ld [hMultiplicand + 1], a + ldh [hMultiplicand], a + ldh [hMultiplicand + 1], a ld a, [wEnemyMonBaseExp] - ld [hMultiplicand + 2], a + ldh [hMultiplicand + 2], a ld a, [wEnemyMonLevel] - ld [hMultiplier], a + ldh [hMultiplier], a call Multiply ld a, 7 - ld [hDivisor], a + ldh [hDivisor], a ld b, 4 call Divide ld hl, wPartyMon1OTID - (wPartyMon1DVs - 1) @@ -91,12 +91,12 @@ GainExperience: inc hl ; add the gained exp to the party mon's exp ld b, [hl] - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] ld [wExpAmountGained + 1], a add b ld [hld], a ld b, [hl] - ld a, [hQuotient + 2] + ldh a, [hQuotient + 2] ld [wExpAmountGained], a adc b ld [hl], a @@ -119,11 +119,11 @@ GainExperience: ld d, MAX_LEVEL callab CalcExperience ; get max exp ; compare max exp with current exp - ld a, [hExperience] + ldh a, [hExperience] ld b, a - ld a, [hExperience + 1] + ldh a, [hExperience + 1] ld c, a - ld a, [hExperience + 2] + ldh a, [hExperience + 2] ld d, a pop hl ld a, [hld] @@ -311,14 +311,14 @@ DivideExpDataByNumMonsGainingExp: ld c, wEnemyMonBaseExp + 1 - wEnemyMonBaseStats .divideLoop xor a - ld [hDividend], a + ldh [hDividend], a ld a, [hl] - ld [hDividend + 1], a + ldh [hDividend + 1], a ld a, [wd11e] - ld [hDivisor], a + ldh [hDivisor], a ld b, $2 call Divide ; divide value by number of mons gaining exp - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] ld [hli], a dec c jr nz, .divideLoop @@ -326,17 +326,17 @@ DivideExpDataByNumMonsGainingExp: ; multiplies exp by 1.5 BoostExp: - ld a, [hQuotient + 2] + ldh a, [hQuotient + 2] ld b, a - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] ld c, a srl b rr c add c - ld [hQuotient + 3], a - ld a, [hQuotient + 2] + ldh [hQuotient + 3], a + ldh a, [hQuotient + 2] adc b - ld [hQuotient + 2], a + ldh [hQuotient + 2], a ret GainedText: diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm index 28f536ca..bef680fe 100644 --- a/engine/battle/ghost_marowak_anim.asm +++ b/engine/battle/ghost_marowak_anim.asm @@ -1,7 +1,7 @@ MarowakAnim: ; animate the ghost being unveiled as a Marowak ld a, $e4 - ld [rOBP1], a + ldh [rOBP1], a call CopyMonPicFromBGToSpriteVRAM ; cover the BG ghost pic with a sprite ghost pic that looks the same ; now that the ghost pic is being displayed using sprites, clear the ghost pic from the BG tilemap coord hl, 12, 0 @@ -9,12 +9,12 @@ MarowakAnim: call ClearScreenArea call Delay3 xor a - ld [hAutoBGTransferEnabled], a ; disable BG transfer so we don't see the Marowak too soon + ldh [hAutoBGTransferEnabled], a ; disable BG transfer so we don't see the Marowak too soon ; replace ghost pic with Marowak in BG ld a, MAROWAK ld [wChangeMonPicEnemyTurnSpecies], a ld a, $1 - ld [hWhoseTurn], a + ldh [hWhoseTurn], a callab ChangeMonPic ; alternate between black and light grey 8 times. ; this makes the ghost's body appear to flash @@ -23,10 +23,10 @@ MarowakAnim: .fadeOutGhostLoop ld c, 10 call DelayFrames - ld a, [rOBP1] + ldh a, [rOBP1] sla a sla a - ld [rOBP1], a + ldh [rOBP1], a jr nz, .fadeOutGhostLoop call ClearSprites call CopyMonPicFromBGToSpriteVRAM ; copy Marowak pic from BG to sprite VRAM @@ -34,17 +34,17 @@ MarowakAnim: .fadeInMarowakLoop ld c, 10 call DelayFrames - ld a, [rOBP1] + ldh a, [rOBP1] srl b rra srl b rra - ld [rOBP1], a + ldh [rOBP1], a ld a, b and a jr nz, .fadeInMarowakLoop ld a, $1 - ld [hAutoBGTransferEnabled], a ; enable BG transfer so the BG Marowak pic will be visible after the sprite one is cleared + ldh [hAutoBGTransferEnabled], a ; enable BG transfer so the BG Marowak pic will be visible after the sprite one is cleared call Delay3 jp ClearSprites diff --git a/engine/battle/init_battle_variables.asm b/engine/battle/init_battle_variables.asm index 7bc912d2..d670319c 100644 --- a/engine/battle/init_battle_variables.asm +++ b/engine/battle/init_battle_variables.asm @@ -1,5 +1,5 @@ InitBattleVariables: - ld a, [hTilesetType] + ldh a, [hTilesetType] ld [wSavedTilesetType], a xor a ld [wActionResultOrTookBattleTurn], a diff --git a/engine/battle/move_effects/conversion.asm b/engine/battle/move_effects/conversion.asm index 662f65e0..1f64ec5b 100644 --- a/engine/battle/move_effects/conversion.asm +++ b/engine/battle/move_effects/conversion.asm @@ -1,7 +1,7 @@ ConversionEffect_: ld hl, wEnemyMonType1 ld de, wBattleMonType1 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, [wEnemyBattleStatus1] jr z, .conversionEffect diff --git a/engine/battle/move_effects/drain_hp.asm b/engine/battle/move_effects/drain_hp.asm index 452ccf0c..74e5d376 100644 --- a/engine/battle/move_effects/drain_hp.asm +++ b/engine/battle/move_effects/drain_hp.asm @@ -14,7 +14,7 @@ DrainHPEffect_: .getAttackerHP ld hl, wBattleMonHP ld de, wBattleMonMaxHP - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jp z, .addDamageToAttackerHP ld hl, wEnemyMonHP @@ -69,7 +69,7 @@ DrainHPEffect_: ld [wHPBarNewHP+1], a inc de .next - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a coord hl, 10, 9 ld a, $1 @@ -83,7 +83,7 @@ DrainHPEffect_: predef DrawEnemyHUDAndHPBar callab ReadPlayerMonCurHPAndStatus ld hl, SuckedHealthText - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, [wPlayerMoveEffect] jr z, .next3 diff --git a/engine/battle/move_effects/focus_energy.asm b/engine/battle/move_effects/focus_energy.asm index 7a426d2c..fd04e024 100644 --- a/engine/battle/move_effects/focus_energy.asm +++ b/engine/battle/move_effects/focus_energy.asm @@ -1,6 +1,6 @@ FocusEnergyEffect_: ld hl, wPlayerBattleStatus2 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .notEnemy ld hl, wEnemyBattleStatus2 diff --git a/engine/battle/move_effects/haze.asm b/engine/battle/move_effects/haze.asm index 521ff662..915eeed8 100644 --- a/engine/battle/move_effects/haze.asm +++ b/engine/battle/move_effects/haze.asm @@ -15,7 +15,7 @@ HazeEffect_: ; cure non-volatile status, but only for the target ld hl, wEnemyMonStatus ld de, wEnemySelectedMove - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .cureStatuses ld hl, wBattleMonStatus diff --git a/engine/battle/move_effects/heal.asm b/engine/battle/move_effects/heal.asm index 8cc9da93..d12b1ea4 100644 --- a/engine/battle/move_effects/heal.asm +++ b/engine/battle/move_effects/heal.asm @@ -1,5 +1,5 @@ HealEffect_: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld de, wBattleMonHP ld hl, wBattleMonMaxHP @@ -27,7 +27,7 @@ HealEffect_: ld c, 50 call DelayFrames ld hl, wBattleMonStatus - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .restEffect ld hl, wEnemyMonStatus @@ -87,7 +87,7 @@ HealEffect_: .playAnim ld hl, PlayCurrentMoveAnimation call BankswitchEtoF - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a coord hl, 10, 9 ld a, $1 diff --git a/engine/battle/move_effects/leech_seed.asm b/engine/battle/move_effects/leech_seed.asm index 74360233..061c0073 100644 --- a/engine/battle/move_effects/leech_seed.asm +++ b/engine/battle/move_effects/leech_seed.asm @@ -5,7 +5,7 @@ LeechSeedEffect_: jr nz, .moveMissed ld hl, wEnemyBattleStatus2 ld de, wEnemyMonType1 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .leechSeedEffect ld hl, wPlayerBattleStatus2 diff --git a/engine/battle/move_effects/mist.asm b/engine/battle/move_effects/mist.asm index 67ee4921..a9cb21b8 100644 --- a/engine/battle/move_effects/mist.asm +++ b/engine/battle/move_effects/mist.asm @@ -1,6 +1,6 @@ MistEffect_: ld hl, wPlayerBattleStatus2 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .mistEffect ld hl, wEnemyBattleStatus2 diff --git a/engine/battle/move_effects/one_hit_ko.asm b/engine/battle/move_effects/one_hit_ko.asm index 347a4c7b..7e5db0f7 100644 --- a/engine/battle/move_effects/one_hit_ko.asm +++ b/engine/battle/move_effects/one_hit_ko.asm @@ -7,7 +7,7 @@ OneHitKOEffect_: ld [wCriticalHitOrOHKO], a ld hl, wBattleMonSpeed + 1 ld de, wEnemyMonSpeed + 1 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .compareSpeed ld hl, wEnemyMonSpeed + 1 diff --git a/engine/battle/move_effects/paralyze.asm b/engine/battle/move_effects/paralyze.asm index b01aa5cf..d828e333 100644 --- a/engine/battle/move_effects/paralyze.asm +++ b/engine/battle/move_effects/paralyze.asm @@ -1,7 +1,7 @@ ParalyzeEffect_: ld hl, wEnemyMonStatus ld de, wPlayerMoveType - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jp z, .next ld hl, wBattleMonStatus diff --git a/engine/battle/move_effects/pay_day.asm b/engine/battle/move_effects/pay_day.asm index 11140ec2..fa373038 100644 --- a/engine/battle/move_effects/pay_day.asm +++ b/engine/battle/move_effects/pay_day.asm @@ -2,7 +2,7 @@ PayDayEffect_: xor a ld hl, wcd6d ld [hli], a - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, [wBattleMonLevel] jr z, .payDayEffect @@ -10,28 +10,28 @@ PayDayEffect_: .payDayEffect ; level * 2 add a - ld [hDividend + 3], a + ldh [hDividend + 3], a xor a - ld [hDividend], a - ld [hDividend + 1], a - ld [hDividend + 2], a + ldh [hDividend], a + ldh [hDividend + 1], a + ldh [hDividend + 2], a ; convert to BCD ld a, 100 - ld [hDivisor], a + ldh [hDivisor], a ld b, $4 call Divide - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] ld [hli], a - ld a, [hRemainder] - ld [hDividend + 3], a + ldh a, [hRemainder] + ldh [hDividend + 3], a ld a, 10 - ld [hDivisor], a + ldh [hDivisor], a ld b, $4 call Divide - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] swap a ld b, a - ld a, [hRemainder] + ldh a, [hRemainder] add b ld [hl], a ld de, wTotalPayDayMoney + 2 diff --git a/engine/battle/move_effects/recoil.asm b/engine/battle/move_effects/recoil.asm index 63aff429..aa2a3fed 100644 --- a/engine/battle/move_effects/recoil.asm +++ b/engine/battle/move_effects/recoil.asm @@ -1,5 +1,5 @@ RecoilEffect_: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, [wPlayerMoveNum] ld hl, wBattleMonMaxHP @@ -54,7 +54,7 @@ RecoilEffect_: ld [hl], a .getHPBarCoords coord hl, 10, 9 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, $1 jr z, .updateHPBar diff --git a/engine/battle/move_effects/reflect_light_screen.asm b/engine/battle/move_effects/reflect_light_screen.asm index 07338c9a..7bdc7be7 100644 --- a/engine/battle/move_effects/reflect_light_screen.asm +++ b/engine/battle/move_effects/reflect_light_screen.asm @@ -1,7 +1,7 @@ ReflectLightScreenEffect_: ld hl, wPlayerBattleStatus3 ld de, wPlayerMoveEffect - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .reflectLightScreenEffect ld hl, wEnemyBattleStatus3 diff --git a/engine/battle/move_effects/substitute.asm b/engine/battle/move_effects/substitute.asm index 95c43462..eb6d0e89 100644 --- a/engine/battle/move_effects/substitute.asm +++ b/engine/battle/move_effects/substitute.asm @@ -4,7 +4,7 @@ SubstituteEffect_: ld hl, wBattleMonMaxHP ld de, wPlayerSubstituteHP ld bc, wPlayerBattleStatus2 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .notEnemy ld hl, wEnemyMonMaxHP diff --git a/engine/battle/move_effects/transform.asm b/engine/battle/move_effects/transform.asm index da26d031..46cea51c 100644 --- a/engine/battle/move_effects/transform.asm +++ b/engine/battle/move_effects/transform.asm @@ -3,7 +3,7 @@ TransformEffect_: ld de, wEnemyMonSpecies ld bc, wEnemyBattleStatus3 ld a, [wEnemyBattleStatus1] - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr nz, .hitTest ld hl, wEnemyMonSpecies @@ -18,7 +18,7 @@ TransformEffect_: push de push bc ld hl, wPlayerBattleStatus2 - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .transformEffect ld hl, wEnemyBattleStatus2 @@ -64,7 +64,7 @@ TransformEffect_: inc bc inc bc call CopyData - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .next ; save enemy mon DVs at wTransformedEnemyMonOriginalDVs @@ -128,7 +128,7 @@ TransformEffect_: jp PrintText .copyBasedOnTurn - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a jr z, .gotStatsOrModsToCopy push hl diff --git a/engine/battle/scale_sprites.asm b/engine/battle/scale_sprites.asm index 11967ba1..69979412 100644 --- a/engine/battle/scale_sprites.asm +++ b/engine/battle/scale_sprites.asm @@ -41,16 +41,16 @@ ScaleFirstThreeSpriteColumnsByTwo: ScaleLastSpriteColumnByTwo: ld a, 4*8 - 4 ; $1c, 4 tiles minus 4 unused rows - ld [hSpriteInterlaceCounter], a + ldh [hSpriteInterlaceCounter], a ld bc, -1 .columnInnerLoop ld a, [de] dec de swap a ; only high nybble contains information call ScalePixelsByTwo - ld a, [hSpriteInterlaceCounter] + ldh a, [hSpriteInterlaceCounter] dec a - ld [hSpriteInterlaceCounter], a + ldh [hSpriteInterlaceCounter], a jr nz, .columnInnerLoop dec de ; skip last 4 rows of new column dec de diff --git a/engine/battle/trainer_ai.asm b/engine/battle/trainer_ai.asm index 8373ef4f..3e444f8b 100644 --- a/engine/battle/trainer_ai.asm +++ b/engine/battle/trainer_ai.asm @@ -655,17 +655,17 @@ AIUseDireHit: ; unused AICheckIfHPBelowFraction: ; return carry if enemy trainer's current HP is below 1 / a of the maximum - ld [hDivisor], a + ldh [hDivisor], a ld hl, wEnemyMonMaxHP ld a, [hli] - ld [hDividend], a + ldh [hDividend], a ld a, [hl] - ld [hDividend + 1], a + ldh [hDividend + 1], a ld b, 2 call Divide - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] ld c, a - ld a, [hQuotient + 2] + ldh a, [hQuotient + 2] ld b, a ld hl, wEnemyMonHP + 1 ld a, [hld] diff --git a/engine/battle/unused_stats_functions.asm b/engine/battle/unused_stats_functions.asm index fb3422c7..5174adf5 100644 --- a/engine/battle/unused_stats_functions.asm +++ b/engine/battle/unused_stats_functions.asm @@ -1,6 +1,6 @@ ; does nothing since no stats are ever selected (barring glitches) DoubleSelectedStats: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, [wPlayerStatsToDouble] ld hl, wBattleMonAttack + 1 @@ -30,7 +30,7 @@ DoubleSelectedStats: ; does nothing since no stats are ever selected (barring glitches) HalveSelectedStats: - ld a, [hWhoseTurn] + ldh a, [hWhoseTurn] and a ld a, [wPlayerStatsToHalve] ld hl, wBattleMonAttack diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm index 9d6fcb8d..9b637f97 100644 --- a/engine/battle/wild_encounters.asm +++ b/engine/battle/wild_encounters.asm @@ -48,10 +48,10 @@ TryDoWildEncounter: .CanEncounter ; compare encounter chance with a random number to determine if there will be an encounter ld b, a - ld a, [hRandomAdd] + ldh a, [hRandomAdd] cp b jr nc, .CantEncounter2 - ld a, [hRandomSub] + ldh a, [hRandomSub] ld b, a ld hl, WildMonEncounterSlotChances .determineEncounterSlot @@ -90,7 +90,7 @@ TryDoWildEncounter: .lastRepelStep ld [wRepelRemainingSteps], a ld a, TEXT_REPEL_WORE_OFF - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call EnableAutoTextBoxDrawing call DisplayTextID .CantEncounter2 -- cgit v1.3.1-sl0p From 77ed5f3820301f9f301f12bf2f201d9bdab9e7e1 Mon Sep 17 00:00:00 2001 From: Rangi Date: Mon, 6 Jul 2020 21:15:12 -0400 Subject: Use ASCII quotes in comments --- engine/battle/animations.asm | 2 +- engine/battle/core.asm | 4 ++-- engine/events/hidden_objects/gym_statues.asm | 2 +- scripts/PalletTown.asm | 8 ++++---- wram.asm | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'engine/battle') diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index c9f53961..f19f1f4f 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -425,7 +425,7 @@ ShareMoveAnimations: and a ret z - ; opponent’s turn + ; opponent's turn ld a, [wAnimationID] diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 24ae8dfc..8cb3cd0a 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -3255,14 +3255,14 @@ PrintGhostText: ldh a, [hWhoseTurn] and a jr nz, .Ghost - ld a, [wBattleMonStatus] ; player’s turn + ld a, [wBattleMonStatus] ; player's turn and SLP | (1 << FRZ) ret nz ld hl, ScaredText call PrintText xor a ret -.Ghost ; ghost’s turn +.Ghost ; ghost's turn ld hl, GetOutText call PrintText xor a diff --git a/engine/events/hidden_objects/gym_statues.asm b/engine/events/hidden_objects/gym_statues.asm index 1f592f2f..97b01a3a 100644 --- a/engine/events/hidden_objects/gym_statues.asm +++ b/engine/events/hidden_objects/gym_statues.asm @@ -1,6 +1,6 @@ GymStatues: ; if in a gym and have the corresponding badge, a = GymStatueText2_id and jp PrintPredefTextID -; if in a gym and don’t have the corresponding badge, a = GymStatueText1_id and jp PrintPredefTextID +; if in a gym and don't have the corresponding badge, a = GymStatueText1_id and jp PrintPredefTextID ; else ret call EnableAutoTextBoxDrawing ld a, [wSpritePlayerStateData1FacingDirection] diff --git a/scripts/PalletTown.asm b/scripts/PalletTown.asm index 5c4c4de8..5c26fc55 100755 --- a/scripts/PalletTown.asm +++ b/scripts/PalletTown.asm @@ -31,7 +31,7 @@ PalletTownScript0: call PlaySound ld a, BANK(Music_MeetProfOak) ld c, a - ld a, MUSIC_MEET_PROF_OAK ; “oak appears” music + ld a, MUSIC_MEET_PROF_OAK ; "oak appears" music call PlayMusic ld a, $FC ld [wJoyIgnore], a @@ -76,7 +76,7 @@ PalletTownScript2: predef CalcPositionOfPlayerRelativeToNPC ld hl, hNPCPlayerYDistance dec [hl] - predef FindPathToPlayer ; load Oak’s movement into wNPCMovementDirections2 + predef FindPathToPlayer ; load Oak's movement into wNPCMovementDirections2 ld de, wNPCMovementDirections2 ld a, 1 ; oak ldh [hSpriteIndex], a @@ -205,10 +205,10 @@ PalletTownText5: ; sign by fence text_far _PalletTownText5 text_end -PalletTownText6: ; sign by Red’s house +PalletTownText6: ; sign by Red's house text_far _PalletTownText6 text_end -PalletTownText7: ; sign by Blue’s house +PalletTownText7: ; sign by Blue's house text_far _PalletTownText7 text_end diff --git a/wram.asm b/wram.asm index 36ea5d0b..ab0d25d2 100755 --- a/wram.asm +++ b/wram.asm @@ -2295,7 +2295,7 @@ wCurrentTileBlockMapViewPointer:: ds 2 wYCoord:: -; player’s position on the current map +; player's position on the current map ds 1 wXCoord:: -- cgit v1.3.1-sl0p From 06db7ec55bbc87ed18db72a53fb20fa7b4da9b29 Mon Sep 17 00:00:00 2001 From: Rangi Date: Mon, 6 Jul 2020 21:18:22 -0400 Subject: callba/callab -> farcall/callfar; jpba/jpab -> farjp/jpfar --- engine/battle/common_text.asm | 8 ++-- engine/battle/core.asm | 58 ++++++++++++++-------------- engine/battle/effects.asm | 28 +++++++------- engine/battle/end_of_battle.asm | 2 +- engine/battle/experience.asm | 16 ++++---- engine/battle/ghost_marowak_anim.asm | 2 +- engine/battle/init_battle_variables.asm | 2 +- engine/battle/link_battle_versus_text.asm | 2 +- engine/battle/move_effects/drain_hp.asm | 2 +- engine/battle/move_effects/focus_energy.asm | 4 +- engine/battle/move_effects/leech_seed.asm | 4 +- engine/battle/move_effects/mist.asm | 4 +- engine/battle/move_effects/paralyze.asm | 12 +++--- engine/battle/move_effects/substitute.asm | 2 +- engine/battle/scroll_draw_trainer_pic.asm | 2 +- engine/battle/trainer_ai.asm | 6 +-- engine/battle/wild_encounters.asm | 4 +- engine/events/cinnabar_lab.asm | 2 +- engine/events/diploma.asm | 4 +- engine/events/evolve_trade.asm | 2 +- engine/events/give_pokemon.asm | 4 +- engine/events/hidden_objects/bookshelves.asm | 2 +- engine/events/hidden_objects/town_map.asm | 2 +- engine/events/in_game_trades.asm | 6 +-- engine/events/pokecenter.asm | 2 +- engine/events/pokedex_rating.asm | 2 +- engine/events/pokemart.asm | 4 +- engine/events/saffron_guards.asm | 2 +- engine/items/item_effects.asm | 28 +++++++------- engine/items/town_map.asm | 2 +- engine/link/cable_club.asm | 10 ++--- engine/link/cable_club_npc.asm | 4 +- engine/menus/league_pc.asm | 4 +- engine/menus/naming_screen.asm | 8 ++-- engine/menus/party_menu.asm | 6 +-- engine/menus/pc.asm | 10 ++--- engine/menus/pokedex.asm | 4 +- engine/menus/save.asm | 2 +- engine/menus/start_sub_menus.asm | 4 +- engine/movie/credits.asm | 4 +- engine/movie/intro.asm | 4 +- engine/movie/oak_speech/clear_save.asm | 2 +- engine/movie/title.asm | 8 ++-- engine/movie/trade.asm | 4 +- engine/overworld/cut.asm | 2 +- engine/overworld/dust_smoke.asm | 2 +- engine/overworld/player_state.asm | 2 +- engine/overworld/push_boulder.asm | 2 +- engine/pokemon/add_mon.asm | 4 +- engine/pokemon/bills_pc.asm | 2 +- engine/pokemon/evos_moves.asm | 2 +- engine/pokemon/learn_move.asm | 2 +- engine/pokemon/load_mon_data.asm | 2 +- engine/pokemon/status_screen.asm | 6 +-- engine/slots/game_corner_slots.asm | 2 +- home.asm | 30 +++++++------- home/move_mon.asm | 4 +- home/overworld.asm | 40 +++++++++---------- home/pokemon.asm | 6 +-- home/serial.asm | 2 +- home/start_menu.asm | 4 +- home/text_script.asm | 10 ++--- home/trainers.asm | 6 +-- home/vblank.asm | 2 +- macros/farcall.asm | 10 ++--- scripts/BikeShop.asm | 2 +- scripts/CeladonMansion3F.asm | 2 +- scripts/CeladonMartElevator.asm | 2 +- scripts/CeladonMartRoof.asm | 2 +- scripts/CeruleanCity.asm | 4 +- scripts/ChampionsRoom.asm | 2 +- scripts/CinnabarLabFossilRoom.asm | 4 +- scripts/CopycatsHouse2F.asm | 2 +- scripts/Daycare.asm | 6 +-- scripts/HallOfFame.asm | 2 +- scripts/NameRatersHouse.asm | 2 +- scripts/OaksLab.asm | 6 +-- scripts/PokemonTower2F.asm | 2 +- scripts/RocketHideoutElevator.asm | 2 +- scripts/Route22.asm | 6 +-- scripts/Route5Gate.asm | 4 +- scripts/Route6Gate.asm | 2 +- scripts/Route7Gate.asm | 2 +- scripts/Route8Gate.asm | 2 +- scripts/SSAnne2F.asm | 2 +- scripts/SilphCo7F.asm | 2 +- scripts/SilphCoElevator.asm | 2 +- scripts/VermilionDock.asm | 2 +- scripts/ViridianGym.asm | 2 +- scripts/WardensHouse.asm | 2 +- 90 files changed, 251 insertions(+), 253 deletions(-) (limited to 'engine/battle') diff --git a/engine/battle/common_text.asm b/engine/battle/common_text.asm index b65bb84b..9f6f90b6 100644 --- a/engine/battle/common_text.asm +++ b/engine/battle/common_text.asm @@ -24,7 +24,7 @@ PrintBeginningBattleText: ld hl, TrainerWantsToFightText .wildBattle push hl - callab DrawAllPokeballs + callfar DrawAllPokeballs pop hl call PrintText jr .done @@ -38,7 +38,7 @@ PrintBeginningBattleText: ld a, b and a jr z, .noSilphScope - callab LoadEnemyMonData + callfar LoadEnemyMonData jr .notPokemonTower .noSilphScope ld hl, EnemyAppearedText @@ -54,8 +54,8 @@ PrintBeginningBattleText: call PrintText ld hl, UnveiledGhostText call PrintText - callab LoadEnemyMonData - callab MarowakAnim + callfar LoadEnemyMonData + callfar MarowakAnim ld hl, WildMonAppearedText call PrintText diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 8cb3cd0a..4d999d2a 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -97,7 +97,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: ld b, SET_PAL_BATTLE call RunPaletteCommand call HideSprites - jpab PrintBeginningBattleText + jpfar PrintBeginningBattleText ; when a battle is starting, silhouettes of the player's pic and the enemy's pic are slid onto the screen ; the lower of the player's pic (his body) is part of the background, but his head is a sprite @@ -178,7 +178,7 @@ StartBattle: ld hl, .outOfSafariBallsText jp PrintText .notOutOfSafariBalls - callab PrintSafariZoneBattleText + callfar PrintSafariZoneBattleText ld a, [wEnemyMonSpeed + 1] add a ld b, a ; init b (which is later compared with random value) to (enemy speed % 256) * 2 @@ -267,7 +267,7 @@ EnemyRan: call PlaySoundWaitForCurrent xor a ldh [hWhoseTurn], a - jpab AnimationSlideEnemyMonOff + jpfar AnimationSlideEnemyMonOff WildRanText: text_far _WildRanText @@ -365,7 +365,7 @@ MainInBattleLoop: jr nz, .specialMoveNotUsed ld [wPlayerSelectedMove], a .specialMoveNotUsed - callab SwitchEnemyMon + callfar SwitchEnemyMon .noLinkBattle ld a, [wPlayerSelectedMove] cp QUICK_ATTACK @@ -413,7 +413,7 @@ MainInBattleLoop: .enemyMovesFirst ld a, $1 ldh [hWhoseTurn], a - callab TrainerAI + callfar TrainerAI jr c, .AIActionUsedEnemyFirst call ExecuteEnemyMove ld a, [wEscapedFromBattle] @@ -451,7 +451,7 @@ MainInBattleLoop: call DrawHUDsAndHPBars ld a, $1 ldh [hWhoseTurn], a - callab TrainerAI + callfar TrainerAI jr c, .AIActionUsedPlayerFirst call ExecuteEnemyMove ld a, [wEscapedFromBattle] @@ -837,7 +837,7 @@ FaintEnemyPokemon: .giveExpToMonsThatFought xor a ld [wBoostExpByExpAll], a - callab GainExperience + callfar GainExperience pop af ret z ; return if no exp all @@ -855,7 +855,7 @@ FaintEnemyPokemon: jr nz, .gainExpFlagsLoop ld a, b ld [wPartyGainExpFlags], a - jpab GainExperience + jpfar GainExperience EnemyMonFaintedText: text_far _EnemyMonFaintedText @@ -893,7 +893,7 @@ ReplaceFaintedEnemyMon: ld hl, wEnemyHPBarColor ld e, $30 call GetBattleHealthBarColor - callab DrawEnemyPokeballs + callfar DrawEnemyPokeballs ld a, [wLinkState] cp LINK_STATE_BATTLING jr nz, .notLinkBattle @@ -1720,7 +1720,7 @@ LoadEnemyMonFromParty: ret SendOutMon: - callab PrintSendOutMonMessage + callfar PrintSendOutMonMessage ld hl, wEnemyMonHP ld a, [hli] or [hl] ; is enemy mon HP zero? @@ -1816,7 +1816,7 @@ DrawPlayerHUDAndHPBar: coord hl, 9, 7 lb bc, 5, 11 call ClearScreenArea - callab PlacePlayerHUDTiles + callfar PlacePlayerHUDTiles coord hl, 18, 9 ld [hl], $73 ld de, wBattleMonNick @@ -1877,7 +1877,7 @@ DrawEnemyHUDAndHPBar: coord hl, 0, 0 lb bc, 4, 12 call ClearScreenArea - callab PlaceEnemyHUDTiles + callfar PlaceEnemyHUDTiles ld de, wEnemyMonNick coord hl, 1, 0 call CenterMonName @@ -2411,7 +2411,7 @@ PartyMenuOrRockOrRun: ; fall through to SwitchPlayerMon SwitchPlayerMon: - callab RetreatMon + callfar RetreatMon ld c, 50 call DelayFrames call AnimateRetreatingPlayerMon @@ -2464,7 +2464,7 @@ MoveSelectionMenu: ld de, wMoves ld bc, NUM_MOVES call CopyData - callab FormatMovesString + callfar FormatMovesString ret .writemoves @@ -2860,7 +2860,7 @@ PrintMenuItem: ld [wWhichPokemon], a ld a, BATTLE_MON_DATA ld [wMonDataLocation], a - callab GetMaxPP + callfar GetMaxPP ld hl, wCurrentMenuItem ld c, [hl] inc [hl] @@ -2955,7 +2955,7 @@ SelectEnemyMove: ld a, [wIsInBattle] dec a jr z, .chooseRandomMove ; wild encounter - callab AIEnemyTrainerChooseMoves + callfar AIEnemyTrainerChooseMoves .chooseRandomMove push hl call BattleRandom @@ -3020,7 +3020,7 @@ LinkBattleExchangeData: ld a, b .doExchange ld [wSerialExchangeNybbleSendData], a - callab PrintWaitingText + callfar PrintWaitingText .syncLoop1 call Serial_ExchangeNybble call DelayFrame @@ -3196,7 +3196,7 @@ MirrorMoveCheck: .moveDidNotMiss call ApplyAttackToEnemyPokemon call PrintCriticalOHKOText - callab DisplayEffectiveness + callfar DisplayEffectiveness ld a, 1 ld [wMoveDidntMiss], a .notDone @@ -4988,7 +4988,7 @@ AttackSubstitute: ldh a, [hWhoseTurn] xor $01 ldh [hWhoseTurn], a - callab HideSubstituteShowMonAnim ; animate the substitute breaking + callfar HideSubstituteShowMonAnim ; animate the substitute breaking ; flip the turn back to the way it was ldh a, [hWhoseTurn] xor $01 @@ -5726,7 +5726,7 @@ EnemyCheckIfMirrorMoveEffect: .moveDidNotMiss call ApplyAttackToPlayerPokemon call PrintCriticalOHKOText - callab DisplayEffectiveness + callfar DisplayEffectiveness ld a, 1 ld [wMoveDidntMiss], a .handleExplosionMiss @@ -6254,14 +6254,14 @@ DoBattleTransitionAndInitBattleVariables: ; link battle xor a ld [wMenuJoypadPollCount], a - callab DisplayLinkBattleVersusTextBox + callfar DisplayLinkBattleVersusTextBox ld a, $1 ld [wUpdateSpritesEnabled], a call ClearScreen .next call DelayFrame predef BattleTransition - callab LoadHudAndHpBarAndStatusTilePatterns + callfar LoadHudAndHpBarAndStatusTilePatterns ld a, $1 ldh [hAutoBGTransferEnabled], a ld a, $ff @@ -6359,11 +6359,11 @@ LoadPlayerBackPic: ; does nothing since no stats are ever selected (barring glitches) DoubleOrHalveSelectedStats: - callab DoubleSelectedStats - jpab HalveSelectedStats + callfar DoubleSelectedStats + jpfar HalveSelectedStats ScrollTrainerPicAfterBattle: - jpab _ScrollTrainerPicAfterBattle + jpfar _ScrollTrainerPicAfterBattle ApplyBurnAndParalysisPenaltiesToPlayer: ld a, $1 @@ -6747,7 +6747,7 @@ DetermineWildOpponent: ld a, [wNumberOfNoRandomBattleStepsLeft] and a ret nz - callab TryDoWildEncounter + callfar TryDoWildEncounter ret nz InitBattleCommon: ld a, [wMapPalOffset] @@ -6756,13 +6756,13 @@ InitBattleCommon: ld a, [hl] push af res 1, [hl] - callab InitBattleVariables + callfar InitBattleVariables ld a, [wEnemyMonSpecies2] sub OPP_ID_OFFSET jp c, InitWildBattle ld [wTrainerClass], a call GetTrainerInformation - callab ReadTrainer + callfar ReadTrainer call DoBattleTransitionAndInitBattleVariables call _LoadTrainerPic xor a @@ -6857,7 +6857,7 @@ _InitBattleCommon: dec a ; is it a wild battle? call z, DrawEnemyHUDAndHPBar ; draw enemy HUD and HP bar if it's a wild battle call StartBattle - callab EndOfBattle + callfar EndOfBattle pop af ld [wLetterPrintingDelayFlags], a pop af diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm index c3a2a213..fe050937 100644 --- a/engine/battle/effects.asm +++ b/engine/battle/effects.asm @@ -170,7 +170,7 @@ BadlyPoisonedText: text_end DrainHPEffect: - jpab DrainHPEffect_ + jpfar DrainHPEffect_ ExplodeEffect: ld hl, wBattleMonHP @@ -987,7 +987,7 @@ FlinchSideEffect: ret OneHitKOEffect: - jpab OneHitKOEffect_ + jpfar OneHitKOEffect_ ChargeEffect: ld hl, wPlayerBattleStatus1 @@ -1097,13 +1097,13 @@ TrappingEffect: ret MistEffect: - jpab MistEffect_ + jpfar MistEffect_ FocusEnergyEffect: - jpab FocusEnergyEffect_ + jpfar FocusEnergyEffect_ RecoilEffect: - jpab RecoilEffect_ + jpfar RecoilEffect_ ConfusionSideEffect: call BattleRandom @@ -1157,10 +1157,10 @@ ConfusionEffectFailed: jp ConditionalPrintButItFailed ParalyzeEffect: - jpab ParalyzeEffect_ + jpfar ParalyzeEffect_ SubstituteEffect: - jpab SubstituteEffect_ + jpfar SubstituteEffect_ HyperBeamEffect: ld hl, wPlayerBattleStatus2 @@ -1271,7 +1271,7 @@ MimicLearnedMoveText: text_end LeechSeedEffect: - jpab LeechSeedEffect_ + jpfar LeechSeedEffect_ SplashEffect: call PlayCurrentMoveAnimation @@ -1365,22 +1365,22 @@ MoveWasDisabledText: text_end PayDayEffect: - jpab PayDayEffect_ + jpfar PayDayEffect_ ConversionEffect: - jpab ConversionEffect_ + jpfar ConversionEffect_ HazeEffect: - jpab HazeEffect_ + jpfar HazeEffect_ HealEffect: - jpab HealEffect_ + jpfar HealEffect_ TransformEffect: - jpab TransformEffect_ + jpfar TransformEffect_ ReflectLightScreenEffect: - jpab ReflectLightScreenEffect_ + jpfar ReflectLightScreenEffect_ NothingHappenedText: text_far _NothingHappenedText diff --git a/engine/battle/end_of_battle.asm b/engine/battle/end_of_battle.asm index f490c34d..aa96f31d 100755 --- a/engine/battle/end_of_battle.asm +++ b/engine/battle/end_of_battle.asm @@ -10,7 +10,7 @@ EndOfBattle: ld a, [wEnemyMonStatus] ld [hl], a call ClearScreen - callab DisplayLinkBattleVersusTextBox + callfar DisplayLinkBattleVersusTextBox ld a, [wBattleResult] cp $1 ld de, YouWinText diff --git a/engine/battle/experience.asm b/engine/battle/experience.asm index 2e21d874..0eab6e08 100644 --- a/engine/battle/experience.asm +++ b/engine/battle/experience.asm @@ -117,7 +117,7 @@ GainExperience: ld [wd0b5], a call GetMonHeader ld d, MAX_LEVEL - callab CalcExperience ; get max exp + callfar CalcExperience ; get max exp ; compare max exp with current exp ldh a, [hExperience] ld b, a @@ -155,7 +155,7 @@ GainExperience: ld bc, wPartyMon1Level - wPartyMon1Exp add hl, bc push hl - callba CalcLevelFromExperience + farcall CalcLevelFromExperience pop hl ld a, [hl] ; current level cp d @@ -233,11 +233,11 @@ GainExperience: .recalcStatChanges xor a ; battle mon ld [wCalculateWhoseStats], a - callab CalculateModifiedStats - callab ApplyBurnAndParalysisPenaltiesToPlayer - callab ApplyBadgeStatBoosts - callab DrawPlayerHUDAndHPBar - callab PrintEmptyString + callfar CalculateModifiedStats + callfar ApplyBurnAndParalysisPenaltiesToPlayer + callfar ApplyBadgeStatBoosts + callfar DrawPlayerHUDAndHPBar + callfar PrintEmptyString call SaveScreenTilesToBuffer1 .printGrewLevelText ld hl, GrewLevelText @@ -246,7 +246,7 @@ GainExperience: ld [wMonDataLocation], a call LoadMonData ld d, $1 - callab PrintStatsBox + callfar PrintStatsBox call WaitForTextScrollButtonPress call LoadScreenTilesFromBuffer1 xor a ; PLAYER_PARTY_DATA diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm index bef680fe..9c47fd53 100644 --- a/engine/battle/ghost_marowak_anim.asm +++ b/engine/battle/ghost_marowak_anim.asm @@ -15,7 +15,7 @@ MarowakAnim: ld [wChangeMonPicEnemyTurnSpecies], a ld a, $1 ldh [hWhoseTurn], a - callab ChangeMonPic + callfar ChangeMonPic ; alternate between black and light grey 8 times. ; this makes the ghost's body appear to flash ld d, $80 diff --git a/engine/battle/init_battle_variables.asm b/engine/battle/init_battle_variables.asm index d670319c..0d403b55 100644 --- a/engine/battle/init_battle_variables.asm +++ b/engine/battle/init_battle_variables.asm @@ -35,4 +35,4 @@ InitBattleVariables: ld a, BATTLE_TYPE_SAFARI ld [wBattleType], a .notSafariBattle - jpab PlayBattleMusic + jpfar PlayBattleMusic diff --git a/engine/battle/link_battle_versus_text.asm b/engine/battle/link_battle_versus_text.asm index 76559117..22fec0f3 100644 --- a/engine/battle/link_battle_versus_text.asm +++ b/engine/battle/link_battle_versus_text.asm @@ -18,6 +18,6 @@ DisplayLinkBattleVersusTextBox: ld [hl], $6a xor a ld [wUpdateSpritesEnabled], a - callab SetupPlayerAndEnemyPokeballs + callfar SetupPlayerAndEnemyPokeballs ld c, 150 jp DelayFrames diff --git a/engine/battle/move_effects/drain_hp.asm b/engine/battle/move_effects/drain_hp.asm index 74e5d376..e7b241f6 100644 --- a/engine/battle/move_effects/drain_hp.asm +++ b/engine/battle/move_effects/drain_hp.asm @@ -81,7 +81,7 @@ DrainHPEffect_: predef UpdateHPBar2 predef DrawPlayerHUDAndHPBar predef DrawEnemyHUDAndHPBar - callab ReadPlayerMonCurHPAndStatus + callfar ReadPlayerMonCurHPAndStatus ld hl, SuckedHealthText ldh a, [hWhoseTurn] and a diff --git a/engine/battle/move_effects/focus_energy.asm b/engine/battle/move_effects/focus_energy.asm index fd04e024..1fafe920 100644 --- a/engine/battle/move_effects/focus_energy.asm +++ b/engine/battle/move_effects/focus_energy.asm @@ -8,13 +8,13 @@ FocusEnergyEffect_: bit GETTING_PUMPED, [hl] ; is mon already using focus energy? jr nz, .alreadyUsing set GETTING_PUMPED, [hl] ; mon is now using focus energy - callab PlayCurrentMoveAnimation + callfar PlayCurrentMoveAnimation ld hl, GettingPumpedText jp PrintText .alreadyUsing ld c, 50 call DelayFrames - jpab PrintButItFailedText_ + jpfar PrintButItFailedText_ GettingPumpedText: text_pause diff --git a/engine/battle/move_effects/leech_seed.asm b/engine/battle/move_effects/leech_seed.asm index 061c0073..61bd982a 100644 --- a/engine/battle/move_effects/leech_seed.asm +++ b/engine/battle/move_effects/leech_seed.asm @@ -1,5 +1,5 @@ LeechSeedEffect_: - callab MoveHitTest + callfar MoveHitTest ld a, [wMoveMissed] and a jr nz, .moveMissed @@ -22,7 +22,7 @@ LeechSeedEffect_: bit SEEDED, [hl] jr nz, .moveMissed set SEEDED, [hl] - callab PlayCurrentMoveAnimation + callfar PlayCurrentMoveAnimation ld hl, WasSeededText jp PrintText .moveMissed diff --git a/engine/battle/move_effects/mist.asm b/engine/battle/move_effects/mist.asm index a9cb21b8..163d386f 100644 --- a/engine/battle/move_effects/mist.asm +++ b/engine/battle/move_effects/mist.asm @@ -8,11 +8,11 @@ MistEffect_: bit PROTECTED_BY_MIST, [hl] ; is mon protected by mist? jr nz, .mistAlreadyInUse set PROTECTED_BY_MIST, [hl] ; mon is now protected by mist - callab PlayCurrentMoveAnimation + callfar PlayCurrentMoveAnimation ld hl, ShroudedInMistText jp PrintText .mistAlreadyInUse - jpab PrintButItFailedText_ + jpfar PrintButItFailedText_ ShroudedInMistText: text_far _ShroudedInMistText diff --git a/engine/battle/move_effects/paralyze.asm b/engine/battle/move_effects/paralyze.asm index d828e333..dbaa0fb8 100644 --- a/engine/battle/move_effects/paralyze.asm +++ b/engine/battle/move_effects/paralyze.asm @@ -26,22 +26,22 @@ ParalyzeEffect_: jr z, .doesntAffect .hitTest push hl - callab MoveHitTest + callfar MoveHitTest pop hl ld a, [wMoveMissed] and a jr nz, .didntAffect set PAR, [hl] - callab QuarterSpeedDueToParalysis + callfar QuarterSpeedDueToParalysis ld c, 30 call DelayFrames - callab PlayCurrentMoveAnimation - jpab PrintMayNotAttackText + callfar PlayCurrentMoveAnimation + jpfar PrintMayNotAttackText .didntAffect ld c, 50 call DelayFrames - jpab PrintDidntAffectText + jpfar PrintDidntAffectText .doesntAffect ld c, 50 call DelayFrames - jpab PrintDoesntAffectText + jpfar PrintDoesntAffectText diff --git a/engine/battle/move_effects/substitute.asm b/engine/battle/move_effects/substitute.asm index eb6d0e89..860b76b6 100644 --- a/engine/battle/move_effects/substitute.asm +++ b/engine/battle/move_effects/substitute.asm @@ -55,7 +55,7 @@ SubstituteEffect_: call Bankswitch ; jump to routine depending on animation setting ld hl, SubstituteText call PrintText - jpab DrawHUDsAndHPBars + jpfar DrawHUDsAndHPBars .alreadyHasSubstitute ld hl, HasSubstituteText jr .printText diff --git a/engine/battle/scroll_draw_trainer_pic.asm b/engine/battle/scroll_draw_trainer_pic.asm index 98893dcf..978fb71a 100644 --- a/engine/battle/scroll_draw_trainer_pic.asm +++ b/engine/battle/scroll_draw_trainer_pic.asm @@ -5,7 +5,7 @@ _ScrollTrainerPicAfterBattle: ld [wEnemyMonSpecies2], a ld b, SET_PAL_BATTLE call RunPaletteCommand - callab _LoadTrainerPic + callfar _LoadTrainerPic coord hl, 19, 0 ld c, $0 .scrollLoop diff --git a/engine/battle/trainer_ai.asm b/engine/battle/trainer_ai.asm index 3e444f8b..ea476538 100644 --- a/engine/battle/trainer_ai.asm +++ b/engine/battle/trainer_ai.asm @@ -204,7 +204,7 @@ AIMoveChoiceModification3: push hl push bc push de - callab AIGetTypeEffectiveness + callfar AIGetTypeEffectiveness pop de pop bc pop hl @@ -599,7 +599,7 @@ SwitchEnemyMon: ; switching in a new mon in response to this switch. ld a, 1 ld [wFirstMonsNotOutYet], a - callab EnemySendOut + callfar EnemySendOut xor a ld [wFirstMonsNotOutYet], a @@ -713,7 +713,7 @@ AIIncreaseStat: ld a, ANIM_AF ld [hli], a ld [hl], b - callab StatModifierUpEffect + callfar StatModifierUpEffect pop hl pop af ld [hli], a diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm index 9b637f97..3d0eb556 100644 --- a/engine/battle/wild_encounters.asm +++ b/engine/battle/wild_encounters.asm @@ -7,14 +7,14 @@ TryDoWildEncounter: ld a, [wd736] and a ret nz - callab IsPlayerStandingOnDoorTileOrWarpTile + callfar IsPlayerStandingOnDoorTileOrWarpTile jr nc, .notStandingOnDoorOrWarpTile .CantEncounter ld a, $1 and a ret .notStandingOnDoorOrWarpTile - callab IsPlayerJustOutsideMap + callfar IsPlayerJustOutsideMap jr z, .CantEncounter ld a, [wRepelRemainingSteps] and a diff --git a/engine/events/cinnabar_lab.asm b/engine/events/cinnabar_lab.asm index 0e0af0bb..aaa0428e 100755 --- a/engine/events/cinnabar_lab.asm +++ b/engine/events/cinnabar_lab.asm @@ -62,7 +62,7 @@ GiveFossilToCinnabarLab:: call PrintText ld a, [wFossilItem] ldh [hItemToRemoveID], a - callba RemoveItemByID + farcall RemoveItemByID ld hl, LabFossil_610b8 call PrintText SetEvents EVENT_GAVE_FOSSIL_TO_LAB, EVENT_LAB_STILL_REVIVING_FOSSIL diff --git a/engine/events/diploma.asm b/engine/events/diploma.asm index 9e9da9a5..95dabab3 100755 --- a/engine/events/diploma.asm +++ b/engine/events/diploma.asm @@ -38,7 +38,7 @@ DisplayDiploma:: coord hl, 10, 4 ld de, wPlayerName call PlaceString - callba DrawPlayerCharacter + farcall DrawPlayerCharacter ; Move the player 33 pixels right and set the priority bit so he appears ; behind the background layer. @@ -56,7 +56,7 @@ DisplayDiploma:: jr nz, .adjustPlayerGfxLoop call EnableLCD - callba LoadTrainerInfoTextBoxTiles + farcall LoadTrainerInfoTextBoxTiles ld b, SET_PAL_GENERIC call RunPaletteCommand call Delay3 diff --git a/engine/events/evolve_trade.asm b/engine/events/evolve_trade.asm index e17fc05c..56069fac 100755 --- a/engine/events/evolve_trade.asm +++ b/engine/events/evolve_trade.asm @@ -38,7 +38,7 @@ EvolveTradeMon: ld [wForceEvolution], a ld a, LINK_STATE_TRADING ld [wLinkState], a - callab TryEvolvingMon + callfar TryEvolvingMon xor a ; LINK_STATE_NONE ld [wLinkState], a jp PlayDefaultMusic diff --git a/engine/events/give_pokemon.asm b/engine/events/give_pokemon.asm index 041b9fb0..ef01ef99 100755 --- a/engine/events/give_pokemon.asm +++ b/engine/events/give_pokemon.asm @@ -15,9 +15,9 @@ _GivePokemon:: ld [wEnemyBattleStatus3], a ld a, [wcf91] ld [wEnemyMonSpecies2], a - callab LoadEnemyMonData + callfar LoadEnemyMonData call SetPokedexOwnedFlag - callab SendNewMonToBox + callfar SendNewMonToBox ld hl, wcf4b ld a, [wCurrentBoxNum] and $7f diff --git a/engine/events/hidden_objects/bookshelves.asm b/engine/events/hidden_objects/bookshelves.asm index daa8205d..23c087cc 100644 --- a/engine/events/hidden_objects/bookshelves.asm +++ b/engine/events/hidden_objects/bookshelves.asm @@ -34,6 +34,6 @@ PrintBookshelfText:: .noMatch ld a, $ff ldh [hFFDB], a - jpba PrintCardKeyText + farjp PrintCardKeyText INCLUDE "data/tilesets/bookshelf_tile_ids.asm" diff --git a/engine/events/hidden_objects/town_map.asm b/engine/events/hidden_objects/town_map.asm index 866d38c8..4284214f 100644 --- a/engine/events/hidden_objects/town_map.asm +++ b/engine/events/hidden_objects/town_map.asm @@ -12,7 +12,7 @@ TownMapText:: inc a ldh [hAutoBGTransferEnabled], a call LoadFontTilePatterns - callba DisplayTownMap + farcall DisplayTownMap ld hl, wd730 res 6, [hl] ld de, TextScriptEnd diff --git a/engine/events/in_game_trades.asm b/engine/events/in_game_trades.asm index a25abe0b..8a29d6a4 100755 --- a/engine/events/in_game_trades.asm +++ b/engine/events/in_game_trades.asm @@ -137,10 +137,10 @@ InGameTrade_DoTrade: ld [wMonDataLocation], a call AddPartyMon call InGameTrade_CopyDataToReceivedMon - callab EvolveTradeMon + callfar EvolveTradeMon call ClearScreen call InGameTrade_RestoreScreen - callba RedrawMapView + farcall RedrawMapView and a ld a, $3 jr .tradeSucceeded @@ -159,7 +159,7 @@ InGameTrade_RestoreScreen: call LoadGBPal ld c, 10 call DelayFrames - jpba LoadWildData + farjp LoadWildData InGameTrade_PrepareTradeData: ld hl, wTradedPlayerMonSpecies diff --git a/engine/events/pokecenter.asm b/engine/events/pokecenter.asm index 030c333f..97dbcd53 100755 --- a/engine/events/pokecenter.asm +++ b/engine/events/pokecenter.asm @@ -22,7 +22,7 @@ DisplayPokemonCenterDialogue_:: ld [wSprite01StateData1ImageIndex], a ; make the nurse turn to face the machine call Delay3 predef HealParty - callba AnimateHealingMachine ; do the healing machine animation + farcall AnimateHealingMachine ; do the healing machine animation xor a ld [wAudioFadeOutControl], a ld a, [wAudioSavedROMBank] diff --git a/engine/events/pokedex_rating.asm b/engine/events/pokedex_rating.asm index f17f7b17..490ae05a 100755 --- a/engine/events/pokedex_rating.asm +++ b/engine/events/pokedex_rating.asm @@ -30,7 +30,7 @@ DisplayDexRating: call PrintText pop hl call PrintText - callba PlayPokedexRatingSfx + farcall PlayPokedexRatingSfx jp WaitForTextScrollButtonPress .hallOfFame ld de, wDexRatingNumMonsSeen diff --git a/engine/events/pokemart.asm b/engine/events/pokemart.asm index 0c71e4de..3345f540 100755 --- a/engine/events/pokemart.asm +++ b/engine/events/pokemart.asm @@ -42,7 +42,7 @@ DisplayPokemartDialogue_:: ld [wPrintItemPrices], a ld a, INIT_BAG_ITEM_LIST ld [wInitListType], a - callab InitList + callfar InitList ld a, [wNumBagItems] and a @@ -126,7 +126,7 @@ DisplayPokemartDialogue_:: ld [wPrintItemPrices], a ld a, INIT_OTHER_ITEM_LIST ld [wInitListType], a - callab InitList + callfar InitList ld hl, PokemartBuyingGreetingText call PrintText diff --git a/engine/events/saffron_guards.asm b/engine/events/saffron_guards.asm index cd008394..bf30b8c5 100755 --- a/engine/events/saffron_guards.asm +++ b/engine/events/saffron_guards.asm @@ -10,6 +10,6 @@ RemoveGuardDrink:: call IsItemInBag pop hl jr z, .drinkLoop - jpba RemoveItemByID + farjp RemoveItemByID INCLUDE "data/items/guard_drink_items.asm" diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 3668dd74..b2901615 100755 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -147,7 +147,7 @@ ItemUseBall: ; If the player is fighting an unidentified ghost, set the value that indicates ; the Pokémon can't be caught and skip the capture calculations. - callab IsGhostBattle + callfar IsGhostBattle ld b, $10 ; can't be caught value jp z, .setAnimData @@ -495,7 +495,7 @@ ItemUseBall: ld [wcf91], a ld a, [wEnemyMonLevel] ld [wCurEnemyLVL], a - callab LoadEnemyMonData + callfar LoadEnemyMonData pop af ld [wcf91], a pop hl @@ -632,7 +632,7 @@ ItemUseTownMap: ld a, [wIsInBattle] and a jp nz, ItemUseNotTime - jpba DisplayTownMap + farjp DisplayTownMap ItemUseBicycle: ld a, [wIsInBattle] @@ -778,7 +778,7 @@ ItemUseEvoStone: ld a, SFX_HEAL_AILMENT call PlaySoundWaitForCurrent call WaitForSoundToFinish - callab TryEvolvingMon ; try to evolve pokemon + callfar TryEvolvingMon ; try to evolve pokemon ld a, [wEvolutionOccurred] and a jr z, .noEffect @@ -1341,7 +1341,7 @@ ItemUseMedicine: push hl push de ld d, a - callab CalcExperience ; calculate experience for next level and store it at hExperience + callfar CalcExperience ; calculate experience for next level and store it at hExperience pop de pop hl ld bc, wPartyMon1Exp - wPartyMon1Level @@ -1400,14 +1400,14 @@ ItemUseMedicine: ld [wMonDataLocation], a call LoadMonData ld d, $01 - callab PrintStatsBox ; display new stats text box + callfar PrintStatsBox ; display new stats text box call WaitForTextScrollButtonPress ; wait for button press xor a ; PLAYER_PARTY_DATA ld [wMonDataLocation], a predef LearnMoveFromLevelUp ; learn level up move, if any xor a ld [wForceEvolution], a - callab TryEvolvingMon ; evolve pokemon, if appropriate + callfar TryEvolvingMon ; evolve pokemon, if appropriate ld a, $01 ld [wUpdateSpritesEnabled], a pop af @@ -1699,7 +1699,7 @@ ItemUseXStat: call Delay3 xor a ldh [hWhoseTurn], a ; set turn to player's turn - callba StatModifierUpEffect ; do stat increase move + farcall StatModifierUpEffect ; do stat increase move pop hl pop af ld [hld], a ; restore [wPlayerMoveEffect] @@ -1775,7 +1775,7 @@ ItemUsePokeflute: and $80 jr nz, .skipMusic call WaitForSoundToFinish ; wait for sound to end - callba Music_PokeFluteInBattle ; play in-battle pokeflute music + farcall Music_PokeFluteInBattle ; play in-battle pokeflute music .musicWaitLoop ; wait for music to finish playing ld a, [wChannelSoundIDs + Ch7] and a ; music off? @@ -1927,7 +1927,7 @@ RodResponse: push af push hl ld [hl], 0 - callba FishingAnim + farcall FishingAnim pop hl pop af ld [hl], a @@ -1968,7 +1968,7 @@ ItemUseItemfinder: and a jp nz, ItemUseNotTime call ItemUseReloadOverworldData - callba HiddenItemNear ; check for hidden items + farcall HiddenItemNear ; check for hidden items ld hl, ItemfinderFoundNothingText jr nc, .printText ; if no hidden items ld c, 4 @@ -2024,7 +2024,7 @@ ItemUsePPRestore: call PrintText xor a ld [wPlayerMoveListIndex], a - callab MoveSelectionMenu ; move selection menu + callfar MoveSelectionMenu ; move selection menu ld a, 0 ld [wPlayerMoveListIndex], a jr nz, .chooseMon @@ -2278,7 +2278,7 @@ ItemUseTMHM: call PrintText jr .chooseMon .checkIfAlreadyLearnedMove - callab CheckIfMoveIsKnown ; check if the pokemon already knows the move + callfar CheckIfMoveIsKnown ; check if the pokemon already knows the move jr c, .chooseMon predef LearnMove ; teach move pop af @@ -2820,7 +2820,7 @@ SendNewMonToBox: push de ld a, [wCurEnemyLVL] ld d, a - callab CalcExperience + callfar CalcExperience pop de ldh a, [hExperience] ld [de], a diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm index 3f6d4fa5..3cff630b 100755 --- a/engine/items/town_map.asm +++ b/engine/items/town_map.asm @@ -366,7 +366,7 @@ DrawPlayerOrBirdSprite: jp CopyData DisplayWildLocations: - callba FindWildLocationsOfMon + farcall FindWildLocationsOfMon call ZeroOutDuplicatesInList ld hl, wOAMBuffer ld de, wTownMapCoords diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm index abb88cc0..03e1c50a 100755 --- a/engine/link/cable_club.asm +++ b/engine/link/cable_club.asm @@ -359,7 +359,7 @@ TradeCenter_SelectMon: .displayEnemyMonStats ld a, INIT_ENEMYOT_LIST ld [wInitListType], a - callab InitList ; the list isn't used + callfar InitList ; the list isn't used ld hl, wEnemyMons call TradeCenter_DisplayStats jp .getNewInput @@ -418,7 +418,7 @@ TradeCenter_SelectMon: ; unreachable code ld a, INIT_PLAYEROT_LIST ld [wInitListType], a - callab InitList ; the list isn't used + callfar InitList ; the list isn't used call TradeCenter_DisplayStats jp .getNewInput .playerMonMenu_ANotPressed @@ -513,7 +513,7 @@ TradeCenter_SelectMon: ld [wCurrentMenuItem], a ld a, INIT_PLAYEROT_LIST ld [wInitListType], a - callab InitList ; the list isn't used + callfar InitList ; the list isn't used call TradeCenter_DisplayStats call LoadScreenTilesFromBuffer1 jp .playerMonMenu @@ -588,7 +588,7 @@ ReturnToCableClubRoom: dec a ld [wDestinationWarpID], a call LoadMapData - callba ClearVariablesOnEnterMap + farcall ClearVariablesOnEnterMap pop hl pop af ld [hl], a @@ -845,7 +845,7 @@ TradeCenter_Trade: .usingExternalClock predef ExternalClockTradeAnim .tradeCompleted - callab TryEvolvingMon + callfar TryEvolvingMon call ClearScreen call LoadTrainerInfoTextBoxTiles call Serial_PrintWaitingTextAndSyncAndExchangeNybble diff --git a/engine/link/cable_club_npc.asm b/engine/link/cable_club_npc.asm index 16c62f9e..594adf08 100755 --- a/engine/link/cable_club_npc.asm +++ b/engine/link/cable_club_npc.asm @@ -54,7 +54,7 @@ CableClubNPC:: ld a, [wCurrentMenuItem] and a jr nz, .choseNo - callab SaveSAVtoSRAM + callfar SaveSAVtoSRAM call WaitForSoundToFinish ld a, SFX_SAVE call PlaySoundWaitForCurrent @@ -107,7 +107,7 @@ CableClubNPC:: xor a ld [hld], a ld [hl], a - jpab LinkMenu + jpfar LinkMenu CableClubNPCAreaReservedFor2FriendsLinkedByCableText: text_far _CableClubNPCAreaReservedFor2FriendsLinkedByCableText diff --git a/engine/menus/league_pc.asm b/engine/menus/league_pc.asm index 7bf0458d..d930e42f 100755 --- a/engine/menus/league_pc.asm +++ b/engine/menus/league_pc.asm @@ -29,7 +29,7 @@ PKMNLeaguePC: push bc ld a, [wHoFTeamIndex2] ld [wHoFTeamIndex], a - callba LoadHallOfFameTeams + farcall LoadHallOfFameTeams call LeaguePCShowTeam pop bc jr c, .doneShowingTeams @@ -110,7 +110,7 @@ LeaguePCShowMon: ld de, wHoFTeamNo lb bc, 1, 3 call PrintNumber - jpba HoFDisplayMonInfo + farjp HoFDisplayMonInfo HallOfFameNoText: db "HALL OF FAME No @" diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index 170e778a..e6886c98 100755 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -92,7 +92,7 @@ DisplayNamingScreen: call RunPaletteCommand call LoadHpBarAndStatusTilePatterns call LoadEDTile - callba LoadMonPartySpriteGfx + farcall LoadMonPartySpriteGfx coord hl, 0, 4 ld b, 9 ld c, 18 @@ -128,7 +128,7 @@ DisplayNamingScreen: .inputLoop ld a, [wCurrentMenuItem] push af - callba AnimatePartyMon_ForceSpeed1 + farcall AnimatePartyMon_ForceSpeed1 pop af ld [wCurrentMenuItem], a call JoypadLowSensitivity @@ -172,7 +172,7 @@ DisplayNamingScreen: ld a, [wIsInBattle] and a jp z, LoadTextBoxTilePatterns - jpab LoadHudTilePatterns + jpfar LoadHudTilePatterns .namingScreenButtonFunctions dw .dPadReturnPoint @@ -461,7 +461,7 @@ PrintNamingText: ld a, [wcf91] ld [wMonPartySpriteSpecies], a push af - callba WriteMonPartySpriteOAMBySpecies + farcall WriteMonPartySpriteOAMBySpecies pop af ld [wd11e], a call GetMonName diff --git a/engine/menus/party_menu.asm b/engine/menus/party_menu.asm index f46b3994..4eeb0ed8 100755 --- a/engine/menus/party_menu.asm +++ b/engine/menus/party_menu.asm @@ -22,14 +22,14 @@ DrawPartyMenu_:: ldh [hAutoBGTransferEnabled], a call ClearScreen call UpdateSprites - callba LoadMonPartySpriteGfxWithLCDDisabled ; load pokemon icon graphics + farcall LoadMonPartySpriteGfxWithLCDDisabled ; load pokemon icon graphics RedrawPartyMenu_:: ld a, [wPartyMenuTypeOrMessageID] cp SWAP_MONS_PARTY_MENU jp z, .printMessage call ErasePartyMenuCursors - callba InitPartyMenuBlkPacket + farcall InitPartyMenuBlkPacket coord hl, 3, 0 ld de, wPartySpecies xor a @@ -49,7 +49,7 @@ RedrawPartyMenu_:: call GetPartyMonName pop hl call PlaceString ; print the pokemon's name - callba WriteMonPartySpriteOAMByPartyIndex ; place the appropriate pokemon icon + farcall WriteMonPartySpriteOAMByPartyIndex ; place the appropriate pokemon icon ldh a, [hPartyMonIndex] ld [wWhichPokemon], a inc a diff --git a/engine/menus/pc.asm b/engine/menus/pc.asm index 1006cbbe..4c340e7b 100755 --- a/engine/menus/pc.asm +++ b/engine/menus/pc.asm @@ -10,7 +10,7 @@ ActivatePC:: call LoadScreenTilesFromBuffer2 call Delay3 PCMainMenu: - callba DisplayPCMainMenu + farcall DisplayPCMainMenu ld hl, wFlags_0xcd60 set 5, [hl] call HandleMenuInput @@ -56,19 +56,19 @@ PCMainMenu: call WaitForSoundToFinish ld hl, AccessedMyPCText call PrintText - callba PlayerPC + farcall PlayerPC jr ReloadMainMenu OaksPC: ld a, SFX_ENTER_PC call PlaySound call WaitForSoundToFinish - callba OpenOaksPC + farcall OpenOaksPC jr ReloadMainMenu PKMNLeague: ld a, SFX_ENTER_PC call PlaySound call WaitForSoundToFinish - callba PKMNLeaguePC + farcall PKMNLeaguePC jr ReloadMainMenu BillsPC: ld a, SFX_ENTER_PC @@ -82,7 +82,7 @@ BillsPC: ld hl, AccessedBillsPCText .printText call PrintText - callba BillsPC_ + farcall BillsPC_ ReloadMainMenu: xor a ld [wDoNotWaitForButtonPressAfterDisplayingText], a diff --git a/engine/menus/pokedex.asm b/engine/menus/pokedex.asm index d0ef3e31..a2a55bfd 100755 --- a/engine/menus/pokedex.asm +++ b/engine/menus/pokedex.asm @@ -14,7 +14,7 @@ ShowPokedexMenu: .setUpGraphics ld b, SET_PAL_GENERIC call RunPaletteCommand - callab LoadPokedexTilePatterns + callfar LoadPokedexTilePatterns .doPokemonListMenu ld hl, wTopMenuItemY ld a, 3 @@ -393,7 +393,7 @@ ShowPokedexData: call GBPalWhiteOutWithDelay3 call ClearScreen call UpdateSprites - callab LoadPokedexTilePatterns ; load pokedex tiles + callfar LoadPokedexTilePatterns ; load pokedex tiles ; function to display pokedex data from inside the pokedex ShowPokedexDataInternal: diff --git a/engine/menus/save.asm b/engine/menus/save.asm index 34fa9142..2941a07e 100755 --- a/engine/menus/save.asm +++ b/engine/menus/save.asm @@ -138,7 +138,7 @@ LoadSAVIgnoreBadCheckSum: jp LoadSAV2 SaveSAV: - callba PrintSaveScreenText + farcall PrintSaveScreenText ld hl, WouldYouLikeToSaveText call SaveSAVConfirm and a ;|0 = Yes|1 = No| diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm index acc6bda8..33d504b8 100755 --- a/engine/menus/start_sub_menus.asm +++ b/engine/menus/start_sub_menus.asm @@ -160,7 +160,7 @@ StartMenu_Pokemon:: .surf bit 4, a ; does the player have the Soul Badge? jp z, .newBadgeRequired - callba IsSurfingAllowed + farcall IsSurfingAllowed ld hl, wd728 bit 1, [hl] res 1, [hl] @@ -651,7 +651,7 @@ StartMenu_Option:: ldh [hAutoBGTransferEnabled], a call ClearScreen call UpdateSprites - callab DisplayOptionMenu + callfar DisplayOptionMenu call LoadScreenTilesFromBuffer2 ; restore saved screen call LoadTextBoxTilePatterns call UpdateSprites diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm index caf62852..42b8e0cc 100755 --- a/engine/movie/credits.asm +++ b/engine/movie/credits.asm @@ -1,5 +1,5 @@ HallOfFamePC: - callba AnimateHallOfFame + farcall AnimateHallOfFame call ClearScreen ld c, 100 call DelayFrames @@ -235,7 +235,7 @@ Credits: jr .nextCreditsScreen .showCopyrightText push de - callba LoadCopyrightTiles + farcall LoadCopyrightTiles pop de pop de jr .nextCreditsCommand diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm index 1aba3408..08b6ed8b 100755 --- a/engine/movie/intro.asm +++ b/engine/movie/intro.asm @@ -311,7 +311,7 @@ LoadIntroGraphics: PlayShootingStar: ld b, SET_PAL_GAME_FREAK_INTRO call RunPaletteCommand - callba LoadCopyrightAndTextBoxTiles + farcall LoadCopyrightAndTextBoxTiles ldPal a, BLACK, DARK_GRAY, LIGHT_GRAY, WHITE ldh [rBGP], a ld c, 180 @@ -328,7 +328,7 @@ PlayShootingStar: set 3, [hl] ld c, 64 call DelayFrames - callba AnimateShootingStar + farcall AnimateShootingStar push af pop af jr c, .next ; skip the delay if the user interrupted the animation diff --git a/engine/movie/oak_speech/clear_save.asm b/engine/movie/oak_speech/clear_save.asm index b214ec32..c423fb0b 100755 --- a/engine/movie/oak_speech/clear_save.asm +++ b/engine/movie/oak_speech/clear_save.asm @@ -15,7 +15,7 @@ DoClearSaveDialogue: ld a, [wCurrentMenuItem] and a jp z, Init - callba ClearSAV + farcall ClearSAV jp Init ClearSaveDataText: diff --git a/engine/movie/title.asm b/engine/movie/title.asm index 62eb37d0..efdf2f07 100755 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -226,7 +226,7 @@ ENDC ld c, 1 call CheckForUserInterruption jr c, .finishedWaiting - callba TitleScreenAnimateBallIfStarterOut + farcall TitleScreenAnimateBallIfStarterOut call TitleScreenPickNewMon jr .awaitUserInterruptionLoop @@ -255,7 +255,7 @@ ENDC jp MainMenu .doClearSaveDialogue - jpba DoClearSaveDialogue + farjp DoClearSaveDialogue TitleScreenPickNewMon: ld a, vBGMap0 / $100 @@ -282,12 +282,12 @@ TitleScreenPickNewMon: ld a, $90 ldh [hWY], a ld d, 1 ; scroll out - callba TitleScroll + farcall TitleScroll ret TitleScreenScrollInMon: ld d, 0 ; scroll in - callba TitleScroll + farcall TitleScroll xor a ldh [hWY], a ret diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm index c8005b93..518742aa 100755 --- a/engine/movie/trade.asm +++ b/engine/movie/trade.asm @@ -199,7 +199,7 @@ LoadTradingGFXAndMonNames: Trade_LoadMonPartySpriteGfx: ld a, %11010000 ldh [rOBP1], a - jpba LoadMonPartySpriteGfx + farjp LoadMonPartySpriteGfx Trade_SwapNames: ld hl, wPlayerName @@ -615,7 +615,7 @@ Trade_AnimCircledMon: ret Trade_WriteCircledMonOAM: - callba WriteMonPartySpriteOAMBySpecies + farcall WriteMonPartySpriteOAMBySpecies call Trade_WriteCircleOAM Trade_AddOffsetsToOAMCoords: diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index fc5fb578..97842079 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -57,7 +57,7 @@ UsedCut: ld de, CutTreeBlockSwaps call ReplaceTreeTileBlock call RedrawMapView - callba AnimCut + farcall AnimCut ld a, $1 ld [wUpdateSpritesEnabled], a ld a, SFX_CUT diff --git a/engine/overworld/dust_smoke.asm b/engine/overworld/dust_smoke.asm index 3d87e25a..09a71a18 100755 --- a/engine/overworld/dust_smoke.asm +++ b/engine/overworld/dust_smoke.asm @@ -8,7 +8,7 @@ AnimateBoulderDust: ld a, %11100100 ldh [rOBP1], a call LoadSmokeTileFourTimes - callba WriteCutOrBoulderDustAnimationOAMBlock + farcall WriteCutOrBoulderDustAnimationOAMBlock ld c, 8 ; number of steps in animation .loop push bc diff --git a/engine/overworld/player_state.asm b/engine/overworld/player_state.asm index f2e74683..39c8f756 100644 --- a/engine/overworld/player_state.asm +++ b/engine/overworld/player_state.asm @@ -192,7 +192,7 @@ IsPlayerStandingOnDoorTileOrWarpTile:: push hl push de push bc - callba IsPlayerStandingOnDoorTile + farcall IsPlayerStandingOnDoorTile jr c, .done ld a, [wCurMapTileset] add a diff --git a/engine/overworld/push_boulder.asm b/engine/overworld/push_boulder.asm index fb4d06aa..4cef8b64 100644 --- a/engine/overworld/push_boulder.asm +++ b/engine/overworld/push_boulder.asm @@ -86,7 +86,7 @@ DoBoulderDustAnimation:: ld a, [wd730] bit 0, a ret nz - callab AnimateBoulderDust + callfar AnimateBoulderDust call DiscardButtonPresses ld [wJoyIgnore], a call ResetBoulderPushFlags diff --git a/engine/pokemon/add_mon.asm b/engine/pokemon/add_mon.asm index eeef40b0..0c72ff5b 100644 --- a/engine/pokemon/add_mon.asm +++ b/engine/pokemon/add_mon.asm @@ -201,7 +201,7 @@ _AddPartyMon:: push de ld a, [wCurEnemyLVL] ld d, a - callab CalcExperience + callfar CalcExperience pop de inc de ldh a, [hExperience] ; write experience @@ -498,7 +498,7 @@ _MoveMon:: add $2 ld [wMonDataLocation], a call LoadMonData - callba CalcLevelFromExperience + farcall CalcLevelFromExperience ld a, d ld [wCurEnemyLVL], a pop hl diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index 80739de4..0a760a27 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -318,7 +318,7 @@ BillsPCRelease: jp BillsPCMenu BillsPCChangeBox: - callba ChangeBox + farcall ChangeBox jp BillsPCMenu DisplayMonListMenu: diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm index c54bf7c7..564a8557 100755 --- a/engine/pokemon/evos_moves.asm +++ b/engine/pokemon/evos_moves.asm @@ -129,7 +129,7 @@ Evolution_PartyMonLoop: ; loop over party mons ld a, $ff ld [wUpdateSpritesEnabled], a call ClearSprites - callab EvolveMon + callfar EvolveMon jp c, CancelledEvolution ld hl, EvolvedText call PrintText diff --git a/engine/pokemon/learn_move.asm b/engine/pokemon/learn_move.asm index 510300cd..e7b907d5 100755 --- a/engine/pokemon/learn_move.asm +++ b/engine/pokemon/learn_move.asm @@ -114,7 +114,7 @@ TryingToLearn: ld de, wMoves ld bc, NUM_MOVES call CopyData - callab FormatMovesString + callfar FormatMovesString pop hl .loop push hl diff --git a/engine/pokemon/load_mon_data.asm b/engine/pokemon/load_mon_data.asm index 480ab1ca..c5e2041a 100644 --- a/engine/pokemon/load_mon_data.asm +++ b/engine/pokemon/load_mon_data.asm @@ -15,7 +15,7 @@ LoadMonData_:: ld a, [wWhichPokemon] ld e, a - callab GetMonSpecies + callfar GetMonSpecies .GetMonHeader ld a, [wcf91] diff --git a/engine/pokemon/status_screen.asm b/engine/pokemon/status_screen.asm index e46adae4..c2abeedd 100755 --- a/engine/pokemon/status_screen.asm +++ b/engine/pokemon/status_screen.asm @@ -310,7 +310,7 @@ StatusScreen2: ld de, wMoves ld bc, NUM_MOVES call CopyData - callab FormatMovesString + callfar FormatMovesString coord hl, 9, 2 lb bc, 5, 10 call ClearScreenArea ; Clear under name @@ -356,7 +356,7 @@ StatusScreen2: ld a, b ld [hl], a push hl - callab GetMaxPP + callfar GetMaxPP pop hl pop af ld [hl], a @@ -445,7 +445,7 @@ CalcExpToLevelUp: jr z, .atMaxLevel inc a ld d, a - callab CalcExperience + callfar CalcExperience ld hl, wLoadedMonExp + 2 ldh a, [hExperience + 2] sub [hl] diff --git a/engine/slots/game_corner_slots.asm b/engine/slots/game_corner_slots.asm index 797c381c..c233b0e6 100755 --- a/engine/slots/game_corner_slots.asm +++ b/engine/slots/game_corner_slots.asm @@ -6,7 +6,7 @@ StartSlotMachine: jr z, .printOutToLunch cp $ff jr z, .printSomeonesKeys - callba AbleToPlaySlotsCheck + farcall AbleToPlaySlotsCheck ld a, [wCanPlaySlots] and a ret z diff --git a/home.asm b/home.asm index 779a2e0c..62594b43 100644 --- a/home.asm +++ b/home.asm @@ -206,7 +206,7 @@ CountSetBits:: ; subtracts the amount the player paid from their money ; OUTPUT: carry = 0(success) or 1(fail because there is not enough money) SubtractAmountPaidFromMoney:: - jpba SubtractAmountPaidFromMoney_ + farjp SubtractAmountPaidFromMoney_ ; adds the amount the player sold to their money AddAmountSoldToMoney:: @@ -296,7 +296,7 @@ ReloadTilesetTilePatterns:: ChooseFlyDestination:: ld hl, wd72e res 4, [hl] - jpba LoadTownMap_Fly + farjp LoadTownMap_Fly ; causes the text box to close without waiting for a button press after displaying text DisableWaitingAfterTextDisplay:: @@ -314,7 +314,7 @@ DisableWaitingAfterTextDisplay:: ; 01: successful ; 02: not able to be used right now, no extra menu displayed (only certain items use this) UseItem:: - jpba UseItem_ + farjp UseItem_ ; confirms the item toss and then tosses the item ; INPUT: @@ -348,7 +348,7 @@ IsKeyItem:: push hl push de push bc - callba IsKeyItem_ + farcall IsKeyItem_ pop bc pop de pop hl @@ -418,10 +418,10 @@ RunNPCMovementScript:: dw PewterMuseumGuyMovementScriptPointerTable dw PewterGymGuyMovementScriptPointerTable .playerStepOutFromDoor - jpba PlayerStepOutFromDoor + farjp PlayerStepOutFromDoor EndNPCMovementScript:: - jpba _EndNPCMovementScript + farjp _EndNPCMovementScript EmptyFunc2:: ret @@ -502,7 +502,7 @@ IsItemInBag:: DisplayPokedex:: ld [wd11e], a - jpba _DisplayPokedex + farjp _DisplayPokedex SetSpriteFacingDirectionAndDelay:: call SetSpriteFacingDirection @@ -711,7 +711,7 @@ GetTrainerInformation:: ret GetTrainerName:: - jpba GetTrainerName_ + farjp GetTrainerName_ HasEnoughMoney:: ; Check if the player has at least as much @@ -1107,7 +1107,7 @@ ManualTextScroll:: Multiply:: push hl push bc - callab _Multiply + callfar _Multiply pop bc pop hl ret @@ -1296,7 +1296,7 @@ HandleMenuInput_:: ld a, [wPartyMenuAnimMonEnabled] and a ; is it a pokemon selection menu? jr z, .getJoypadState - callba AnimatePartyMon ; shake mini sprite of selected pokemon + farcall AnimatePartyMon ; shake mini sprite of selected pokemon .getJoypadState pop hl call JoypadLowSensitivity @@ -1687,7 +1687,7 @@ ReloadMapSpriteTilePatterns:: xor a ld [wSpriteSetID], a call DisableLCD - callba InitMapSprites + farcall InitMapSprites call EnableLCD pop hl pop af @@ -1721,7 +1721,7 @@ GivePokemon:: ld [wCurEnemyLVL], a xor a ; PLAYER_PARTY_DATA ld [wMonDataLocation], a - jpba _GivePokemon + farjp _GivePokemon Random:: ; Return a random number in a. @@ -1729,7 +1729,7 @@ Random:: push hl push de push bc - callba Random_ + farcall Random_ ldh a, [hRandomAdd] pop bc pop de @@ -1739,7 +1739,7 @@ Random:: INCLUDE "home/predef.asm" UpdateCinnabarGymGateTileBlocks:: - jpba UpdateCinnabarGymGateTileBlocks_ + farjp UpdateCinnabarGymGateTileBlocks_ CheckForHiddenObjectOrBookshelfOrCardKeyDoor:: ldh a, [hLoadedROMBank] @@ -1765,7 +1765,7 @@ CheckForHiddenObjectOrBookshelfOrCardKeyDoor:: xor a jr .done .hiddenObjectNotFound - callba PrintBookshelfText + farcall PrintBookshelfText ldh a, [hFFDB] and a jr z, .done diff --git a/home/move_mon.asm b/home/move_mon.asm index 7be8eaf5..9fe7b067 100644 --- a/home/move_mon.asm +++ b/home/move_mon.asm @@ -3,13 +3,13 @@ ; [wRemoveMonFromBox] == 0 specifies the party. ; [wRemoveMonFromBox] != 0 specifies the current box. RemovePokemon:: - jpab _RemovePokemon + jpfar _RemovePokemon AddPartyMon:: push hl push de push bc - callba _AddPartyMon + farcall _AddPartyMon pop bc pop de pop hl diff --git a/home/overworld.asm b/home/overworld.asm index 18c7977e..557efa2d 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -1,14 +1,14 @@ HandleMidJump:: ; Handle the player jumping down ; a ledge in the overworld. - jpba _HandleMidJump + farjp _HandleMidJump EnterMap:: ; Load a new map. ld a, $ff ld [wJoyIgnore], a call LoadMapData - callba ClearVariablesOnEnterMap + farcall ClearVariablesOnEnterMap ld hl, wd72c bit 0, [hl] ; has the player already made 3 steps since the last battle? jr z, .skipGivingThreeStepsOfNoRandomBattles @@ -25,10 +25,10 @@ EnterMap:: and 1 << 4 | 1 << 3 ; fly warp or dungeon warp jr z, .didNotEnterUsingFlyWarpOrDungeonWarp res 3, [hl] - callba EnterMapAnim + farcall EnterMapAnim call UpdateSprites .didNotEnterUsingFlyWarpOrDungeonWarp - callba CheckForceBikeOrSurf ; handle currents in SF islands and forced bike riding in cycling road + farcall CheckForceBikeOrSurf ; handle currents in SF islands and forced bike riding in cycling road ld hl, wd72d res 5, [hl] call UpdateSprites @@ -50,7 +50,7 @@ OverworldLoopLessDelay:: and a jp nz, .moveAhead ; if the player sprite has not yet completed the walking animation call JoypadOverworld ; get joypad state (which is possibly simulated) - callba SafariZoneCheck + farcall SafariZoneCheck ld a, [wSafariZoneGameOver] and a jp nz, WarpFound2 @@ -269,7 +269,7 @@ OverworldLoopLessDelay:: ld a, [wd736] bit 7, a jr z, .noSpinning - callba LoadSpinnerArrowTiles + farcall LoadSpinnerArrowTiles .noSpinning call UpdateSprites @@ -306,7 +306,7 @@ OverworldLoopLessDelay:: .doneStepCounting CheckEvent EVENT_IN_SAFARI_ZONE jr z, .notSafariZone - callba SafariZoneCheckSteps + farcall SafariZoneCheckSteps ld a, [wSafariZoneGameOver] and a jp nz, WarpFound2 @@ -343,7 +343,7 @@ OverworldLoopLessDelay:: ld a, [wCurMap] cp OAKS_LAB jp z, .noFaintCheck ; no blacking out if the player lost to the rival in Oak's lab - callab AnyPartyAlive + callfar AnyPartyAlive ld a, d and a jr z, .allPokemonFainted @@ -368,7 +368,7 @@ NewBattle:: ld a, [wd72e] bit 4, a jr nz, .noBattle - jpba InitBattle + farjp InitBattle .noBattle and a ret @@ -412,7 +412,7 @@ CheckWarpsNoCollisionLoop:: push bc ld hl, wd736 set 2, [hl] ; standing on warp flag - callba IsPlayerStandingOnDoorTileOrWarpTile + farcall IsPlayerStandingOnDoorTileOrWarpTile pop bc pop hl jr c, WarpFound1 ; jump if standing on door or warp @@ -511,7 +511,7 @@ WarpFound2:: jr z, .goBackOutside ; if not going back to the previous map ld [wCurMap], a - callba IsPlayerStandingOnWarpPadOrHole + farcall IsPlayerStandingOnWarpPadOrHole ld a, [wStandingOnWarpPadOrHole] dec a ; is the player on a warp pad? jr nz, .notWarpPad @@ -679,7 +679,7 @@ CheckMapConnections:: call RunPaletteCommand ; Since the sprite set shouldn't change, this will just update VRAM slots at ; $C2XE without loading any tile patterns. - callba InitMapSprites + farcall InitMapSprites call LoadTileBlockMap jp OverworldLoopLessDelay @@ -747,7 +747,7 @@ ExtraWarpCheck:: jp Bankswitch MapEntryAfterBattle:: - callba IsPlayerStandingOnWarp ; for enabling warp testing after collisions + farcall IsPlayerStandingOnWarp ; for enabling warp testing after collisions ld a, [wMapPalOffset] and a jp z, GBFadeInFromWhite @@ -800,7 +800,7 @@ HandleFlyWarpOrDungeonWarp:: jp SpecialEnterMap LeaveMapAnim:: - jpba _LeaveMapAnim + farjp _LeaveMapAnim LoadPlayerSpriteGraphics:: ; Load sprite graphics based on whether the player is standing, biking, or surfing. @@ -1286,7 +1286,7 @@ CheckForJumpingAndTilePairCollisions:: predef GetTileAndCoordsInFrontOfPlayer ; get the tile in front of the player push de push bc - callba HandleLedges ; check if the player is trying to jump a ledge + farcall HandleLedges ; check if the player is trying to jump a ledge pop bc pop de pop hl @@ -1977,11 +1977,11 @@ RunMapScript:: push hl push de push bc - callba TryPushingBoulder + farcall TryPushingBoulder ld a, [wFlags_0xcd60] bit 1, a ; play boulder dust animation jr z, .afterBoulderEffect - callba DoBoulderDustAnimation + farcall DoBoulderDustAnimation .afterBoulderEffect pop bc pop de @@ -2032,7 +2032,7 @@ LoadPlayerSpriteGraphicsCommon:: ; function to load data from the map header LoadMapHeader:: - callba MarkTownVisitedAndLoadMissableObjects + farcall MarkTownVisitedAndLoadMissableObjects ld a, [wCurMapTileset] ld [wUnusedD119], a ld a, [wCurMap] @@ -2280,7 +2280,7 @@ LoadMapHeader:: jp nz, .loadSpriteLoop .finishUp predef LoadTilesetHeader - callab LoadWildData + callfar LoadWildData pop hl ; restore hl from before going to the warp/sign/sprite data (this value was saved for seemingly no purpose) ld a, [wCurMapHeight] ; map height in 4x4 tile blocks add a ; double it @@ -2337,7 +2337,7 @@ LoadMapData:: ld [wSpriteSetID], a call LoadTextBoxTilePatterns call LoadMapHeader - callba InitMapSprites ; load tile pattern data for sprites + farcall InitMapSprites ; load tile pattern data for sprites call LoadTileBlockMap call LoadTilesetTilePatternData call LoadCurrentMapView diff --git a/home/pokemon.asm b/home/pokemon.asm index 6c5442c4..d018843e 100644 --- a/home/pokemon.asm +++ b/home/pokemon.asm @@ -81,7 +81,7 @@ DrawHPBar:: ; wLoadedMon = base address of pokemon data ; wMonHeader = base address of base stats LoadMonData:: - jpab LoadMonData_ + jpfar LoadMonData_ OverwritewMoves:: ; Write c to [wMoves + b]. Unused. @@ -277,7 +277,7 @@ HandlePartyMenuInput:: bit 1, b ; was the B button pressed? jr z, .handleSwap ; if not, handle swapping the pokemon .cancelSwap ; if the B button was pressed - callba ErasePartyMenuCursors + farcall ErasePartyMenuCursors xor a ld [wMenuItemToSwap], a ld [wPartyMenuTypeOrMessageID], a @@ -286,7 +286,7 @@ HandlePartyMenuInput:: .handleSwap ld a, [wCurrentMenuItem] ld [wWhichPokemon], a - callba SwitchPartyMon + farcall SwitchPartyMon jr HandlePartyMenuInput DrawPartyMenu:: diff --git a/home/serial.asm b/home/serial.asm index 27ac97d4..bd984d4f 100644 --- a/home/serial.asm +++ b/home/serial.asm @@ -225,7 +225,7 @@ Serial_ExchangeLinkMenuSelection:: Serial_PrintWaitingTextAndSyncAndExchangeNybble:: call SaveScreenTilesToBuffer1 - callab PrintWaitingText + callfar PrintWaitingText call Serial_SyncAndExchangeNybble jp LoadScreenTilesFromBuffer1 diff --git a/home/start_menu.asm b/home/start_menu.asm index a692f007..5b29f67a 100755 --- a/home/start_menu.asm +++ b/home/start_menu.asm @@ -8,8 +8,8 @@ DisplayStartMenu:: call PlaySound RedisplayStartMenu:: - callba DrawStartMenu - callba PrintSafariZoneSteps ; print Safari Zone info, if in Safari Zone + farcall DrawStartMenu + farcall PrintSafariZoneSteps ; print Safari Zone info, if in Safari Zone call UpdateSprites .loop call HandleMenuInput diff --git a/home/text_script.asm b/home/text_script.asm index 89f4d286..1baa3d64 100644 --- a/home/text_script.asm +++ b/home/text_script.asm @@ -3,7 +3,7 @@ DisplayTextID:: ldh a, [hLoadedROMBank] push af - callba DisplayTextIDInit ; initialization + farcall DisplayTextIDInit ; initialization ld hl, wTextPredefFlag bit 0, [hl] res 0, [hl] @@ -38,7 +38,7 @@ DisplayTextID:: push hl push de push bc - callba UpdateSpriteFacingOffsetAndDelayMovement ; update the graphics of the sprite the player is talking to (to face the right direction) + farcall UpdateSpriteFacingOffsetAndDelayMovement ; update the graphics of the sprite the player is talking to (to face the right direction) pop bc pop de ld hl, wMapSpriteData ; NPC text entries @@ -79,9 +79,9 @@ ENDM dict TX_SCRIPT_PLAYERS_PC, TextScript_ItemStoragePC dict TX_SCRIPT_BILLS_PC, TextScript_BillsPC dict TX_SCRIPT_POKECENTER_PC, TextScript_PokemonCenterPC - dict2 TX_SCRIPT_VENDING_MACHINE, callba VendingMachineMenu + dict2 TX_SCRIPT_VENDING_MACHINE, farcall VendingMachineMenu dict TX_SCRIPT_PRIZE_VENDOR, TextScript_GameCornerPrizeMenu - dict2 TX_SCRIPT_CABLE_CLUB_RECEPTIONIST, callab CableClubNPC + dict2 TX_SCRIPT_CABLE_CLUB_RECEPTIONIST, callfar CableClubNPC call PrintText_NoCreatingTextBox ; display the text ld a, [wDoNotWaitForButtonPressAfterDisplayingText] @@ -197,7 +197,7 @@ DisplayPokemonCenterDialogue:: jp AfterDisplayingTextID DisplaySafariGameOverText:: - callab PrintSafariGameOverText + callfar PrintSafariGameOverText jp AfterDisplayingTextID DisplayPokemonFaintedText:: diff --git a/home/trainers.asm b/home/trainers.asm index 66108af6..039c4ec8 100644 --- a/home/trainers.asm +++ b/home/trainers.asm @@ -219,7 +219,7 @@ ResetButtonPressedAndMapScript:: ; calls TrainerWalkUpToPlayer TrainerWalkUpToPlayer_Bank0:: - jpba TrainerWalkUpToPlayer + farjp TrainerWalkUpToPlayer ; sets opponent type and mon set/lvl based on the engaging trainer data InitBattleEnemyParameters:: @@ -343,14 +343,14 @@ PrintEndBattleText:: ldh [hLoadedROMBank], a ld [MBC1RomBank], a push hl - callba SaveTrainerName + farcall SaveTrainerName ld hl, TrainerEndBattleText call PrintText pop hl pop af ldh [hLoadedROMBank], a ld [MBC1RomBank], a - callba FreezeEnemyTrainerSprite + farcall FreezeEnemyTrainerSprite jp WaitForSoundToFinish GetSavedEndBattleTextPointer:: diff --git a/home/vblank.asm b/home/vblank.asm index 06b45b82..4c7abc20 100644 --- a/home/vblank.asm +++ b/home/vblank.asm @@ -72,7 +72,7 @@ VBlank:: call Audio3_UpdateMusic .afterMusic - callba TrackPlayTime ; keep track of time played + farcall TrackPlayTime ; keep track of time played ldh a, [hDisableJoypadPolling] and a diff --git a/macros/farcall.asm b/macros/farcall.asm index 85c2dc9f..122e5207 100644 --- a/macros/farcall.asm +++ b/macros/farcall.asm @@ -1,24 +1,22 @@ -farcall EQUS "callba" - -callba: MACRO +farcall: MACRO ld b, BANK(\1) ld hl, \1 call Bankswitch ENDM -callab: MACRO +callfar: MACRO ld hl, \1 ld b, BANK(\1) call Bankswitch ENDM -jpba: MACRO +farjp: MACRO ld b, BANK(\1) ld hl, \1 jp Bankswitch ENDM -jpab: MACRO +jpfar: MACRO ld hl, \1 ld b, BANK(\1) jp Bankswitch diff --git a/scripts/BikeShop.asm b/scripts/BikeShop.asm index 338381e9..8ff581a3 100755 --- a/scripts/BikeShop.asm +++ b/scripts/BikeShop.asm @@ -24,7 +24,7 @@ BikeShopText1: jr nc, .BagFull ld a, BIKE_VOUCHER ldh [hItemToRemoveID], a - callba RemoveItemByID + farcall RemoveItemByID SetEvent EVENT_GOT_BICYCLE ld hl, BikeShopText_1d824 call PrintText diff --git a/scripts/CeladonMansion3F.asm b/scripts/CeladonMansion3F.asm index c9085b32..b2d40b44 100755 --- a/scripts/CeladonMansion3F.asm +++ b/scripts/CeladonMansion3F.asm @@ -49,7 +49,7 @@ DirectorText: text_far _CompletedDexText text_promptbutton text_asm - callab DisplayDiploma + callfar DisplayDiploma ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a jp TextScriptEnd diff --git a/scripts/CeladonMartElevator.asm b/scripts/CeladonMartElevator.asm index bcac0d14..e58c88f0 100755 --- a/scripts/CeladonMartElevator.asm +++ b/scripts/CeladonMartElevator.asm @@ -60,7 +60,7 @@ CeladonMartElevatorWarpMaps: CeladonMartElevatorWarpMapsEnd: CeladonMartElevatorScript_48654: - jpba ShakeElevator + farjp ShakeElevator CeladonMartElevator_TextPointers: dw CeladonMartElevatorText1 diff --git a/scripts/CeladonMartRoof.asm b/scripts/CeladonMartRoof.asm index 06a8390a..e880211b 100755 --- a/scripts/CeladonMartRoof.asm +++ b/scripts/CeladonMartRoof.asm @@ -131,7 +131,7 @@ CeladonMartRoofScript_GiveDrinkToGirl: jp PrintText RemoveItemByIDBank12: - jpba RemoveItemByID + farjp RemoveItemByID CeladonMartRoofText_484ee: text_far _CeladonMartRoofText_484ee diff --git a/scripts/CeruleanCity.asm b/scripts/CeruleanCity.asm index 656c3a4d..070120b7 100755 --- a/scripts/CeruleanCity.asm +++ b/scripts/CeruleanCity.asm @@ -174,7 +174,7 @@ CeruleanCityScript2: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateStart + farcall Music_RivalAlternateStart ld a, $1 ldh [hSpriteIndex], a call SetSpriteMovementBytesToFF @@ -310,7 +310,7 @@ CeruleanCityText2: ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, ReceivedTM28Text call PrintText - callba CeruleanHideRocket + farcall CeruleanHideRocket .Done jp TextScriptEnd diff --git a/scripts/ChampionsRoom.asm b/scripts/ChampionsRoom.asm index 53dd9d4e..e57048c5 100755 --- a/scripts/ChampionsRoom.asm +++ b/scripts/ChampionsRoom.asm @@ -108,7 +108,7 @@ GaryScript3: ret GaryScript4: - callba Music_Cities1AlternateTempo + farcall Music_Cities1AlternateTempo ld a, $2 ldh [hSpriteIndexOrTextID], a call GaryScript_760c8 diff --git a/scripts/CinnabarLabFossilRoom.asm b/scripts/CinnabarLabFossilRoom.asm index ac33e6ee..4bdb8a36 100755 --- a/scripts/CinnabarLabFossilRoom.asm +++ b/scripts/CinnabarLabFossilRoom.asm @@ -56,7 +56,7 @@ Lab4Text1: ld a, [wFilteredBagItemsCount] and a jr z, .asm_75d8d - callba GiveFossilToCinnabarLab + farcall GiveFossilToCinnabarLab jr .asm_75d93 .asm_75d8d ld hl, Lab4Text_75dcb @@ -106,4 +106,4 @@ Lab4Text2: jp TextScriptEnd LoadFossilItemAndMonNameBank1D: - jpba LoadFossilItemAndMonName + farjp LoadFossilItemAndMonName diff --git a/scripts/CopycatsHouse2F.asm b/scripts/CopycatsHouse2F.asm index b885baab..c27043e6 100755 --- a/scripts/CopycatsHouse2F.asm +++ b/scripts/CopycatsHouse2F.asm @@ -30,7 +30,7 @@ CopycatsHouse2FText1: call PrintText ld a, POKE_DOLL ldh [hItemToRemoveID], a - callba RemoveItemByID + farcall RemoveItemByID SetEvent EVENT_GOT_TM31 jr .asm_62ecd .BagFull diff --git a/scripts/Daycare.asm b/scripts/Daycare.asm index 9fc8f3c4..481d7e14 100755 --- a/scripts/Daycare.asm +++ b/scripts/Daycare.asm @@ -35,7 +35,7 @@ DayCareMText1: pop af ld hl, DayCareAllRightThenText jp c, .done - callab KnowsHMMove + callfar KnowsHMMove ld hl, DayCareCantAcceptMonWithHMText jp c, .done xor a @@ -65,13 +65,13 @@ DayCareMText1: ld a, DAYCARE_DATA ld [wMonDataLocation], a call LoadMonData - callab CalcLevelFromExperience + callfar CalcLevelFromExperience ld a, d cp MAX_LEVEL jr c, .skipCalcExp ld d, MAX_LEVEL - callab CalcExperience + callfar CalcExperience ld hl, wDayCareMonExp ldh a, [hExperience] ld [hli], a diff --git a/scripts/HallOfFame.asm b/scripts/HallOfFame.asm index cdfb2f17..35ad9fd8 100755 --- a/scripts/HallOfFame.asm +++ b/scripts/HallOfFame.asm @@ -45,7 +45,7 @@ HallofFameRoomScript2: ld [wHallOfFameCurScript], a ld a, PALLET_TOWN ld [wLastBlackoutMap], a - callba SaveSAVtoSRAM + farcall SaveSAVtoSRAM ld b, 5 .delayLoop ld c, 600 / 5 diff --git a/scripts/NameRatersHouse.asm b/scripts/NameRatersHouse.asm index 7694e92b..cecf97e7 100755 --- a/scripts/NameRatersHouse.asm +++ b/scripts/NameRatersHouse.asm @@ -68,7 +68,7 @@ NameRaterText1: jr nz, .asm_1daae ld hl, NameRaterText_1dac2 call PrintText - callba DisplayNameRaterScreen + farcall DisplayNameRaterScreen jr c, .asm_1daae ld hl, NameRaterText_1dac7 .asm_1daa8 diff --git a/scripts/OaksLab.asm b/scripts/OaksLab.asm index 49017440..a2e0bfe8 100755 --- a/scripts/OaksLab.asm +++ b/scripts/OaksLab.asm @@ -441,7 +441,7 @@ OaksLabScript13: ld a, $10 ldh [hSpriteIndexOrTextID], a call DisplayTextID - callba Music_RivalAlternateStart + farcall Music_RivalAlternateStart ld a, $1 ldh [hSpriteIndex], a ld de, .RivalExitMovement @@ -513,7 +513,7 @@ OaksLabScript15: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateStart + farcall Music_RivalAlternateStart ld a, $15 ldh [hSpriteIndexOrTextID], a call DisplayTextID @@ -614,7 +614,7 @@ OaksLabScript16: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateStart + farcall Music_RivalAlternateStart ld a, $1 ldh [hSpriteIndex], a ld de, wNPCMovementDirections2 diff --git a/scripts/PokemonTower2F.asm b/scripts/PokemonTower2F.asm index 86a60579..cddebfa8 100755 --- a/scripts/PokemonTower2F.asm +++ b/scripts/PokemonTower2F.asm @@ -79,7 +79,7 @@ PokemonTower2Script1: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateStart + farcall Music_RivalAlternateStart ld a, $2 ld [wPokemonTower2FCurScript], a ld [wCurMapScript], a diff --git a/scripts/RocketHideoutElevator.asm b/scripts/RocketHideoutElevator.asm index 6b1294b3..45b27e3b 100755 --- a/scripts/RocketHideoutElevator.asm +++ b/scripts/RocketHideoutElevator.asm @@ -58,7 +58,7 @@ RocketHideoutElevatorWarpMapsEnd: RocketHideoutElevatorScript_4575f: call Delay3 - callba ShakeElevator + farcall ShakeElevator ret RocketHideoutElevator_TextPointers: diff --git a/scripts/Route22.asm b/scripts/Route22.asm index fd566ff0..57dc934e 100755 --- a/scripts/Route22.asm +++ b/scripts/Route22.asm @@ -170,7 +170,7 @@ Route22Script2: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateStart + farcall Music_RivalAlternateStart ld a, [wcf0d] cp $1 jr nz, .asm_50fff @@ -248,7 +248,7 @@ Route22Script_5104e: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateTempo + farcall Music_RivalAlternateTempo ld a, $2 ldh [hSpriteIndex], a call Route22MoveRivalSprite @@ -329,7 +329,7 @@ Route22Script5: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateStartAndTempo + farcall Music_RivalAlternateStartAndTempo ld a, [wcf0d] cp $1 jr nz, .asm_51134 diff --git a/scripts/Route5Gate.asm b/scripts/Route5Gate.asm index 0b66efa6..f2d45112 100755 --- a/scripts/Route5Gate.asm +++ b/scripts/Route5Gate.asm @@ -26,7 +26,7 @@ Route5GateScript0: ld [wPlayerMovingDirection], a xor a ldh [hJoyHeld], a - callba RemoveGuardDrink + farcall RemoveGuardDrink ldh a, [hItemToRemoveID] and a jr nz, .asm_1df82 @@ -73,7 +73,7 @@ Route5GateText1: ld a, [wd728] bit 6, a jr nz, .asm_88856 - callba RemoveGuardDrink + farcall RemoveGuardDrink ldh a, [hItemToRemoveID] and a jr nz, .asm_768a2 diff --git a/scripts/Route6Gate.asm b/scripts/Route6Gate.asm index 7d135498..22d40fd3 100755 --- a/scripts/Route6Gate.asm +++ b/scripts/Route6Gate.asm @@ -20,7 +20,7 @@ Route6GateScript0: ld [wPlayerMovingDirection], a xor a ldh [hJoyHeld], a - callba RemoveGuardDrink + farcall RemoveGuardDrink ldh a, [hItemToRemoveID] and a jr nz, .asm_1e080 diff --git a/scripts/Route7Gate.asm b/scripts/Route7Gate.asm index 041d6c6a..182dedab 100755 --- a/scripts/Route7Gate.asm +++ b/scripts/Route7Gate.asm @@ -32,7 +32,7 @@ Route7GateScript0: ld [wPlayerMovingDirection], a xor a ldh [hJoyHeld], a - callba RemoveGuardDrink + farcall RemoveGuardDrink ldh a, [hItemToRemoveID] and a jr nz, .asm_1e15a diff --git a/scripts/Route8Gate.asm b/scripts/Route8Gate.asm index 3bdd6070..9ddaf601 100755 --- a/scripts/Route8Gate.asm +++ b/scripts/Route8Gate.asm @@ -31,7 +31,7 @@ Route8GateScript0: ld [wPlayerMovingDirection], a xor a ldh [hJoyHeld], a - callba RemoveGuardDrink + farcall RemoveGuardDrink ldh a, [hItemToRemoveID] and a jr nz, .asm_1e220 diff --git a/scripts/SSAnne2F.asm b/scripts/SSAnne2F.asm index 45e8f283..5060f1e1 100755 --- a/scripts/SSAnne2F.asm +++ b/scripts/SSAnne2F.asm @@ -148,7 +148,7 @@ SSAnne2Script2: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateStart + farcall Music_RivalAlternateStart ld a, $3 ld [wSSAnne2FCurScript], a ret diff --git a/scripts/SilphCo7F.asm b/scripts/SilphCo7F.asm index e7032760..dae0f96b 100755 --- a/scripts/SilphCo7F.asm +++ b/scripts/SilphCo7F.asm @@ -222,7 +222,7 @@ SilphCo7Script4: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateStart + farcall Music_RivalAlternateStart ld de, MovementData_51d1d ld a, [wcf0d] cp $1 diff --git a/scripts/SilphCoElevator.asm b/scripts/SilphCoElevator.asm index 3ff507c7..e660cd0f 100755 --- a/scripts/SilphCoElevator.asm +++ b/scripts/SilphCoElevator.asm @@ -74,7 +74,7 @@ SilphCoElevatorWarpMapsEnd: SilphCoElevatorScript_45827: call Delay3 - callba ShakeElevator + farcall ShakeElevator ret SilphCoElevator_TextPointers: diff --git a/scripts/VermilionDock.asm b/scripts/VermilionDock.asm index d1a60988..5af5e5a2 100755 --- a/scripts/VermilionDock.asm +++ b/scripts/VermilionDock.asm @@ -45,7 +45,7 @@ VermilionDock_1db9b: ld c, BANK(Music_Surfing) ld a, MUSIC_SURFING call PlayMusic - callba LoadSmokeTileFourTimes + farcall LoadSmokeTileFourTimes xor a ld [wSpritePlayerStateData1ImageIndex], a ld c, 120 diff --git a/scripts/ViridianGym.asm b/scripts/ViridianGym.asm index fafc6388..80f19f3a 100755 --- a/scripts/ViridianGym.asm +++ b/scripts/ViridianGym.asm @@ -128,7 +128,7 @@ ViridianGymScript4: ld [wCurMapScript], a ret .asm_74980 - jpba LoadSpinnerArrowTiles + farjp LoadSpinnerArrowTiles ViridianGymScript3: ld a, [wIsInBattle] diff --git a/scripts/WardensHouse.asm b/scripts/WardensHouse.asm index 1cb68cf9..6705a450 100755 --- a/scripts/WardensHouse.asm +++ b/scripts/WardensHouse.asm @@ -33,7 +33,7 @@ FuchsiaHouse2Text1: call PrintText ld a, GOLD_TEETH ldh [hItemToRemoveID], a - callba RemoveItemByID + farcall RemoveItemByID SetEvent EVENT_GAVE_GOLD_TEETH .asm_60cba ld hl, WardenThankYouText -- cgit v1.3.1-sl0p From 45ed05decf330faab4503fe8fecadc54698c9724 Mon Sep 17 00:00:00 2001 From: Rangi Date: Tue, 7 Jul 2020 11:10:29 -0400 Subject: Use HIGH() and LOW() --- constants/audio_constants.asm | 8 ++--- constants/battle_constants.asm | 2 ++ engine/battle/core.asm | 44 ++++++++++++++-------------- engine/battle/effects.asm | 15 +++++----- engine/gfx/mon_icons.asm | 2 +- engine/gfx/oam_dma.asm | 4 +-- engine/gfx/sprite_oam.asm | 8 ++--- engine/items/inventory.asm | 4 +-- engine/link/cable_club.asm | 4 +-- engine/movie/oak_speech/init_player_data.asm | 4 +-- engine/movie/title.asm | 12 ++++---- engine/movie/trade.asm | 4 +-- engine/overworld/elevator.asm | 2 +- engine/overworld/movement.asm | 22 +++++++------- engine/overworld/sprite_collisions.asm | 4 +-- engine/slots/slot_machine.asm | 10 +++---- home.asm | 2 +- home/init.asm | 4 +-- home/move_mon.asm | 10 +++---- home/uncompress.asm | 4 +-- macros/scripts/audio.asm | 3 +- scripts/SafariZoneGate.asm | 4 +-- 22 files changed, 89 insertions(+), 87 deletions(-) (limited to 'engine/battle') diff --git a/constants/audio_constants.asm b/constants/audio_constants.asm index 38719f92..3a1a8f5b 100644 --- a/constants/audio_constants.asm +++ b/constants/audio_constants.asm @@ -25,10 +25,10 @@ const Ch8 ; 7 ; HW sound channel register base addresses -HW_CH1_BASE EQU (rNR10 % $100) -HW_CH2_BASE EQU ((rNR21 % $100) - 1) -HW_CH3_BASE EQU (rNR30 % $100) -HW_CH4_BASE EQU ((rNR41 % $100) - 1) +HW_CH1_BASE EQU LOW(rNR10) +HW_CH2_BASE EQU LOW(rNR21) - 1 +HW_CH3_BASE EQU LOW(rNR30) +HW_CH4_BASE EQU LOW(rNR41) - 1 ; HW sound channel enable bit masks HW_CH1_ENABLE_MASK EQU %00010001 diff --git a/constants/battle_constants.asm b/constants/battle_constants.asm index ba5d6c68..bdd03e8a 100644 --- a/constants/battle_constants.asm +++ b/constants/battle_constants.asm @@ -35,6 +35,8 @@ BRN EQU 4 FRZ EQU 5 PAR EQU 6 +MAX_STAT_VALUE EQU 999 + ; volatile statuses 1 STORING_ENERGY EQU 0 ; Bide THRASHING_ABOUT EQU 1 ; e.g. Thrash diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 4d999d2a..9a66265c 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -4182,8 +4182,8 @@ GetDamageVarsForPlayerAttack: ; if the enemy has used Light Screen, double the enemy's special sla c rl b -; reflect and light screen boosts do not cap the stat at 999, so weird things will happen during stats scaling if -; a Pokemon with 512 or more Defense has used Reflect, or if a Pokemon with 512 or more Special has used Light Screen +; reflect and light screen boosts do not cap the stat at MAX_STAT_VALUE, so weird things will happen during stats scaling +; if a Pokemon with 512 or more Defense has used Reflect, or if a Pokemon with 512 or more Special has used Light Screen .specialAttackCritCheck ld hl, wBattleMonSpecial ld a, [wCriticalHitOrOHKO] @@ -4295,8 +4295,8 @@ GetDamageVarsForEnemyAttack: ; if the player has used Light Screen, double the player's special sla c rl b -; reflect and light screen boosts do not cap the stat at 999, so weird things will happen during stats scaling if -; a Pokemon with 512 or more Defense has used Reflect, or if a Pokemon with 512 or more Special has used Light Screen +; reflect and light screen boosts do not cap the stat at MAX_STAT_VALUE, so weird things will happen during stats scaling +; if a Pokemon with 512 or more Defense has used Reflect, or if a Pokemon with 512 or more Special has used Light Screen .specialAttackCritCheck ld hl, wEnemyMonSpecial ld a, [wCriticalHitOrOHKO] @@ -4508,14 +4508,14 @@ CalculateDamage: jr nz, .cap ldh a, [hQuotient + 2] - cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) / $100 + cp HIGH(MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) jr c, .dont_cap_2 - cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) / $100 + 1 + cp HIGH(MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) + 1 jr nc, .cap ldh a, [hQuotient + 3] - cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) % $100 + cp LOW(MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) jr nc, .cap .dont_cap_2 @@ -4533,21 +4533,21 @@ CalculateDamage: jr c, .cap ld a, [hl] - cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) / $100 + cp HIGH(MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) jr c, .dont_cap_3 - cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) / $100 + 1 + cp HIGH(MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) + 1 jr nc, .cap inc hl ld a, [hld] - cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) % $100 + cp LOW(MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) jr c, .dont_cap_3 .cap - ld a, (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE) / $100 + ld a, HIGH(MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE) ld [hli], a - ld a, (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE) % $100 + ld a, LOW(MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE) ld [hld], a .dont_cap_3 @@ -6526,14 +6526,14 @@ CalculateModifiedStat: call Divide pop hl ldh a, [hDividend + 3] - sub 999 % $100 + sub LOW(MAX_STAT_VALUE) ldh a, [hDividend + 2] - sbc 999 / $100 + sbc HIGH(MAX_STAT_VALUE) jp c, .storeNewStatValue -; cap the stat at 999 - ld a, 999 / $100 +; cap the stat at MAX_STAT_VALUE (999) + ld a, HIGH(MAX_STAT_VALUE) ldh [hDividend + 2], a - ld a, 999 % $100 + ld a, LOW(MAX_STAT_VALUE) ldh [hDividend + 3], a .storeNewStatValue ldh a, [hDividend + 2] @@ -6573,7 +6573,7 @@ ApplyBadgeStatBoosts: ret ; multiply stat at hl by 1.125 -; cap stat at 999 +; cap stat at MAX_STAT_VALUE .applyBoostToStat ld a, [hli] ld d, a @@ -6591,13 +6591,13 @@ ApplyBadgeStatBoosts: adc d ld [hli], a ld a, [hld] - sub 999 % $100 + sub LOW(MAX_STAT_VALUE) ld a, [hl] - sbc 999 / $100 + sbc HIGH(MAX_STAT_VALUE) ret c - ld a, 999 / $100 + ld a, HIGH(MAX_STAT_VALUE) ld [hli], a - ld a, 999 % $100 + ld a, LOW(MAX_STAT_VALUE) ld [hld], a ret diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm index fe050937..441d6c1c 100644 --- a/engine/battle/effects.asm +++ b/engine/battle/effects.asm @@ -399,11 +399,12 @@ StatModifierUpEffect: inc d ; de = unmodified (original) stat .checkIf999 pop bc + ; check if stat is already 999 ld a, [hld] - sub 999 % $100 ; check if stat is already 999 + sub LOW(MAX_STAT_VALUE) jr nz, .recalculateStat ld a, [hl] - sbc 999 / $100 + sbc HIGH(MAX_STAT_VALUE) jp z, RestoreOriginalStatModifier .recalculateStat ; recalculate affected stat ; paralysis and burn penalties, as well as badge boosts are ignored @@ -431,15 +432,15 @@ StatModifierUpEffect: ld b, $4 call Divide pop hl -; cap at 999 +; cap at MAX_STAT_VALUE (999) ldh a, [hProduct + 3] - sub 999 % $100 + sub LOW(MAX_STAT_VALUE) ldh a, [hProduct + 2] - sbc 999 / $100 + sbc HIGH(MAX_STAT_VALUE) jp c, UpdateStat - ld a, 999 / $100 + ld a, HIGH(MAX_STAT_VALUE) ldh [hMultiplicand + 1], a - ld a, 999 % $100 + ld a, LOW(MAX_STAT_VALUE) ldh [hMultiplicand + 2], a UpdateStat: diff --git a/engine/gfx/mon_icons.asm b/engine/gfx/mon_icons.asm index 19008c05..253fca35 100755 --- a/engine/gfx/mon_icons.asm +++ b/engine/gfx/mon_icons.asm @@ -236,7 +236,7 @@ WriteMonPartySpriteOAM: ; make a copy at wMonPartySpritesSavedOAM. push af ld c, $10 - ld h, wOAMBuffer / $100 + ld h, HIGH(wOAMBuffer) ldh a, [hPartyMonIndex] swap a ld l, a diff --git a/engine/gfx/oam_dma.asm b/engine/gfx/oam_dma.asm index d8d8839a..84bb4b5c 100644 --- a/engine/gfx/oam_dma.asm +++ b/engine/gfx/oam_dma.asm @@ -1,7 +1,7 @@ WriteDMACodeToHRAM:: ; Since no other memory is available during OAM DMA, ; DMARoutine is copied to HRAM and executed there. - ld c, hDMARoutine % $100 + ld c, LOW(hDMARoutine) ld b, DMARoutineEnd - DMARoutine ld hl, DMARoutine .copy @@ -14,7 +14,7 @@ WriteDMACodeToHRAM:: DMARoutine: ; initiate DMA - ld a, wOAMBuffer / $100 + ld a, HIGH(wOAMBuffer) ldh [rDMA], a ; wait for DMA to finish diff --git a/engine/gfx/sprite_oam.asm b/engine/gfx/sprite_oam.asm index 1a96286d..7e9bf739 100644 --- a/engine/gfx/sprite_oam.asm +++ b/engine/gfx/sprite_oam.asm @@ -18,7 +18,7 @@ PrepareOAMData:: .spriteLoop ldh [hSpriteOffset2], a - ld d, wSpriteStateData1 / $100 + ld d, HIGH(wSpriteStateData1) ldh a, [hSpriteOffset2] ld e, a ld a, [de] ; c1x0 @@ -79,7 +79,7 @@ PrepareOAMData:: ldh a, [hOAMBufferOffset] ld e, a - ld d, wOAMBuffer / $100 + ld d, HIGH(wOAMBuffer) .tileLoop ldh a, [hSpriteScreenY] ; temp for sprite Y position @@ -141,13 +141,13 @@ PrepareOAMData:: .nextSprite ldh a, [hSpriteOffset2] add $10 - cp $100 % $100 + cp LOW($100) jp nz, .spriteLoop ; Clear unused OAM. ldh a, [hOAMBufferOffset] ld l, a - ld h, wOAMBuffer / $100 + ld h, HIGH(wOAMBuffer) ld de, $4 ld b, $a0 ld a, [wd736] diff --git a/engine/items/inventory.asm b/engine/items/inventory.asm index 7ce61cb9..bf433175 100644 --- a/engine/items/inventory.asm +++ b/engine/items/inventory.asm @@ -12,10 +12,10 @@ AddItemToInventory_:: push hl push hl ld d, PC_ITEM_CAPACITY ; how many items the PC can hold - ld a, wNumBagItems & $FF + ld a, LOW(wNumBagItems) cp l jr nz, .checkIfInventoryFull - ld a, wNumBagItems >> 8 + ld a, HIGH(wNumBagItems) cp h jr nz, .checkIfInventoryFull ; if the destination is the bag diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm index 03e1c50a..dd93ebba 100755 --- a/engine/link/cable_club.asm +++ b/engine/link/cable_club.asm @@ -255,9 +255,9 @@ CableClub_DoBattleOrTradeAgain: ld hl, wEnemyMons + (SERIAL_PREAMBLE_BYTE - 1) dec c jr nz, .unpatchEnemyMonsLoop - ld a, wEnemyMonOT % $100 + ld a, LOW(wEnemyMonOT) ld [wUnusedCF8D], a - ld a, wEnemyMonOT / $100 + ld a, HIGH(wEnemyMonOT) ld [wUnusedCF8D + 1], a xor a ld [wTradeCenterPointerTableIndex], a diff --git a/engine/movie/oak_speech/init_player_data.asm b/engine/movie/oak_speech/init_player_data.asm index bd181bbd..53ca24f3 100644 --- a/engine/movie/oak_speech/init_player_data.asm +++ b/engine/movie/oak_speech/init_player_data.asm @@ -23,9 +23,9 @@ InitPlayerData2: START_MONEY EQU $3000 ld hl, wPlayerMoney + 1 - ld a, START_MONEY / $100 + ld a, HIGH(START_MONEY) ld [hld], a - xor a + xor a ; LOW(START_MONEY) ld [hli], a inc hl ld [hl], a diff --git a/engine/movie/title.asm b/engine/movie/title.asm index efdf2f07..00e639ae 100755 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -126,13 +126,13 @@ ENDC ld [wTitleMonSpecies], a call LoadTitleMonSprite - ld a, (vBGMap0 + $300) / $100 + ld a, HIGH(vBGMap0 + $300) call TitleScreenCopyTileMapToVRAM call SaveScreenTilesToBuffer1 ld a, $40 ldh [hWY], a call LoadScreenTilesFromBuffer2 - ld a, vBGMap0 / $100 + ld a, HIGH(vBGMap0) call TitleScreenCopyTileMapToVRAM ld b, SET_PAL_TITLE_SCREEN call RunPaletteCommand @@ -205,7 +205,7 @@ ENDC and a jr nz, .scrollTitleScreenGameVersionLoop - ld a, vBGMap1 / $100 + ld a, HIGH(vBGMap1) call TitleScreenCopyTileMapToVRAM call LoadScreenTilesFromBuffer2 call PrintGameVersionOnTitleScreen @@ -241,9 +241,9 @@ ENDC inc a ldh [hAutoBGTransferEnabled], a call ClearScreen - ld a, vBGMap0 / $100 + ld a, HIGH(vBGMap0) call TitleScreenCopyTileMapToVRAM - ld a, vBGMap1 / $100 + ld a, HIGH(vBGMap1) call TitleScreenCopyTileMapToVRAM call Delay3 call LoadGBPal @@ -258,7 +258,7 @@ ENDC farjp DoClearSaveDialogue TitleScreenPickNewMon: - ld a, vBGMap0 / $100 + ld a, HIGH(vBGMap0) call TitleScreenCopyTileMapToVRAM .loop diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm index 518742aa..6aac7e23 100755 --- a/engine/movie/trade.asm +++ b/engine/movie/trade.asm @@ -237,7 +237,7 @@ Trade_ShowPlayerMon: ld c, 10 call TextBoxBorder call Trade_PrintPlayerMonInfoText - ld b, vBGMap0 / $100 + ld b, HIGH(vBGMap0) call CopyScreenTileBufferToVRAM call ClearScreen ld a, [wTradedPlayerMonSpecies] @@ -266,7 +266,7 @@ Trade_ShowPlayerMon: Trade_DrawOpenEndOfLinkCable: call Trade_ClearTileMap - ld b, vBGMap0 / $100 + ld b, HIGH(vBGMap0) call CopyScreenTileBufferToVRAM ld b, SET_PAL_GENERIC call RunPaletteCommand diff --git a/engine/overworld/elevator.asm b/engine/overworld/elevator.asm index 7a6aca85..fa404602 100755 --- a/engine/overworld/elevator.asm +++ b/engine/overworld/elevator.asm @@ -56,7 +56,7 @@ ShakeElevatorRedrawRow: add hl, de ld a, h and $3 - or vBGMap0 / $100 + or HIGH(vBGMap0) ld d, a ld a, l pop hl diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index ac7e1b46..a20b3174 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -23,7 +23,7 @@ UpdatePlayerSprite: ret .lowerLeftTileIsMapTile call DetectCollisionBetweenSprites - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ld a, [wWalkCounter] and a jr nz, .moving @@ -395,7 +395,7 @@ UpdateSpriteMovementDelay: ld l, a ld [hl], $1 ; c1x1 = 1 (mark as ready to move) notYetMoving: - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ldh a, [hCurrentSpriteOffset] add wSpritePlayerStateData1AnimFrameCounter - wSpritePlayerStateData1 ld l, a @@ -450,7 +450,7 @@ InitializeSpriteStatus: ; calculates the sprite's screen position form its map position and the player position InitializeSpriteScreenPosition: - ld h, wSpriteStateData2 / $100 + ld h, HIGH(wSpriteStateData2) ldh a, [hCurrentSpriteOffset] add wSpritePlayerStateData2MapY - wSpritePlayerStateData2 ld l, a @@ -478,7 +478,7 @@ CheckSpriteAvailability: ldh a, [hIsHiddenMissableObject] and a jp nz, .spriteInvisible - ld h, wSpriteStateData2 / $100 + ld h, HIGH(wSpriteStateData2) ldh a, [hCurrentSpriteOffset] add wSpritePlayerStateData2MovementByte1 - wSpritePlayerStateData2 ld l, a @@ -526,7 +526,7 @@ CheckSpriteAvailability: cp d jr c, .spriteVisible ; standing on tile with ID >=MAP_TILESET_SIZE (top right tile) .spriteInvisible - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ldh a, [hCurrentSpriteOffset] add wSpritePlayerStateData1ImageIndex - wSpritePlayerStateData1 ld l, a @@ -580,7 +580,7 @@ UpdateSpriteImage: ; e: X movement delta (-1, 0 or 1) ; set carry on failure, clears carry on success CanWalkOntoTile: - ld h, wSpriteStateData2 / $100 + ld h, HIGH(wSpriteStateData2) ldh a, [hCurrentSpriteOffset] add wSpritePlayerStateData2MovementByte1 - wSpritePlayerStateData2 ld l, a @@ -608,7 +608,7 @@ CanWalkOntoTile: ld a, [hl] ; $c2x6 (movement byte 1) inc a jr z, .impassable ; if $ff, no movement allowed (however, changing direction is) - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ldh a, [hCurrentSpriteOffset] add wSpritePlayerStateData1YPixels - wSpritePlayerStateData1 ld l, a @@ -627,14 +627,14 @@ CanWalkOntoTile: call DetectCollisionBetweenSprites pop bc pop de - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ldh a, [hCurrentSpriteOffset] add $c ld l, a ld a, [hl] ; c1xc (directions in which sprite collision would occur) and b ; check against chosen direction (1,2,4 or 8) jr nz, .impassable ; collision between sprites, don't go there - ld h, wSpriteStateData2 / $100 + ld h, HIGH(wSpriteStateData2) ldh a, [hCurrentSpriteOffset] add wSpritePlayerStateData2YDisplacement - wSpritePlayerStateData2 ld l, a @@ -665,7 +665,7 @@ CanWalkOntoTile: and a ; clear carry (marking success) ret .impassable - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ldh a, [hCurrentSpriteOffset] inc a ld l, a @@ -691,7 +691,7 @@ CanWalkOntoTile: ; this is always the lower left tile of the 2x2 tile blocks all sprites are snapped to ; hl: output pointer GetTileSpriteStandsOn: - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ldh a, [hCurrentSpriteOffset] add wSpritePlayerStateData1YPixels - wSpritePlayerStateData1 ld l, a diff --git a/engine/overworld/sprite_collisions.asm b/engine/overworld/sprite_collisions.asm index e6c415ab..6f8e3c2c 100644 --- a/engine/overworld/sprite_collisions.asm +++ b/engine/overworld/sprite_collisions.asm @@ -53,9 +53,9 @@ UpdateNonPlayerSprite: DetectCollisionBetweenSprites: nop - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ldh a, [hCurrentSpriteOffset] - add wSpriteStateData1 % $100 + add LOW(wSpriteStateData1) ld l, a ld a, [hl] ; a = [$c1i0] (picture) (0 if slot is unused) diff --git a/engine/slots/slot_machine.asm b/engine/slots/slot_machine.asm index b6eda6d1..64c14997 100755 --- a/engine/slots/slot_machine.asm +++ b/engine/slots/slot_machine.asm @@ -294,7 +294,7 @@ SlotMachine_StopWheel1Early: ; Stop early if the middle symbol is not a cherry. inc hl ld a, [hl] - cp SLOTSCHERRY >> 8 + cp HIGH(SLOTSCHERRY) jr nz, .stopWheel ret ; It looks like this was intended to make the wheel stop when a 7 symbol was @@ -303,7 +303,7 @@ SlotMachine_StopWheel1Early: ld c, $3 .loop ld a, [hli] - cp SLOTS7 >> 8 + cp HIGH(SLOTS7) jr c, .stopWheel ; condition never true dec c jr nz, .loop @@ -330,7 +330,7 @@ SlotMachine_StopWheel2Early: .sevenAndBarMode call SlotMachine_FindWheel1Wheel2Matches ld a, [de] - cp (SLOTSBAR >> 8) + 1 + cp HIGH(SLOTSBAR) + 1 ret nc .stopWheel xor a @@ -427,7 +427,7 @@ SlotMachine_CheckForMatches: jr nz, .acceptMatch ; if 7/bar matches aren't enabled and the match was a 7/bar symbol, roll wheel ld a, [hl] - cp (SLOTSBAR >> 8) + 1 + cp HIGH(SLOTSBAR) + 1 jr c, .rollWheel3DownByOneSymbol .acceptMatch ld a, [hl] @@ -702,7 +702,7 @@ SlotMachine_PayCoinsToPlayer: .skip1 ld [wAnimCounter], a ld a, [wSlotMachineWinningSymbol] - cp (SLOTSBAR >> 8) + 1 + cp HIGH(SLOTSBAR) + 1 ld c, 8 jr nc, .skip2 srl c ; c = 4 (make the the coins transfer faster if the symbol was 7 or bar) diff --git a/home.asm b/home.asm index 62594b43..3e465cdf 100644 --- a/home.asm +++ b/home.asm @@ -1242,7 +1242,7 @@ StringCmp:: ; c = X coordinate of upper left corner of sprite ; de = base address of 4 tile number and attribute pairs WriteOAMBlock:: - ld h, wOAMBuffer / $100 + ld h, HIGH(wOAMBuffer) swap a ; multiply by 16 ld l, a call .writeOneEntry ; upper left diff --git a/home/init.asm b/home/init.asm index f18216ff..e3f5fdd4 100644 --- a/home/init.asm +++ b/home/init.asm @@ -82,9 +82,9 @@ rLCDC_DEFAULT EQU %11100011 ld a, CONNECTION_NOT_ESTABLISHED ldh [hSerialConnectionStatus], a - ld h, vBGMap0 / $100 + ld h, HIGH(vBGMap0) call ClearBgMap - ld h, vBGMap1 / $100 + ld h, HIGH(vBGMap1) call ClearBgMap ld a, rLCDC_DEFAULT diff --git a/home/move_mon.asm b/home/move_mon.asm index 9fe7b067..cf7213b1 100644 --- a/home/move_mon.asm +++ b/home/move_mon.asm @@ -197,17 +197,17 @@ CalcStat:: ldh [hMultiplicand+1], a ; HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + Level + 10 .noCarry4 ldh a, [hMultiplicand+1] ; check for overflow (>999) - cp 999 / $100 + 1 + cp HIGH(MAX_STAT_VALUE) + 1 jr nc, .overflow - cp 999 / $100 + cp HIGH(MAX_STAT_VALUE) jr c, .noOverflow ldh a, [hMultiplicand+2] - cp 999 % $100 + 1 + cp LOW(MAX_STAT_VALUE) + 1 jr c, .noOverflow .overflow - ld a, 999 / $100 ; overflow: cap at 999 + ld a, HIGH(MAX_STAT_VALUE) ; overflow: cap at 999 ldh [hMultiplicand+1], a - ld a, 999 % $100 + ld a, LOW(MAX_STAT_VALUE) ldh [hMultiplicand+2], a .noOverflow pop bc diff --git a/home/uncompress.asm b/home/uncompress.asm index 69d94cb0..9d08aa60 100644 --- a/home/uncompress.asm +++ b/home/uncompress.asm @@ -20,8 +20,8 @@ UncompressSpriteData:: ; initializes necessary data to load a sprite and runs UncompressSpriteDataLoop _UncompressSpriteData:: ld hl, sSpriteBuffer1 - ld c, (2*SPRITEBUFFERSIZE) % $100 - ld b, (2*SPRITEBUFFERSIZE) / $100 + ld c, LOW(2 * SPRITEBUFFERSIZE) + ld b, HIGH(2 * SPRITEBUFFERSIZE) xor a call FillMemory ; clear sprite buffer 1 and 2 ld a, $1 diff --git a/macros/scripts/audio.asm b/macros/scripts/audio.asm index 8a250c63..4f4d084c 100755 --- a/macros/scripts/audio.asm +++ b/macros/scripts/audio.asm @@ -141,8 +141,7 @@ ENDM ; stored in big endian tempo: MACRO db $ED - db \1 / $100 - db \1 % $100 + db HIGH(\1), LOW(\1) ENDM ; arguments: left output enable mask, right output enable mask diff --git a/scripts/SafariZoneGate.asm b/scripts/SafariZoneGate.asm index eb49ba8d..a15a5630 100755 --- a/scripts/SafariZoneGate.asm +++ b/scripts/SafariZoneGate.asm @@ -182,9 +182,9 @@ SafariZoneGate_TextPointers: call PrintText ld a, 30 ld [wNumSafariBalls], a - ld a, 502 / $100 + ld a, HIGH(502) ld [wSafariSteps], a - ld a, 502 % $100 + ld a, LOW(502) ld [wSafariSteps + 1], a ld a, D_UP ld c, 3 -- cgit v1.3.1-sl0p From 13129459f11e73df8c556f0c02cd4fca7266a346 Mon Sep 17 00:00:00 2001 From: Rangi Date: Tue, 7 Jul 2020 11:30:10 -0400 Subject: Sync coordinate macros with pokecrystal --- engine/battle/animations.asm | 46 +++---- engine/battle/battle_transitions.asm | 84 ++++++------ engine/battle/core.asm | 144 ++++++++++----------- engine/battle/draw_hud_pokeball_gfx.asm | 4 +- engine/battle/end_of_battle.asm | 2 +- engine/battle/ghost_marowak_anim.asm | 2 +- engine/battle/link_battle_versus_text.asm | 8 +- engine/battle/move_effects/drain_hp.asm | 4 +- engine/battle/move_effects/heal.asm | 4 +- engine/battle/move_effects/recoil.asm | 4 +- engine/battle/scroll_draw_trainer_pic.asm | 2 +- engine/battle/trainer_ai.asm | 2 +- engine/battle/wild_encounters.asm | 4 +- engine/events/cinnabar_lab.asm | 4 +- engine/events/diploma.asm | 14 +- engine/events/hidden_objects/bills_house_pc.asm | 4 +- engine/events/hidden_objects/book_or_sculpture.asm | 2 +- engine/events/hidden_objects/bookshelves.asm | 2 +- engine/events/hidden_objects/museum_fossils.asm | 2 +- engine/events/hidden_objects/school_blackboard.asm | 10 +- engine/events/pokemart.asm | 4 +- engine/events/prize_menu.asm | 30 ++--- engine/events/vending_machine.asm | 6 +- engine/items/item_effects.asm | 6 +- engine/items/town_map.asm | 32 ++--- engine/link/cable_club.asm | 58 ++++----- engine/link/print_waiting_text.asm | 4 +- engine/menus/display_text_id_init.asm | 6 +- engine/menus/draw_badges.asm | 4 +- engine/menus/draw_start_menu.asm | 6 +- engine/menus/league_pc.asm | 8 +- engine/menus/main_menu.asm | 64 ++++----- engine/menus/naming_screen.asm | 22 ++-- engine/menus/party_menu.asm | 2 +- engine/menus/players_pc.asm | 4 +- engine/menus/pokedex.asm | 66 +++++----- engine/menus/save.asm | 20 +-- engine/menus/start_sub_menus.asm | 34 ++--- engine/menus/text_box.asm | 16 +-- engine/movie/credits.asm | 14 +- engine/movie/evolution.asm | 4 +- engine/movie/hall_of_fame.asm | 32 ++--- engine/movie/intro.asm | 10 +- engine/movie/oak_speech/clear_save.asm | 2 +- engine/movie/oak_speech/oak_speech.asm | 8 +- engine/movie/oak_speech/oak_speech2.asm | 12 +- engine/movie/title.asm | 12 +- engine/movie/trade.asm | 32 ++--- engine/movie/trade2.asm | 20 +-- engine/overworld/doors.asm | 2 +- engine/overworld/ledges.asm | 2 +- engine/overworld/movement.asm | 4 +- engine/overworld/player_animations.asm | 2 +- engine/overworld/player_state.asm | 30 ++--- engine/pokemon/bills_pc.asm | 40 +++--- engine/pokemon/evos_moves.asm | 2 +- engine/pokemon/learn_move.asm | 8 +- engine/pokemon/status_screen.asm | 62 ++++----- engine/slots/slot_machine.asm | 26 ++-- home.asm | 16 +-- home/copy2.asm | 8 +- home/list_menu.asm | 24 ++-- home/overworld.asm | 18 +-- home/text.asm | 40 +++--- home/vcopy.asm | 6 +- home/yes_no.asm | 6 +- macros/coords.asm | 96 ++++++++------ macros/data.asm | 2 +- macros/gfx.asm | 2 +- macros/scripts/events.asm | 4 +- macros/scripts/text.asm | 2 +- scripts/BikeShop.asm | 6 +- scripts/CeladonMartRoof.asm | 4 +- scripts/GameCorner.asm | 16 +-- scripts/VermilionDock.asm | 6 +- 75 files changed, 667 insertions(+), 653 deletions(-) (limited to 'engine/battle') diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index f19f1f4f..9f7b728a 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -682,7 +682,7 @@ DoBallTossSpecialEffects: cp 1 ret nz .moveGhostMarowakLeft - coord hl, 17, 0 + hlcoord 17, 0 ld de, 20 lb bc, 7, 7 .loop @@ -781,7 +781,7 @@ DoExplodeSpecialEffects: cp 1 ; is it the end of the subanimation? jr nz, FlashScreenEveryFourFrameBlocks ; if it's the end of the subanimation, make the attacking pokemon disappear - coord hl, 1, 5 + hlcoord 1, 5 jp AnimationHideMonPic ; make pokemon disappear ; flashes the screen when subanimation counter is 1 modulo 4 @@ -1135,12 +1135,12 @@ AnimationSlideMonUp: ld c, 7 ldh a, [hWhoseTurn] and a - coord hl, 1, 6 - coord de, 1, 5 + hlcoord 1, 6 + decoord 1, 5 ld a, $30 jr z, .next - coord hl, 12, 1 - coord de, 12, 0 + hlcoord 12, 1 + decoord 12, 0 ld a, $ff .next ld [wSlideMonUpBottomRowLeftTile], a @@ -1203,9 +1203,9 @@ _AnimationSlideMonUp: ; Fill in the bottom row of the mon pic with the next row's tile IDs. ldh a, [hWhoseTurn] and a - coord hl, 1, 11 + hlcoord 1, 11 jr z, .next - coord hl, 12, 6 + hlcoord 12, 6 .next ld a, [wSlideMonUpBottomRowLeftTile] inc a @@ -1372,11 +1372,11 @@ AnimationShakeBackAndForth: ; The mon's sprite disappears after this animation. ldh a, [hWhoseTurn] and a - coord hl, 0, 5 - coord de, 2, 5 + hlcoord 0, 5 + decoord 2, 5 jr z, .next - coord hl, 11, 0 - coord de, 13, 0 + hlcoord 11, 0 + decoord 13, 0 .next xor a @@ -1420,9 +1420,9 @@ AnimationMoveMonHorizontally: call AnimationHideMonPic ldh a, [hWhoseTurn] and a - coord hl, 2, 5 + hlcoord 2, 5 jr z, .next - coord hl, 11, 0 + hlcoord 11, 0 .next xor a push hl @@ -1533,12 +1533,12 @@ AnimationSquishMonPic: ldh a, [hWhoseTurn] and a jr z, .playerTurn - coord hl, 16, 0 - coord de, 14, 0 + hlcoord 16, 0 + decoord 14, 0 jr .next .playerTurn - coord hl, 5, 5 - coord de, 3, 5 + hlcoord 5, 5 + decoord 3, 5 .next push de xor a ; left @@ -1746,10 +1746,10 @@ _AnimationSlideMonOff: ldh a, [hWhoseTurn] and a jr z, .playerTurn - coord hl, 12, 0 + hlcoord 12, 0 jr .next .playerTurn - coord hl, 0, 5 + hlcoord 0, 5 .next ld d, 8 ; d's value is unused .slideLoop ; iterates once for each time the pic slides by one tile @@ -1996,7 +1996,7 @@ ChangeMonPic: xor a ld [wSpriteFlipped], a call GetMonHeader - coord hl, 12, 0 + hlcoord 12, 0 call LoadFrontSpriteByMonIndex jr .done .playerTurn @@ -2064,7 +2064,7 @@ ClearMonPicFromTileMap: push bc ld e, a ld d, 0 - coord hl, 0, 0 + hlcoord 0, 0 add hl, de lb bc, 7, 7 call ClearScreenArea @@ -2086,7 +2086,7 @@ GetMonSpriteTileMapPointerFromRowCount: .enemyTurn ld a, 12 .next - coord hl, 0, 0 + hlcoord 0, 0 ld e, a ld d, 0 add hl, de diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index 8a22e70f..e563855d 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -181,7 +181,7 @@ BattleTransition_Spiral: call BattleTransition_InwardSpiral jr .done .outwardSpiral - coord hl, 10, 10 + hlcoord 10, 10 ld a, $3 ld [wOutwardSpiralCurrentDirection], a ld a, l @@ -210,7 +210,7 @@ BattleTransition_Spiral: BattleTransition_InwardSpiral: ld a, 7 ld [wInwardSpiralUpdateScreenCounter], a - coord hl, 0, 0 + hlcoord 0, 0 ld c, SCREEN_HEIGHT - 1 ld de, SCREEN_WIDTH call BattleTransition_InwardSpiral_ @@ -350,20 +350,20 @@ BattleTransition_Shrink: push bc xor a ldh [hAutoBGTransferEnabled], a - coord hl, 0, 7 - coord de, 0, 8 + hlcoord 0, 7 + decoord 0, 8 ld bc, -SCREEN_WIDTH * 2 call BattleTransition_CopyTiles1 - coord hl, 0, 10 - coord de, 0, 9 + hlcoord 0, 10 + decoord 0, 9 ld bc, SCREEN_WIDTH * 2 call BattleTransition_CopyTiles1 - coord hl, 8, 0 - coord de, 9, 0 + hlcoord 8, 0 + decoord 9, 0 ld bc, -2 call BattleTransition_CopyTiles2 - coord hl, 11, 0 - coord de, 10, 0 + hlcoord 11, 0 + decoord 10, 0 ld bc, 2 call BattleTransition_CopyTiles2 ld a, $1 @@ -384,20 +384,20 @@ BattleTransition_Split: ldh [hAutoBGTransferEnabled], a .loop push bc - coord hl, 0, 16 - coord de, 0, 17 + hlcoord 0, 16 + decoord 0, 17 ld bc, -SCREEN_WIDTH * 2 call BattleTransition_CopyTiles1 - coord hl, 0, 1 - coord de, 0, 0 + hlcoord 0, 1 + decoord 0, 0 ld bc, SCREEN_WIDTH * 2 call BattleTransition_CopyTiles1 - coord hl, 18, 0 - coord de, 19, 0 + hlcoord 18, 0 + decoord 19, 0 ld bc, -2 call BattleTransition_CopyTiles2 - coord hl, 1, 0 - coord de, 0, 0 + hlcoord 1, 0 + decoord 0, 0 ld bc, 2 call BattleTransition_CopyTiles2 call BattleTransition_TransferDelay3 @@ -493,8 +493,8 @@ BattleTransition_CopyTiles2: ; used for high level wild dungeon battles BattleTransition_VerticalStripes: ld c, SCREEN_HEIGHT - coord hl, 0, 0 - coord de, 1, 17 + hlcoord 0, 0 + decoord 1, 17 xor a ldh [hAutoBGTransferEnabled], a .loop @@ -532,8 +532,8 @@ BattleTransition_VerticalStripes_: ; used for low level wild dungeon battles BattleTransition_HorizontalStripes: ld c, SCREEN_WIDTH - coord hl, 0, 0 - coord de, 19, 1 + hlcoord 0, 0 + decoord 19, 1 xor a ldh [hAutoBGTransferEnabled], a .loop @@ -654,84 +654,84 @@ BattleTransition_Circle_Sub2: BattleTransition_HalfCircle1: db $01 dw BattleTransition_CircleData1 - dwCoord 18, 6 + dwcoord 18, 6 db $01 dw BattleTransition_CircleData2 - dwCoord 19, 3 + dwcoord 19, 3 db $01 dw BattleTransition_CircleData3 - dwCoord 18, 0 + dwcoord 18, 0 db $01 dw BattleTransition_CircleData4 - dwCoord 14, 0 + dwcoord 14, 0 db $01 dw BattleTransition_CircleData5 - dwCoord 10, 0 + dwcoord 10, 0 db $00 dw BattleTransition_CircleData5 - dwCoord 9, 0 + dwcoord 9, 0 db $00 dw BattleTransition_CircleData4 - dwCoord 5, 0 + dwcoord 5, 0 db $00 dw BattleTransition_CircleData3 - dwCoord 1, 0 + dwcoord 1, 0 db $00 dw BattleTransition_CircleData2 - dwCoord 0, 3 + dwcoord 0, 3 db $00 dw BattleTransition_CircleData1 - dwCoord 1, 6 + dwcoord 1, 6 BattleTransition_HalfCircle2: db $00 dw BattleTransition_CircleData1 - dwCoord 1, 11 + dwcoord 1, 11 db $00 dw BattleTransition_CircleData2 - dwCoord 0, 14 + dwcoord 0, 14 db $00 dw BattleTransition_CircleData3 - dwCoord 1, 17 + dwcoord 1, 17 db $00 dw BattleTransition_CircleData4 - dwCoord 5, 17 + dwcoord 5, 17 db $00 dw BattleTransition_CircleData5 - dwCoord 9, 17 + dwcoord 9, 17 db $01 dw BattleTransition_CircleData5 - dwCoord 10, 17 + dwcoord 10, 17 db $01 dw BattleTransition_CircleData4 - dwCoord 14, 17 + dwcoord 14, 17 db $01 dw BattleTransition_CircleData3 - dwCoord 18, 17 + dwcoord 18, 17 db $01 dw BattleTransition_CircleData2 - dwCoord 19, 14 + dwcoord 19, 14 db $01 dw BattleTransition_CircleData1 - dwCoord 18, 11 + dwcoord 18, 11 BattleTransition_Circle_Sub3: push hl diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 9a66265c..859f30d5 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -11,7 +11,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: ld a, MESSAGE_BOX ; the usual text box at the bottom of the screen ld [wTextBoxID], a call DisplayTextBoxID - coord hl, 1, 5 + hlcoord 1, 5 lb bc, 3, 7 call ClearScreenArea call DisableLCD @@ -27,7 +27,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: or c jr nz, .clearBackgroundLoop ; copy the work RAM tile map to VRAM - coord hl, 0, 0 + hlcoord 0, 0 ld de, vBGMap0 ld b, 18 ; number of rows .copyRowLoop @@ -86,7 +86,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: ldh [hAutoBGTransferEnabled], a ld a, $31 ldh [hStartTileID], a - coord hl, 1, 5 + hlcoord 1, 5 predef CopyUncompressedPicToTilemap xor a ldh [hWY], a @@ -232,7 +232,7 @@ StartBattle: ld [wcf91], a ld [wBattleMonSpecies2], a call LoadScreenTilesFromBuffer1 - coord hl, 1, 5 + hlcoord 1, 5 ld a, $9 call SlideTrainerPicOffScreen call SaveScreenTilesToBuffer1 @@ -666,12 +666,12 @@ HandlePoisonBurnLeechSeed_IncreaseEnemyHP: ret UpdateCurMonHPBar: - coord hl, 10, 9 ; tile pointer to player HP bar + hlcoord 10, 9 ; tile pointer to player HP bar ldh a, [hWhoseTurn] and a ld a, $1 jr z, .playersTurn - coord hl, 2, 2 ; tile pointer to enemy HP bar + hlcoord 2, 2 ; tile pointer to enemy HP bar xor a .playersTurn push bc @@ -767,10 +767,10 @@ FaintEnemyPokemon: ld hl, wPlayerUsedMove ld [hli], a ld [hl], a - coord hl, 12, 5 - coord de, 12, 6 + hlcoord 12, 5 + decoord 12, 6 call SlideDownFaintedMonPic - coord hl, 0, 0 + hlcoord 0, 0 lb bc, 4, 11 call ClearScreenArea ld a, [wIsInBattle] @@ -1021,11 +1021,11 @@ RemoveFaintedPlayerMon: ld [hl], a ld [wBattleMonStatus], a call ReadPlayerMonCurHPAndStatus - coord hl, 9, 7 + hlcoord 9, 7 lb bc, 5, 11 call ClearScreenArea - coord hl, 1, 10 - coord de, 1, 11 + hlcoord 1, 10 + decoord 1, 11 call SlideDownFaintedMonPic ld a, $1 ld [wBattleResult], a @@ -1059,7 +1059,7 @@ DoUseNextMonDialogue: ld hl, UseNextMonText call PrintText .displayYesNoBox - coord hl, 13, 9 + hlcoord 13, 9 lb bc, 10, 14 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -1136,7 +1136,7 @@ HandlePlayerBlackOut: ld a, [wCurOpponent] cp OPP_SONY1 jr nz, .notSony1Battle - coord hl, 0, 0 ; sony 1 battle + hlcoord 0, 0 ; sony 1 battle lb bc, 8, 21 call ClearScreenArea call ScrollTrainerPicAfterBattle @@ -1306,7 +1306,7 @@ EnemySendOutFirstMon: ld [wAICount], a ld hl, wPlayerBattleStatus1 res 5, [hl] - coord hl, 18, 0 + hlcoord 18, 0 ld a, 8 call SlideTrainerPicOffScreen call PrintEmptyString @@ -1376,7 +1376,7 @@ EnemySendOutFirstMon: jr nz, .next4 ld hl, TrainerAboutToUseText call PrintText - coord hl, 0, 7 + hlcoord 0, 7 lb bc, 8, 1 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -1411,7 +1411,7 @@ EnemySendOutFirstMon: call LoadScreenTilesFromBuffer1 .next4 call ClearSprites - coord hl, 0, 0 + hlcoord 0, 0 lb bc, 4, 11 call ClearScreenArea ld b, SET_PAL_BATTLE @@ -1427,7 +1427,7 @@ EnemySendOutFirstMon: call LoadMonFrontSprite ld a, -$31 ldh [hStartTileID], a - coord hl, 15, 6 + hlcoord 15, 6 predef AnimateSendingOutMon ld a, [wEnemyMonSpecies2] call PlayCry @@ -1757,7 +1757,7 @@ SendOutMon: ldh [hWhoseTurn], a ld a, POOF_ANIM call PlayMoveAnimation - coord hl, 4, 11 + hlcoord 4, 11 predef AnimateSendingOutMon ld a, [wcf91] call PlayCry @@ -1766,10 +1766,10 @@ SendOutMon: ; show 2 stages of the player mon getting smaller before disappearing AnimateRetreatingPlayerMon: - coord hl, 1, 5 + hlcoord 1, 5 lb bc, 7, 7 call ClearScreenArea - coord hl, 3, 7 + hlcoord 3, 7 lb bc, 5, 5 xor a ld [wDownscaledMonSize], a @@ -1778,7 +1778,7 @@ AnimateRetreatingPlayerMon: ld c, 4 call DelayFrames call .clearScreenArea - coord hl, 4, 9 + hlcoord 4, 9 lb bc, 3, 3 ld a, 1 ld [wDownscaledMonSize], a @@ -1788,9 +1788,9 @@ AnimateRetreatingPlayerMon: call Delay3 call .clearScreenArea ld a, $4c - Coorda 5, 11 + ldcoord_a 5, 11 .clearScreenArea - coord hl, 1, 5 + hlcoord 1, 5 lb bc, 7, 7 jp ClearScreenArea @@ -1813,14 +1813,14 @@ DrawHUDsAndHPBars: DrawPlayerHUDAndHPBar: xor a ldh [hAutoBGTransferEnabled], a - coord hl, 9, 7 + hlcoord 9, 7 lb bc, 5, 11 call ClearScreenArea callfar PlacePlayerHUDTiles - coord hl, 18, 9 + hlcoord 18, 9 ld [hl], $73 ld de, wBattleMonNick - coord hl, 10, 7 + hlcoord 10, 7 call CenterMonName call PlaceString ld hl, wBattleMonSpecies @@ -1831,7 +1831,7 @@ DrawPlayerHUDAndHPBar: ld de, wLoadedMonLevel ld bc, wBattleMonPP - wBattleMonLevel call CopyData - coord hl, 14, 8 + hlcoord 14, 8 push hl inc hl ld de, wLoadedMonStatus @@ -1842,7 +1842,7 @@ DrawPlayerHUDAndHPBar: .doNotPrintLevel ld a, [wLoadedMonSpecies] ld [wcf91], a - coord hl, 10, 9 + hlcoord 10, 9 predef DrawHP ld a, $1 ldh [hAutoBGTransferEnabled], a @@ -1874,15 +1874,15 @@ DrawPlayerHUDAndHPBar: DrawEnemyHUDAndHPBar: xor a ldh [hAutoBGTransferEnabled], a - coord hl, 0, 0 + hlcoord 0, 0 lb bc, 4, 12 call ClearScreenArea callfar PlaceEnemyHUDTiles ld de, wEnemyMonNick - coord hl, 1, 0 + hlcoord 1, 0 call CenterMonName call PlaceString - coord hl, 4, 1 + hlcoord 4, 1 push hl inc hl ld de, wEnemyMonStatus @@ -1955,7 +1955,7 @@ DrawEnemyHUDAndHPBar: .drawHPBar xor a ld [wHPBarType], a - coord hl, 2, 2 + hlcoord 2, 2 call DrawHPBar ld a, $1 ldh [hAutoBGTransferEnabled], a @@ -2030,12 +2030,12 @@ DisplayBattleMenu:: ld bc, NAME_LENGTH call CopyData ; the following simulates the keystrokes by drawing menus on screen - coord hl, 9, 14 + hlcoord 9, 14 ld [hl], "▶" ld c, 80 call DelayFrames ld [hl], " " - coord hl, 9, 16 + hlcoord 9, 16 ld [hl], "▶" ld c, 50 call DelayFrames @@ -2060,14 +2060,14 @@ DisplayBattleMenu:: ld a, " " jr z, .safariLeftColumn ; put cursor in left column for normal battle menu (i.e. when it's not a Safari battle) - Coorda 15, 14 ; clear upper cursor position in right column - Coorda 15, 16 ; clear lower cursor position in right column + ldcoord_a 15, 14 ; clear upper cursor position in right column + ldcoord_a 15, 16 ; clear lower cursor position in right column ld b, $9 ; top menu item X jr .leftColumn_WaitForInput .safariLeftColumn - Coorda 13, 14 - Coorda 13, 16 - coord hl, 7, 14 + ldcoord_a 13, 14 + ldcoord_a 13, 16 + hlcoord 7, 14 ld de, wNumSafariBalls lb bc, 1, 2 call PrintNumber @@ -2093,14 +2093,14 @@ DisplayBattleMenu:: ld a, " " jr z, .safariRightColumn ; put cursor in right column for normal battle menu (i.e. when it's not a Safari battle) - Coorda 9, 14 ; clear upper cursor position in left column - Coorda 9, 16 ; clear lower cursor position in left column + ldcoord_a 9, 14 ; clear upper cursor position in left column + ldcoord_a 9, 16 ; clear lower cursor position in left column ld b, $f ; top menu item X jr .rightColumn_WaitForInput .safariRightColumn - Coorda 1, 14 ; clear upper cursor position in left column - Coorda 1, 16 ; clear lower cursor position in left column - coord hl, 7, 14 + ldcoord_a 1, 14 ; clear upper cursor position in left column + ldcoord_a 1, 16 ; clear lower cursor position in left column + hlcoord 7, 14 ld de, wNumSafariBalls lb bc, 1, 2 call PrintNumber @@ -2321,7 +2321,7 @@ PartyMenuOrRockOrRun: call GBPalNormal jp DisplayBattleMenu .partyMonDeselected - coord hl, 11, 11 + hlcoord 11, 11 ld bc, 6 * SCREEN_WIDTH + 9 ld a, " " call FillMemory @@ -2483,18 +2483,18 @@ MoveSelectionMenu: ret z ld hl, wBattleMonMoves call .loadmoves - coord hl, 4, 12 + hlcoord 4, 12 ld b, 4 ld c, 14 di ; out of pure coincidence, it is possible for vblank to occur between the di and ei ; so it is necessary to put the di ei block to not cause tearing call TextBoxBorder - coord hl, 4, 12 + hlcoord 4, 12 ld [hl], $7a - coord hl, 10, 12 + hlcoord 10, 12 ld [hl], $7e ei - coord hl, 6, 13 + hlcoord 6, 13 call .writemoves ld b, $5 ld a, $c @@ -2502,11 +2502,11 @@ MoveSelectionMenu: .mimicmenu ld hl, wEnemyMonMoves call .loadmoves - coord hl, 0, 7 + hlcoord 0, 7 ld b, 4 ld c, 14 call TextBoxBorder - coord hl, 2, 8 + hlcoord 2, 8 call .writemoves ld b, $1 ld a, $7 @@ -2517,11 +2517,11 @@ MoveSelectionMenu: ld bc, wPartyMon2 - wPartyMon1 call AddNTimes call .loadmoves - coord hl, 4, 7 + hlcoord 4, 7 ld b, 4 ld c, 14 call TextBoxBorder - coord hl, 6, 8 + hlcoord 6, 8 call .writemoves ld b, $5 ld a, $7 @@ -2577,7 +2577,7 @@ SelectMenuItem: jr z, .battleselect dec a jr nz, .select - coord hl, 1, 14 + hlcoord 1, 14 ld de, WhichTechniqueString call PlaceString jr .select @@ -2589,7 +2589,7 @@ SelectMenuItem: ld a, [wMenuItemToSwap] and a jr z, .select - coord hl, 5, 13 + hlcoord 5, 13 dec a ld bc, SCREEN_WIDTH call AddNTimes @@ -2826,7 +2826,7 @@ SwapMovesInMenu: PrintMenuItem: xor a ldh [hAutoBGTransferEnabled], a - coord hl, 0, 8 + hlcoord 0, 8 ld b, 3 ld c, 9 call TextBoxBorder @@ -2839,7 +2839,7 @@ PrintMenuItem: ld a, [wCurrentMenuItem] cp b jr nz, .notDisabled - coord hl, 1, 10 + hlcoord 1, 10 ld de, DisabledText call PlaceString jr .moveDisabled @@ -2871,23 +2871,23 @@ PrintMenuItem: and $3f ld [wcd6d], a ; print TYPE/ and / - coord hl, 1, 9 + hlcoord 1, 9 ld de, TypeText call PlaceString - coord hl, 7, 11 + hlcoord 7, 11 ld [hl], "/" - coord hl, 5, 9 + hlcoord 5, 9 ld [hl], "/" - coord hl, 5, 11 + hlcoord 5, 11 ld de, wcd6d lb bc, 1, 2 call PrintNumber - coord hl, 8, 11 + hlcoord 8, 11 ld de, wMaxPP lb bc, 1, 2 call PrintNumber call GetCurrentMove - coord hl, 2, 10 + hlcoord 2, 10 predef PrintMoveType .moveDisabled ld a, $1 @@ -4822,7 +4822,7 @@ ApplyDamageToEnemyPokemon: ld [wHPBarNewHP+1], a ld a, [hl] ld [wHPBarNewHP], a - coord hl, 2, 2 + hlcoord 2, 2 xor a ld [wHPBarType], a predef UpdateHPBar2 ; animate the HP bar shortening @@ -4940,7 +4940,7 @@ ApplyDamageToPlayerPokemon: ld [wHPBarMaxHP+1], a ld a, [hl] ld [wHPBarMaxHP], a - coord hl, 10, 9 + hlcoord 10, 9 ld a, $01 ld [wHPBarType], a predef UpdateHPBar2 ; animate the HP bar shortening @@ -6354,7 +6354,7 @@ LoadPlayerBackPic: ld [MBC1SRamEnable], a ld a, $31 ldh [hStartTileID], a - coord hl, 1, 5 + hlcoord 1, 5 predef_jump CopyUncompressedPicToTilemap ; does nothing since no stats are ever selected (barring glitches) @@ -6770,7 +6770,7 @@ InitBattleCommon: ldh [hStartTileID], a dec a ld [wAICount], a - coord hl, 12, 0 + hlcoord 12, 0 predef CopyUncompressedPicToTilemap ld a, $ff ld [wEnemyMonPartyPos], a @@ -6824,7 +6824,7 @@ InitWildBattle: xor a ld [wTrainerClass], a ldh [hStartTileID], a - coord hl, 12, 0 + hlcoord 12, 0 predef CopyUncompressedPicToTilemap ; common code that executes after init battle code specific to trainer or wild battles @@ -6846,10 +6846,10 @@ _InitBattleCommon: ld a, $9c ldh [hAutoBGTransferDest + 1], a call LoadScreenTilesFromBuffer1 - coord hl, 9, 7 + hlcoord 9, 7 lb bc, 5, 10 call ClearScreenArea - coord hl, 1, 0 + hlcoord 1, 0 lb bc, 4, 10 call ClearScreenArea call ClearSprites @@ -6993,7 +6993,7 @@ LoadMonBackPic: ; been loaded with GetMonHeader. ld a, [wBattleMonSpecies2] ld [wcf91], a - coord hl, 1, 5 + hlcoord 1, 5 ld b, 7 ld c, 8 call ClearScreenArea diff --git a/engine/battle/draw_hud_pokeball_gfx.asm b/engine/battle/draw_hud_pokeball_gfx.asm index c0a91949..8cd9528d 100644 --- a/engine/battle/draw_hud_pokeball_gfx.asm +++ b/engine/battle/draw_hud_pokeball_gfx.asm @@ -121,7 +121,7 @@ PlacePlayerHUDTiles: ld de, wHUDGraphicsTiles ld bc, $3 call CopyData - coord hl, 18, 10 + hlcoord 18, 10 ld de, -1 jr PlaceHUDTiles @@ -136,7 +136,7 @@ PlaceEnemyHUDTiles: ld de, wHUDGraphicsTiles ld bc, $3 call CopyData - coord hl, 1, 2 + hlcoord 1, 2 ld de, $1 jr PlaceHUDTiles diff --git a/engine/battle/end_of_battle.asm b/engine/battle/end_of_battle.asm index aa96f31d..bd4a1901 100755 --- a/engine/battle/end_of_battle.asm +++ b/engine/battle/end_of_battle.asm @@ -19,7 +19,7 @@ EndOfBattle: jr z, .placeWinOrLoseString ld de, DrawText .placeWinOrLoseString - coord hl, 6, 8 + hlcoord 6, 8 call PlaceString ld c, 200 call DelayFrames diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm index 9c47fd53..7405c40b 100644 --- a/engine/battle/ghost_marowak_anim.asm +++ b/engine/battle/ghost_marowak_anim.asm @@ -4,7 +4,7 @@ MarowakAnim: ldh [rOBP1], a call CopyMonPicFromBGToSpriteVRAM ; cover the BG ghost pic with a sprite ghost pic that looks the same ; now that the ghost pic is being displayed using sprites, clear the ghost pic from the BG tilemap - coord hl, 12, 0 + hlcoord 12, 0 lb bc, 7, 7 call ClearScreenArea call Delay3 diff --git a/engine/battle/link_battle_versus_text.asm b/engine/battle/link_battle_versus_text.asm index 22fec0f3..29c11356 100644 --- a/engine/battle/link_battle_versus_text.asm +++ b/engine/battle/link_battle_versus_text.asm @@ -1,18 +1,18 @@ ; display "[player] VS [enemy]" text box with pokeballs representing their parties next to the names DisplayLinkBattleVersusTextBox: call LoadTextBoxTilePatterns - coord hl, 3, 4 + hlcoord 3, 4 ld b, 7 ld c, 12 call TextBoxBorder - coord hl, 4, 5 + hlcoord 4, 5 ld de, wPlayerName call PlaceString - coord hl, 4, 10 + hlcoord 4, 10 ld de, wLinkEnemyTrainerName call PlaceString ; place bold "VS" tiles between the names - coord hl, 9, 8 + hlcoord 9, 8 ld a, $69 ld [hli], a ld [hl], $6a diff --git a/engine/battle/move_effects/drain_hp.asm b/engine/battle/move_effects/drain_hp.asm index e7b241f6..04a585cc 100644 --- a/engine/battle/move_effects/drain_hp.asm +++ b/engine/battle/move_effects/drain_hp.asm @@ -71,10 +71,10 @@ DrainHPEffect_: .next ldh a, [hWhoseTurn] and a - coord hl, 10, 9 + hlcoord 10, 9 ld a, $1 jr z, .next2 - coord hl, 2, 2 + hlcoord 2, 2 xor a .next2 ld [wHPBarType], a diff --git a/engine/battle/move_effects/heal.asm b/engine/battle/move_effects/heal.asm index d12b1ea4..e9fb62a7 100644 --- a/engine/battle/move_effects/heal.asm +++ b/engine/battle/move_effects/heal.asm @@ -89,10 +89,10 @@ HealEffect_: call BankswitchEtoF ldh a, [hWhoseTurn] and a - coord hl, 10, 9 + hlcoord 10, 9 ld a, $1 jr z, .updateHPBar - coord hl, 2, 2 + hlcoord 2, 2 xor a .updateHPBar ld [wHPBarType], a diff --git a/engine/battle/move_effects/recoil.asm b/engine/battle/move_effects/recoil.asm index aa2a3fed..85110d50 100644 --- a/engine/battle/move_effects/recoil.asm +++ b/engine/battle/move_effects/recoil.asm @@ -53,12 +53,12 @@ RecoilEffect_: ld [hli], a ld [hl], a .getHPBarCoords - coord hl, 10, 9 + hlcoord 10, 9 ldh a, [hWhoseTurn] and a ld a, $1 jr z, .updateHPBar - coord hl, 2, 2 + hlcoord 2, 2 xor a .updateHPBar ld [wHPBarType], a diff --git a/engine/battle/scroll_draw_trainer_pic.asm b/engine/battle/scroll_draw_trainer_pic.asm index 978fb71a..e19d681a 100644 --- a/engine/battle/scroll_draw_trainer_pic.asm +++ b/engine/battle/scroll_draw_trainer_pic.asm @@ -6,7 +6,7 @@ _ScrollTrainerPicAfterBattle: ld b, SET_PAL_BATTLE call RunPaletteCommand callfar _LoadTrainerPic - coord hl, 19, 0 + hlcoord 19, 0 ld c, $0 .scrollLoop inc c diff --git a/engine/battle/trainer_ai.asm b/engine/battle/trainer_ai.asm index ea476538..87bec842 100644 --- a/engine/battle/trainer_ai.asm +++ b/engine/battle/trainer_ai.asm @@ -542,7 +542,7 @@ AIRecoverHP: AIPrintItemUseAndUpdateHPBar: call AIPrintItemUse_ - coord hl, 2, 2 + hlcoord 2, 2 xor a ld [wHPBarType], a predef UpdateHPBar2 diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm index 3d0eb556..e24f9632 100644 --- a/engine/battle/wild_encounters.asm +++ b/engine/battle/wild_encounters.asm @@ -25,7 +25,7 @@ TryDoWildEncounter: .next ; determine if wild pokemon can appear in the half-block we're standing in ; is the bottom right tile (9,9) of the half-block we're standing in a grass/water tile? - coord hl, 9, 9 + hlcoord 9, 9 ld c, [hl] ld a, [wGrassTile] cp c @@ -64,7 +64,7 @@ TryDoWildEncounter: ; determine which wild pokemon (grass or water) can appear in the half-block we're standing in ld c, [hl] ld hl, wGrassMons - aCoord 8, 9 + lda_coord 8, 9 cp $14 ; is the bottom left tile (8,9) of the half-block we're standing in a water tile? jr nz, .gotWildEncounterType ; else, it's treated as a grass tile by default ld hl, wWaterMons diff --git a/engine/events/cinnabar_lab.asm b/engine/events/cinnabar_lab.asm index aaa0428e..bccc95d1 100755 --- a/engine/events/cinnabar_lab.asm +++ b/engine/events/cinnabar_lab.asm @@ -20,7 +20,7 @@ GiveFossilToCinnabarLab:: dec l ld b, l ld c, $d - coord hl, 0, 0 + hlcoord 0, 0 call TextBoxBorder call UpdateSprites call PrintFossilsInBag @@ -100,7 +100,7 @@ PrintFossilsInBag: push hl ld [wd11e], a call GetItemName - coord hl, 2, 2 + hlcoord 2, 2 ldh a, [hItemCounter] ld bc, SCREEN_WIDTH * 2 call AddNTimes diff --git a/engine/events/diploma.asm b/engine/events/diploma.asm index 95dabab3..3248e152 100755 --- a/engine/events/diploma.asm +++ b/engine/events/diploma.asm @@ -14,7 +14,7 @@ DisplayDiploma:: ld bc, $10 ld a, BANK(CircleTile) call FarCopyData2 - coord hl, 0, 0 + hlcoord 0, 0 lb bc, 16, 18 predef Diploma_TextBoxBorder ld hl, DiplomaTextPointersAndCoords @@ -35,7 +35,7 @@ DisplayDiploma:: pop bc dec c jr nz, .asm_56715 - coord hl, 10, 4 + hlcoord 10, 4 ld de, wPlayerName call PlaceString farcall DrawPlayerCharacter @@ -85,15 +85,15 @@ UnusedPlayerNameLengthFunc: DiplomaTextPointersAndCoords: dw DiplomaText - dwCoord 5, 2 + dwcoord 5, 2 dw DiplomaPlayer - dwCoord 3, 4 + dwcoord 3, 4 dw DiplomaEmptyText - dwCoord 15, 4 + dwcoord 15, 4 dw DiplomaCongrats - dwCoord 2, 6 + dwcoord 2, 6 dw DiplomaGameFreak - dwCoord 9, 16 + dwcoord 9, 16 DiplomaText: db CIRCLE_TILE_ID, "Diploma", CIRCLE_TILE_ID, "@" diff --git a/engine/events/hidden_objects/bills_house_pc.asm b/engine/events/hidden_objects/bills_house_pc.asm index 92679d66..a73596b4 100644 --- a/engine/events/hidden_objects/bills_house_pc.asm +++ b/engine/events/hidden_objects/bills_house_pc.asm @@ -84,11 +84,11 @@ BillsHousePokemonList:: .billsPokemonLoop ld hl, wd730 set 6, [hl] - coord hl, 0, 0 + hlcoord 0, 0 ld b, 10 ld c, 9 call TextBoxBorder - coord hl, 2, 2 + hlcoord 2, 2 ld de, BillsMonListText call PlaceString ld hl, BillsHousePokemonListText2 diff --git a/engine/events/hidden_objects/book_or_sculpture.asm b/engine/events/hidden_objects/book_or_sculpture.asm index 2f3334b8..e04f4047 100644 --- a/engine/events/hidden_objects/book_or_sculpture.asm +++ b/engine/events/hidden_objects/book_or_sculpture.asm @@ -4,7 +4,7 @@ BookOrSculptureText:: ld a, [wCurMapTileset] cp MANSION ; Celadon Mansion tileset jr nz, .ok - aCoord 8, 6 + lda_coord 8, 6 cp $38 jr nz, .ok ld hl, DiglettSculptureText diff --git a/engine/events/hidden_objects/bookshelves.asm b/engine/events/hidden_objects/bookshelves.asm index 23c087cc..b58444af 100644 --- a/engine/events/hidden_objects/bookshelves.asm +++ b/engine/events/hidden_objects/bookshelves.asm @@ -6,7 +6,7 @@ PrintBookshelfText:: ; facing up ld a, [wCurMapTileset] ld b, a - aCoord 8, 7 + lda_coord 8, 7 ld c, a ld hl, BookshelfTileIDs .loop diff --git a/engine/events/hidden_objects/museum_fossils.asm b/engine/events/hidden_objects/museum_fossils.asm index ef53ed89..5d7e08fd 100644 --- a/engine/events/hidden_objects/museum_fossils.asm +++ b/engine/events/hidden_objects/museum_fossils.asm @@ -42,7 +42,7 @@ DisplayMonFrontSpriteInBox: call LoadMonFrontSprite ld a, $80 ldh [hStartTileID], a - coord hl, 10, 11 + hlcoord 10, 11 predef AnimateSendingOutMon call WaitForTextScrollButtonPress call LoadScreenTilesFromBuffer1 diff --git a/engine/events/hidden_objects/school_blackboard.asm b/engine/events/hidden_objects/school_blackboard.asm index 48b97d73..de4700d4 100644 --- a/engine/events/hidden_objects/school_blackboard.asm +++ b/engine/events/hidden_objects/school_blackboard.asm @@ -26,11 +26,11 @@ LinkCableHelp:: .linkHelpLoop ld hl, wd730 set 6, [hl] - coord hl, 0, 0 + hlcoord 0, 0 ld b, 8 ld c, 13 call TextBoxBorder - coord hl, 2, 2 + hlcoord 2, 2 ld de, HowToLinkText call PlaceString ld hl, LinkCableHelpText2 @@ -110,13 +110,13 @@ ViridianSchoolBlackboard:: .blackboardLoop ld hl, wd730 set 6, [hl] - coord hl, 0, 0 + hlcoord 0, 0 lb bc, 6, 10 call TextBoxBorder - coord hl, 1, 2 + hlcoord 1, 2 ld de, StatusAilmentText1 call PlaceString - coord hl, 6, 2 + hlcoord 6, 2 ld de, StatusAilmentText2 call PlaceString ld hl, ViridianSchoolBlackboardText2 diff --git a/engine/events/pokemart.asm b/engine/events/pokemart.asm index 3345f540..c7cb8115 100755 --- a/engine/events/pokemart.asm +++ b/engine/events/pokemart.asm @@ -84,7 +84,7 @@ DisplayPokemartDialogue_:: ld hl, PokemartTellSellPriceText lb bc, 14, 1 ; location that PrintText always prints to, this is useless call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -162,7 +162,7 @@ DisplayPokemartDialogue_:: call CopyStringToCF4B ; copy name to wcf4b ld hl, PokemartTellBuyPriceText call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a diff --git a/engine/events/prize_menu.asm b/engine/events/prize_menu.asm index 2d8bde90..d9320fe7 100755 --- a/engine/events/prize_menu.asm +++ b/engine/events/prize_menu.asm @@ -22,7 +22,7 @@ CeladonPrizeMenu:: ld a, $01 ld [wTopMenuItemX], a call PrintPrizePrice - coord hl, 0, 2 + hlcoord 0, 2 ld b, 8 ld c, 16 call TextBoxBorder @@ -93,71 +93,71 @@ GetPrizeMenuId: ld a, [wPrize1] ld [wd11e], a call GetItemName - coord hl, 2, 4 + hlcoord 2, 4 call PlaceString ld a, [wPrize2] ld [wd11e], a call GetItemName - coord hl, 2, 6 + hlcoord 2, 6 call PlaceString ld a, [wPrize3] ld [wd11e], a call GetItemName - coord hl, 2, 8 + hlcoord 2, 8 call PlaceString jr .putNoThanksText .putMonName ld a, [wPrize1] ld [wd11e], a call GetMonName - coord hl, 2, 4 + hlcoord 2, 4 call PlaceString ld a, [wPrize2] ld [wd11e], a call GetMonName - coord hl, 2, 6 + hlcoord 2, 6 call PlaceString ld a, [wPrize3] ld [wd11e], a call GetMonName - coord hl, 2, 8 + hlcoord 2, 8 call PlaceString .putNoThanksText - coord hl, 2, 10 + hlcoord 2, 10 ld de, NoThanksText call PlaceString ; put prices on the right side of the textbox ld de, wPrize1Price - coord hl, 13, 5 + hlcoord 13, 5 ; reg. c: ; [low nybble] number of bytes ; [bits 765 = %100] space-padding (not zero-padding) ld c, (1 << 7 | 2) call PrintBCDNumber ld de, wPrize2Price - coord hl, 13, 7 + hlcoord 13, 7 ld c, (1 << 7 | 2) call PrintBCDNumber ld de, wPrize3Price - coord hl, 13, 9 + hlcoord 13, 9 ld c, (1 << 7 | 2) jp PrintBCDNumber INCLUDE "data/events/prizes.asm" PrintPrizePrice: - coord hl, 11, 0 + hlcoord 11, 0 ld b, 1 ld c, 7 call TextBoxBorder call UpdateSprites - coord hl, 12, 0 + hlcoord 12, 0 ld de, .CoinString call PlaceString - coord hl, 13, 1 + hlcoord 13, 1 ld de, .SixSpacesString call PlaceString - coord hl, 13, 1 + hlcoord 13, 1 ld de, wPlayerCoins ld c, %10000010 call PrintBCDNumber diff --git a/engine/events/vending_machine.asm b/engine/events/vending_machine.asm index 7bda91b0..a67f1c07 100755 --- a/engine/events/vending_machine.asm +++ b/engine/events/vending_machine.asm @@ -17,15 +17,15 @@ VendingMachineMenu:: ld [wTopMenuItemX], a ld hl, wd730 set 6, [hl] - coord hl, 0, 3 + hlcoord 0, 3 ld b, 8 ld c, 12 call TextBoxBorder call UpdateSprites - coord hl, 2, 5 + hlcoord 2, 5 ld de, DrinkText call PlaceString - coord hl, 9, 6 + hlcoord 9, 6 ld de, DrinkPriceText call PlaceString ld hl, wd730 diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index b2901615..b04f11fb 100755 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -1044,7 +1044,7 @@ ItemUseMedicine: sbc b ld [hl], a ld [wHPBarNewHP+1], a - coord hl, 4, 1 + hlcoord 4, 1 ld a, [wWhichPokemon] ld bc, 2 * SCREEN_WIDTH call AddNTimes ; calculate coordinates of HP bar of pokemon that used Softboiled @@ -2221,7 +2221,7 @@ ItemUseTMHM: call PrintText ld hl, TeachMachineMoveText call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -2607,7 +2607,7 @@ TossItem_:: call CopyStringToCF4B ; copy name to wcf4b ld hl, IsItOKToTossItemText call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm index 3cff630b..db066268 100755 --- a/engine/items/town_map.asm +++ b/engine/items/town_map.asm @@ -11,7 +11,7 @@ DisplayTownMap: push af ld b, $0 call DrawPlayerOrBirdSprite ; player sprite - coord hl, 1, 0 + hlcoord 1, 0 ld de, wcd6d call PlaceString ld hl, wOAMBuffer @@ -28,7 +28,7 @@ DisplayTownMap: jr .enterLoop .townMapLoop - coord hl, 0, 0 + hlcoord 0, 0 lb bc, 1, 20 call ClearScreenArea ld hl, TownMapOrder @@ -55,7 +55,7 @@ DisplayTownMap: inc de cp $50 jr nz, .copyMapName - coord hl, 1, 0 + hlcoord 1, 0 ld de, wcd6d call PlaceString ld hl, wOAMBuffer + $10 @@ -118,7 +118,7 @@ LoadTownMap_Nest: push hl call DisplayWildLocations call GetMonName - coord hl, 1, 0 + hlcoord 1, 0 call PlaceString ld h, b ld l, c @@ -153,34 +153,34 @@ LoadTownMap_Fly:: push af ld [hl], $ff push hl - coord hl, 0, 0 + hlcoord 0, 0 ld de, ToText call PlaceString ld a, [wCurMap] ld b, $0 call DrawPlayerOrBirdSprite ld hl, wFlyLocationsList - coord de, 18, 0 + decoord 18, 0 .townMapFlyLoop ld a, " " ld [de], a push hl push hl - coord hl, 3, 0 + hlcoord 3, 0 lb bc, 1, 15 call ClearScreenArea pop hl ld a, [hl] ld b, $4 call DrawPlayerOrBirdSprite ; draw bird sprite - coord hl, 3, 0 + hlcoord 3, 0 ld de, wcd6d call PlaceString ld c, 15 call DelayFrames - coord hl, 18, 0 + hlcoord 18, 0 ld [hl], "▲" - coord hl, 19, 0 + hlcoord 19, 0 ld [hl], "▼" pop hl .inputLoop @@ -219,7 +219,7 @@ LoadTownMap_Fly:: ld [hl], a ret .pressedUp - coord de, 18, 0 + decoord 18, 0 inc hl ld a, [hl] cp $ff @@ -231,7 +231,7 @@ LoadTownMap_Fly:: ld hl, wFlyLocationsList jp .townMapFlyLoop .pressedDown - coord de, 19, 0 + decoord 19, 0 dec hl ld a, [hl] cp $ff @@ -278,7 +278,7 @@ LoadTownMap: call GBPalWhiteOutWithDelay3 call ClearScreen call UpdateSprites - coord hl, 0, 0 + hlcoord 0, 0 ld b, $12 ld c, $12 call TextBoxBorder @@ -293,7 +293,7 @@ LoadTownMap: ld bc, MonNestIconEnd - MonNestIcon ld a, BANK(MonNestIcon) call FarCopyDataDouble - coord hl, 0, 0 + hlcoord 0, 0 ld de, CompressedMap .nextTile ld a, [de] @@ -395,11 +395,11 @@ DisplayWildLocations: and a ; were any OAM entries written? jr nz, .drawPlayerSprite ; if no OAM entries were written, print area unknown text - coord hl, 1, 7 + hlcoord 1, 7 ld b, 2 ld c, 15 call TextBoxBorder - coord hl, 2, 9 + hlcoord 2, 9 ld de, AreaUnknownText call PlaceString jr .done diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm index dd93ebba..42d06846 100755 --- a/engine/link/cable_club.asm +++ b/engine/link/cable_club.asm @@ -9,11 +9,11 @@ CableClub_DoBattleOrTrade: call LoadFontTilePatterns call LoadHpBarAndStatusTilePatterns call LoadTrainerInfoTextBoxTiles - coord hl, 3, 8 + hlcoord 3, 8 ld b, 2 ld c, 12 call CableClub_TextBoxBorder - coord hl, 4, 10 + hlcoord 4, 10 ld de, PleaseWaitString call PlaceString ld hl, wPlayerNumHits @@ -399,7 +399,7 @@ TradeCenter_SelectMon: ld [wTopMenuItemY], a ld a, 1 ld [wTopMenuItemX], a - coord hl, 1, 1 + hlcoord 1, 1 lb bc, 6, 1 call ClearScreenArea .playerMonMenu_HandleInput @@ -464,11 +464,11 @@ TradeCenter_SelectMon: dec a .displayStatsTradeMenu push af - coord hl, 0, 14 + hlcoord 0, 14 ld b, 2 ld c, 18 call CableClub_TextBoxBorder - coord hl, 2, 16 + hlcoord 2, 16 ld de, .statsTrade call PlaceString xor a @@ -480,7 +480,7 @@ TradeCenter_SelectMon: ld [wTopMenuItemY], a .selectStatsMenuItem ld a, " " - Coorda 11, 16 + ldcoord_a 11, 16 ld a, D_RIGHT | B_BUTTON | A_BUTTON ld [wMenuWatchedKeys], a ld a, 1 @@ -497,7 +497,7 @@ TradeCenter_SelectMon: jp .playerMonMenu .selectTradeMenuItem ld a, " " - Coorda 1, 16 + ldcoord_a 1, 16 ld a, D_LEFT | B_BUTTON | A_BUTTON ld [wMenuWatchedKeys], a ld a, 11 @@ -548,7 +548,7 @@ TradeCenter_SelectMon: ld [hl], a .cancelMenuItem_Loop ld a, "▶" ; filled arrow cursor - Coorda 1, 16 + ldcoord_a 1, 16 .cancelMenuItem_JoypadLoop call JoypadLowSensitivity ldh a, [hJoy5] @@ -560,14 +560,14 @@ TradeCenter_SelectMon: jr z, .cancelMenuItem_JoypadLoop ; if Up pressed ld a, " " - Coorda 1, 16 + ldcoord_a 1, 16 ld a, [wPartyCount] dec a ld [wCurrentMenuItem], a jp .playerMonMenu .cancelMenuItem_APressed ld a, "▷" ; unfilled arrow cursor - Coorda 1, 16 + ldcoord_a 1, 16 ld a, $f ld [wSerialExchangeNybbleSendData], a call Serial_PrintWaitingTextAndSyncAndExchangeNybble @@ -596,15 +596,15 @@ ReturnToCableClubRoom: ret TradeCenter_DrawCancelBox: - coord hl, 11, 15 + hlcoord 11, 15 ld a, $7e ld bc, 2 * SCREEN_WIDTH + 9 call FillMemory - coord hl, 0, 15 + hlcoord 0, 15 ld b, 1 ld c, 9 call CableClub_TextBoxBorder - coord hl, 2, 16 + hlcoord 2, 16 ld de, CancelTextString jp PlaceString @@ -613,7 +613,7 @@ CancelTextString: TradeCenter_PlaceSelectedEnemyMonMenuCursor: ld a, [wSerialSyncAndExchangeNybbleReceiveData] - coord hl, 1, 9 + hlcoord 1, 9 ld bc, SCREEN_WIDTH call AddNTimes ld [hl], "▷" ; cursor @@ -630,24 +630,24 @@ TradeCenter_DisplayStats: jp TradeCenter_DrawCancelBox TradeCenter_DrawPartyLists: - coord hl, 0, 0 + hlcoord 0, 0 ld b, 6 ld c, 18 call CableClub_TextBoxBorder - coord hl, 0, 8 + hlcoord 0, 8 ld b, 6 ld c, 18 call CableClub_TextBoxBorder - coord hl, 5, 0 + hlcoord 5, 0 ld de, wPlayerName call PlaceString - coord hl, 5, 8 + hlcoord 5, 8 ld de, wLinkEnemyTrainerName call PlaceString - coord hl, 2, 1 + hlcoord 2, 1 ld de, wPartySpecies call TradeCenter_PrintPartyListNames - coord hl, 2, 9 + hlcoord 2, 9 ld de, wEnemyPartyMons ; fall through @@ -684,7 +684,7 @@ TradeCenter_Trade: ld [wSerialExchangeNybbleReceiveData], a ld [wMenuWatchMovingOutOfBounds], a ld [wMenuJoypadPollCount], a - coord hl, 0, 12 + hlcoord 0, 12 ld b, 4 ld c, 18 call CableClub_TextBoxBorder @@ -709,10 +709,10 @@ TradeCenter_Trade: ld [wd11e], a call GetMonName ld hl, WillBeTradedText - coord bc, 1, 14 + bccoord 1, 14 call TextCommandProcessor call SaveScreenTilesToBuffer1 - coord hl, 10, 7 + hlcoord 10, 7 lb bc, 8, 11 ld a, TRADE_CANCEL_MENU ld [wTwoOptionMenuID], a @@ -726,11 +726,11 @@ TradeCenter_Trade: ; if trade cancelled ld a, $1 ld [wSerialExchangeNybbleSendData], a - coord hl, 0, 12 + hlcoord 0, 12 ld b, 4 ld c, 18 call CableClub_TextBoxBorder - coord hl, 1, 14 + hlcoord 1, 14 ld de, TradeCanceled call PlaceString call Serial_PrintWaitingTextAndSyncAndExchangeNybble @@ -743,11 +743,11 @@ TradeCenter_Trade: dec a ; did the other person cancel? jr nz, .doTrade ; if the other person cancelled - coord hl, 0, 12 + hlcoord 0, 12 ld b, 4 ld c, 18 call CableClub_TextBoxBorder - coord hl, 1, 14 + hlcoord 1, 14 ld de, TradeCanceled call PlaceString jp .tradeCancelled @@ -851,11 +851,11 @@ TradeCenter_Trade: call Serial_PrintWaitingTextAndSyncAndExchangeNybble ld c, 40 call DelayFrames - coord hl, 0, 12 + hlcoord 0, 12 ld b, 4 ld c, 18 call CableClub_TextBoxBorder - coord hl, 1, 14 + hlcoord 1, 14 ld de, TradeCompleted call PlaceString predef SaveSAVtoSRAM2 diff --git a/engine/link/print_waiting_text.asm b/engine/link/print_waiting_text.asm index c48459d3..d74d635f 100644 --- a/engine/link/print_waiting_text.asm +++ b/engine/link/print_waiting_text.asm @@ -1,5 +1,5 @@ PrintWaitingText:: - coord hl, 3, 10 + hlcoord 3, 10 ld b, $1 ld c, $b ld a, [wIsInBattle] @@ -10,7 +10,7 @@ PrintWaitingText:: .asm_4c17 call CableClub_TextBoxBorder .asm_4c1a - coord hl, 4, 11 + hlcoord 4, 11 ld de, WaitingText call PlaceString ld c, 50 diff --git a/engine/menus/display_text_id_init.asm b/engine/menus/display_text_id_init.asm index fd1d3960..c030e7c9 100644 --- a/engine/menus/display_text_id_init.asm +++ b/engine/menus/display_text_id_init.asm @@ -13,18 +13,18 @@ DisplayTextIDInit:: ; below this, so this seems unnecessary. CheckEvent EVENT_GOT_POKEDEX ; start menu with pokedex - coord hl, 10, 0 + hlcoord 10, 0 ld b, $0e ld c, $08 jr nz, .drawTextBoxBorder ; start menu without pokedex - coord hl, 10, 0 + hlcoord 10, 0 ld b, $0c ld c, $08 jr .drawTextBoxBorder ; if text ID is not 0 (i.e. not the start menu) then do a standard dialogue text box .notStartMenu - coord hl, 0, 12 + hlcoord 0, 12 ld b, $04 ld c, $12 .drawTextBoxBorder diff --git a/engine/menus/draw_badges.asm b/engine/menus/draw_badges.asm index 1888e32f..a74497c1 100644 --- a/engine/menus/draw_badges.asm +++ b/engine/menus/draw_badges.asm @@ -43,11 +43,11 @@ DrawBadges: ld [hli], a ld [hl], $60 ; First name - coord hl, 2, 11 + hlcoord 2, 11 ld de, wTempObtainedBadgesBooleans call .DrawBadgeRow - coord hl, 2, 14 + hlcoord 2, 14 ld de, wTempObtainedBadgesBooleans + 4 ; call .DrawBadgeRow ; ret diff --git a/engine/menus/draw_start_menu.asm b/engine/menus/draw_start_menu.asm index 21e444e9..00d385bc 100644 --- a/engine/menus/draw_start_menu.asm +++ b/engine/menus/draw_start_menu.asm @@ -2,12 +2,12 @@ DrawStartMenu:: CheckEvent EVENT_GOT_POKEDEX ; menu with pokedex - coord hl, 10, 0 + hlcoord 10, 0 ld b, $0e ld c, $08 jr nz, .drawTextBoxBorder ; shorter menu if the player doesn't have the pokedex - coord hl, 10, 0 + hlcoord 10, 0 ld b, $0c ld c, $08 .drawTextBoxBorder @@ -25,7 +25,7 @@ DrawStartMenu:: ld [wMenuWatchMovingOutOfBounds], a ld hl, wd730 set 6, [hl] ; no pauses between printing each letter - coord hl, 12, 2 + hlcoord 12, 2 CheckEvent EVENT_GOT_POKEDEX ; case for not having pokedex ld a, $06 diff --git a/engine/menus/league_pc.asm b/engine/menus/league_pc.asm index d930e42f..f2107c49 100755 --- a/engine/menus/league_pc.asm +++ b/engine/menus/league_pc.asm @@ -95,18 +95,18 @@ LeaguePCShowMon: ld b, SET_PAL_POKEMON_WHOLE_SCREEN ld c, 0 call RunPaletteCommand - coord hl, 12, 5 + hlcoord 12, 5 call GetMonHeader call LoadFrontSpriteByMonIndex call GBPalNormal - coord hl, 0, 13 + hlcoord 0, 13 ld b, 2 ld c, $12 call TextBoxBorder - coord hl, 1, 15 + hlcoord 1, 15 ld de, HallOfFameNoText call PlaceString - coord hl, 16, 15 + hlcoord 16, 15 ld de, wHoFTeamNo lb bc, 1, 3 call PrintNumber diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm index 44aeccca..d2776240 100755 --- a/engine/menus/main_menu.asm +++ b/engine/menus/main_menu.asm @@ -33,20 +33,20 @@ MainMenu: cp 1 jr z, .noSaveFile ; there's a save file - coord hl, 0, 0 + hlcoord 0, 0 ld b, 6 ld c, 13 call TextBoxBorder - coord hl, 2, 2 + hlcoord 2, 2 ld de, ContinueText call PlaceString jr .next2 .noSaveFile - coord hl, 0, 0 + hlcoord 0, 0 ld b, 4 ld c, 13 call TextBoxBorder - coord hl, 2, 2 + hlcoord 2, 2 ld de, NewGameText call PlaceString .next2 @@ -141,12 +141,12 @@ LinkMenu: call SaveScreenTilesToBuffer1 ld hl, WhereWouldYouLikeText call PrintText - coord hl, 5, 5 + hlcoord 5, 5 ld b, $6 ld c, $d call TextBoxBorder call UpdateSprites - coord hl, 7, 7 + hlcoord 7, 7 ld de, CableClubOptionsText call PlaceString xor a @@ -240,11 +240,11 @@ LinkMenu: ld c, d .updateCursorPosition ld a, b - Coorda 6, 7 + ldcoord_a 6, 7 ld a, c - Coorda 6, 9 + ldcoord_a 6, 9 ld a, d - Coorda 6, 11 + ldcoord_a 6, 11 ld c, 40 call DelayFrames call LoadScreenTilesFromBuffer1 @@ -345,21 +345,21 @@ CableClubOptionsText: DisplayContinueGameInfo: xor a ldh [hAutoBGTransferEnabled], a - coord hl, 4, 7 + hlcoord 4, 7 ld b, 8 ld c, 14 call TextBoxBorder - coord hl, 5, 9 + hlcoord 5, 9 ld de, SaveScreenInfoText call PlaceString - coord hl, 12, 9 + hlcoord 12, 9 ld de, wPlayerName call PlaceString - coord hl, 17, 11 + hlcoord 17, 11 call PrintNumBadges - coord hl, 16, 13 + hlcoord 16, 13 call PrintNumOwnedMons - coord hl, 13, 15 + hlcoord 13, 15 call PrintPlayTime ld a, 1 ldh [hAutoBGTransferEnabled], a @@ -369,23 +369,23 @@ DisplayContinueGameInfo: PrintSaveScreenText: xor a ldh [hAutoBGTransferEnabled], a - coord hl, 4, 0 + hlcoord 4, 0 ld b, $8 ld c, $e call TextBoxBorder call LoadTextBoxTilePatterns call UpdateSprites - coord hl, 5, 2 + hlcoord 5, 2 ld de, SaveScreenInfoText call PlaceString - coord hl, 12, 2 + hlcoord 12, 2 ld de, wPlayerName call PlaceString - coord hl, 17, 4 + hlcoord 17, 4 call PrintNumBadges - coord hl, 16, 6 + hlcoord 16, 6 call PrintNumOwnedMons - coord hl, 13, 8 + hlcoord 13, 8 call PrintPlayTime ld a, $1 ldh [hAutoBGTransferEnabled], a @@ -429,28 +429,28 @@ SaveScreenInfoText: next "TIME@" DisplayOptionMenu: - coord hl, 0, 0 + hlcoord 0, 0 ld b, 3 ld c, 18 call TextBoxBorder - coord hl, 0, 5 + hlcoord 0, 5 ld b, 3 ld c, 18 call TextBoxBorder - coord hl, 0, 10 + hlcoord 0, 10 ld b, 3 ld c, 18 call TextBoxBorder - coord hl, 1, 1 + hlcoord 1, 1 ld de, TextSpeedOptionText call PlaceString - coord hl, 1, 6 + hlcoord 1, 6 ld de, BattleAnimationOptionText call PlaceString - coord hl, 1, 11 + hlcoord 1, 11 ld de, BattleStyleOptionText call PlaceString - coord hl, 2, 16 + hlcoord 2, 16 ld de, OptionMenuCancelText call PlaceString xor a @@ -644,7 +644,7 @@ SetCursorPositionsFromOptions: dec hl ld a, [hl] ld [wOptionsTextSpeedCursorX], a ; text speed cursor X coordinate - coord hl, 0, 3 + hlcoord 0, 3 call .placeUnfilledRightArrow sla c ld a, 1 ; On @@ -652,7 +652,7 @@ SetCursorPositionsFromOptions: ld a, 10 ; Off .storeBattleAnimationCursorX ld [wOptionsBattleAnimCursorX], a ; battle animation cursor X coordinate - coord hl, 0, 8 + hlcoord 0, 8 call .placeUnfilledRightArrow sla c ld a, 1 @@ -660,10 +660,10 @@ SetCursorPositionsFromOptions: ld a, 10 .storeBattleStyleCursorX ld [wOptionsBattleStyleCursorX], a ; battle style cursor X coordinate - coord hl, 0, 13 + hlcoord 0, 13 call .placeUnfilledRightArrow ; cursor in front of Cancel - coord hl, 0, 16 + hlcoord 0, 16 ld a, 1 .placeUnfilledRightArrow ld e, a diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index e6886c98..a16c9501 100755 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -4,7 +4,7 @@ AskName: push hl ld a, [wIsInBattle] dec a - coord hl, 0, 0 + hlcoord 0, 0 ld b, 4 ld c, 11 call z, ClearScreenArea ; only if in wild battle @@ -13,7 +13,7 @@ AskName: call GetMonName ld hl, DoYouWantToNicknameText call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -93,7 +93,7 @@ DisplayNamingScreen: call LoadHpBarAndStatusTilePatterns call LoadEDTile farcall LoadMonPartySpriteGfx - coord hl, 0, 4 + hlcoord 0, 4 ld b, 9 ld c, 18 call TextBoxBorder @@ -344,7 +344,7 @@ PrintAlphabet: jr nz, .lowercase ld de, UpperCaseAlphabet .lowercase - coord hl, 2, 5 + hlcoord 2, 5 lb bc, 5, 9 ; 5 rows, 9 columns .outerLoop push bc @@ -371,13 +371,13 @@ PrintNicknameAndUnderscores: call CalcStringLength ld a, c ld [wNamingScreenNameLength], a - coord hl, 10, 2 + hlcoord 10, 2 lb bc, 1, 10 call ClearScreenArea - coord hl, 10, 2 + hlcoord 10, 2 ld de, wcf4b call PlaceString - coord hl, 10, 3 + hlcoord 10, 3 ld a, [wNamingScreenType] cp NAME_MON_SCREEN jr nc, .pokemon1 @@ -416,7 +416,7 @@ PrintNicknameAndUnderscores: .emptySpacesRemaining ld c, a ld b, $0 - coord hl, 10, 3 + hlcoord 10, 3 add hl, bc ld [hl], $77 ; raised underscore tile id ret @@ -450,7 +450,7 @@ CalcStringLength: jr .loop PrintNamingText: - coord hl, 0, 1 + hlcoord 0, 1 ld a, [wNamingScreenType] ld de, YourTextString and a @@ -465,12 +465,12 @@ PrintNamingText: pop af ld [wd11e], a call GetMonName - coord hl, 4, 1 + hlcoord 4, 1 call PlaceString ld hl, $1 add hl, bc ld [hl], $c9 - coord hl, 1, 3 + hlcoord 1, 3 ld de, NicknameTextString jr .placeString .notNickname diff --git a/engine/menus/party_menu.asm b/engine/menus/party_menu.asm index 4eeb0ed8..14216b64 100755 --- a/engine/menus/party_menu.asm +++ b/engine/menus/party_menu.asm @@ -30,7 +30,7 @@ RedrawPartyMenu_:: jp z, .printMessage call ErasePartyMenuCursors farcall InitPartyMenuBlkPacket - coord hl, 3, 0 + hlcoord 3, 0 ld de, wPartySpecies xor a ld c, a diff --git a/engine/menus/players_pc.asm b/engine/menus/players_pc.asm index ebaacd52..5461be51 100755 --- a/engine/menus/players_pc.asm +++ b/engine/menus/players_pc.asm @@ -22,12 +22,12 @@ PlayerPCMenu: ld hl, wFlags_0xcd60 set 5, [hl] call LoadScreenTilesFromBuffer2 - coord hl, 0, 0 + hlcoord 0, 0 ld b, $8 ld c, $e call TextBoxBorder call UpdateSprites - coord hl, 2, 2 + hlcoord 2, 2 ld de, PlayersPCMenuEntries call PlaceString ld hl, wTopMenuItemY diff --git a/engine/menus/pokedex.asm b/engine/menus/pokedex.asm index a2a55bfd..53719712 100755 --- a/engine/menus/pokedex.asm +++ b/engine/menus/pokedex.asm @@ -119,7 +119,7 @@ HandlePokedexSideMenu: pop af ld [wCurrentMenuItem], a push bc - coord hl, 0, 3 + hlcoord 0, 3 ld de, 20 lb bc, " ", 13 call DrawTileLine ; cover up the menu cursor in the pokemon list @@ -128,7 +128,7 @@ HandlePokedexSideMenu: .buttonBPressed push bc - coord hl, 15, 10 + hlcoord 15, 10 ld de, 20 lb bc, " ", 7 call DrawTileLine ; cover up the menu cursor in the side menu @@ -158,43 +158,43 @@ HandlePokedexListMenu: xor a ldh [hAutoBGTransferEnabled], a ; draw the horizontal line separating the seen and owned amounts from the menu - coord hl, 15, 8 + hlcoord 15, 8 ld a, "─" ld [hli], a ld [hli], a ld [hli], a ld [hli], a ld [hli], a - coord hl, 14, 0 + hlcoord 14, 0 ld [hl], $71 ; vertical line tile - coord hl, 14, 1 + hlcoord 14, 1 call DrawPokedexVerticalLine - coord hl, 14, 9 + hlcoord 14, 9 call DrawPokedexVerticalLine ld hl, wPokedexSeen ld b, wPokedexSeenEnd - wPokedexSeen call CountSetBits ld de, wNumSetBits - coord hl, 16, 3 + hlcoord 16, 3 lb bc, 1, 3 call PrintNumber ; print number of seen pokemon ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits ld de, wNumSetBits - coord hl, 16, 6 + hlcoord 16, 6 lb bc, 1, 3 call PrintNumber ; print number of owned pokemon - coord hl, 16, 2 + hlcoord 16, 2 ld de, PokedexSeenText call PlaceString - coord hl, 16, 5 + hlcoord 16, 5 ld de, PokedexOwnText call PlaceString - coord hl, 1, 1 + hlcoord 1, 1 ld de, PokedexContentsText call PlaceString - coord hl, 16, 10 + hlcoord 16, 10 ld de, PokedexMenuItemsText call PlaceString ; find the highest pokedex number among the pokemon the player has seen @@ -217,10 +217,10 @@ HandlePokedexListMenu: .loop xor a ldh [hAutoBGTransferEnabled], a - coord hl, 4, 2 + hlcoord 4, 2 lb bc, 14, 10 call ClearScreenArea - coord hl, 1, 3 + hlcoord 1, 3 ld a, [wListScrollOffset] ld [wd11e], a ld d, 7 @@ -415,43 +415,43 @@ ShowPokedexDataInternal: xor a ldh [hTilesetType], a - coord hl, 0, 0 + hlcoord 0, 0 ld de, 1 lb bc, $64, SCREEN_WIDTH call DrawTileLine ; draw top border - coord hl, 0, 17 + hlcoord 0, 17 ld b, $6f call DrawTileLine ; draw bottom border - coord hl, 0, 1 + hlcoord 0, 1 ld de, 20 lb bc, $66, $10 call DrawTileLine ; draw left border - coord hl, 19, 1 + hlcoord 19, 1 ld b, $67 call DrawTileLine ; draw right border ld a, $63 ; upper left corner tile - Coorda 0, 0 + ldcoord_a 0, 0 ld a, $65 ; upper right corner tile - Coorda 19, 0 + ldcoord_a 19, 0 ld a, $6c ; lower left corner tile - Coorda 0, 17 + ldcoord_a 0, 17 ld a, $6e ; lower right corner tile - Coorda 19, 17 + ldcoord_a 19, 17 - coord hl, 0, 9 + hlcoord 0, 9 ld de, PokedexDataDividerLine call PlaceString ; draw horizontal divider line - coord hl, 9, 6 + hlcoord 9, 6 ld de, HeightWeightText call PlaceString call GetMonName - coord hl, 9, 2 + hlcoord 9, 2 call PlaceString ld hl, PokedexEntryPointers @@ -465,7 +465,7 @@ ShowPokedexDataInternal: ld e, a ld d, [hl] ; de = address of pokedex entry - coord hl, 9, 4 + hlcoord 9, 4 call PlaceString ; print species name ld h, b @@ -475,7 +475,7 @@ ShowPokedexDataInternal: push af call IndexToPokedex - coord hl, 2, 8 + hlcoord 2, 8 ld a, "№" ld [hli], a ld a, "" @@ -500,7 +500,7 @@ ShowPokedexDataInternal: call Delay3 call GBPalNormal call GetMonHeader ; load pokemon picture location - coord hl, 1, 1 + hlcoord 1, 1 call LoadFlippedFrontSpriteByMonIndex ; draw pokemon picture ld a, [wcf91] call PlayCry ; play pokemon cry @@ -515,14 +515,14 @@ ShowPokedexDataInternal: jp z, .waitForButtonPress ; if the pokemon has not been owned, don't print the height, weight, or description inc de ; de = address of feet (height) ld a, [de] ; reads feet, but a is overwritten without being used - coord hl, 12, 6 + hlcoord 12, 6 lb bc, 1, 2 call PrintNumber ; print feet (height) ld a, "′" ld [hl], a inc de inc de ; de = address of inches (height) - coord hl, 15, 6 + hlcoord 15, 6 lb bc, LEADING_ZEROES | 1, 2 call PrintNumber ; print inches (height) ld a, "″" @@ -544,10 +544,10 @@ ShowPokedexDataInternal: ld a, [de] ; a = lower byte of weight ld [hl], a ; store lower byte of weight in [hDexWeight + 1] ld de, hDexWeight - coord hl, 11, 8 + hlcoord 11, 8 lb bc, 2, 5 ; 2 bytes, 5 digits call PrintNumber ; print weight - coord hl, 14, 8 + hlcoord 14, 8 ldh a, [hDexWeight + 1] sub 10 ldh a, [hDexWeight] @@ -565,7 +565,7 @@ ShowPokedexDataInternal: ldh [hDexWeight], a ; restore original value of [hDexWeight] pop hl inc hl ; hl = address of pokedex description text - coord bc, 1, 11 + bccoord 1, 11 ld a, %10 ldh [hClearLetterPrintingDelayFlags], a call TextCommandProcessor ; print pokedex description text diff --git a/engine/menus/save.asm b/engine/menus/save.asm index 2941a07e..45fed8a6 100755 --- a/engine/menus/save.asm +++ b/engine/menus/save.asm @@ -154,10 +154,10 @@ SaveSAV: ret nz .save call SaveSAVtoSRAM - coord hl, 1, 13 + hlcoord 1, 13 lb bc, 4, 18 call ClearScreenArea - coord hl, 1, 14 + hlcoord 1, 14 ld de, NowSavingString call PlaceString ld c, 120 @@ -175,7 +175,7 @@ NowSavingString: SaveSAVConfirm: call PrintText - coord hl, 0, 7 + hlcoord 0, 7 lb bc, 8, 1 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -435,20 +435,20 @@ DisplayChangeBoxMenu: and $7f ld [wCurrentMenuItem], a ld [wLastMenuItem], a - coord hl, 0, 0 + hlcoord 0, 0 ld b, 2 ld c, 9 call TextBoxBorder ld hl, ChooseABoxText call PrintText - coord hl, 11, 0 + hlcoord 11, 0 ld b, 12 ld c, 7 call TextBoxBorder ld hl, hFlagsFFF6 set 2, [hl] ld de, BoxNames - coord hl, 13, 1 + hlcoord 13, 1 call PlaceString ld hl, hFlagsFFF6 res 2, [hl] @@ -457,19 +457,19 @@ DisplayChangeBoxMenu: cp 9 jr c, .singleDigitBoxNum sub 9 - coord hl, 8, 2 + hlcoord 8, 2 ld [hl], "1" add "0" jr .next .singleDigitBoxNum add "1" .next - Coorda 9, 2 - coord hl, 1, 2 + ldcoord_a 9, 2 + hlcoord 1, 2 ld de, BoxNoText call PlaceString call GetMonCountsForAllBoxes - coord hl, 18, 1 + hlcoord 18, 1 ld de, wBoxMonCounts ld bc, SCREEN_WIDTH ld a, $c diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm index 33d504b8..8f1a2d61 100755 --- a/engine/menus/start_sub_menus.asm +++ b/engine/menus/start_sub_menus.asm @@ -285,7 +285,7 @@ StartMenu_Pokemon:: ; writes a blank tile to all possible menu cursor positions on the party menu ErasePartyMenuCursors:: - coord hl, 0, 1 + hlcoord 0, 1 ld bc, 2 * 20 ; menu cursor positions are 2 rows apart ld a, 6 ; 6 menu cursor positions .loop @@ -330,10 +330,10 @@ StartMenu_Item:: .choseItem ; erase menu cursor (blank each tile in front of an item name) ld a, " " - Coorda 5, 4 - Coorda 5, 6 - Coorda 5, 8 - Coorda 5, 10 + ldcoord_a 5, 4 + ldcoord_a 5, 6 + ldcoord_a 5, 8 + ldcoord_a 5, 10 call PlaceUnfilledArrowMenuCursor xor a ld [wMenuItemToSwap], a @@ -480,10 +480,10 @@ DrawTrainerInfo: lb bc, BANK(RedPicFront), $01 predef DisplayPicCenteredOrUpperRight call DisableLCD - coord hl, 0, 2 + hlcoord 0, 2 ld a, " " call TrainerInfo_DrawVerticalLine - coord hl, 1, 2 + hlcoord 1, 2 call TrainerInfo_DrawVerticalLine ld hl, vChars2 + $70 ld de, vChars2 @@ -526,7 +526,7 @@ DrawTrainerInfo: dec a ld [hli], a ld [hl], 1 - coord hl, 0, 0 + hlcoord 0, 0 call TrainerInfo_DrawTextBox ld hl, wTrainerInfoTextBoxWidthPlus1 ld a, 16 + 1 @@ -534,27 +534,27 @@ DrawTrainerInfo: dec a ld [hli], a ld [hl], 3 - coord hl, 1, 10 + hlcoord 1, 10 call TrainerInfo_DrawTextBox - coord hl, 0, 10 + hlcoord 0, 10 ld a, $d7 call TrainerInfo_DrawVerticalLine - coord hl, 19, 10 + hlcoord 19, 10 call TrainerInfo_DrawVerticalLine - coord hl, 6, 9 + hlcoord 6, 9 ld de, TrainerInfo_BadgesText call PlaceString - coord hl, 2, 2 + hlcoord 2, 2 ld de, TrainerInfo_NameMoneyTimeText call PlaceString - coord hl, 7, 2 + hlcoord 7, 2 ld de, wPlayerName call PlaceString - coord hl, 8, 4 + hlcoord 8, 4 ld de, wPlayerMoney ld c, $e3 call PrintBCDNumber - coord hl, 9, 6 + hlcoord 9, 6 ld de, wPlayTimeHours ; hours lb bc, LEFT_ALIGN | 1, 3 call PrintNumber @@ -667,7 +667,7 @@ SwitchPartyMon:: SwitchPartyMon_ClearGfx: push af - coord hl, 0, 0 + hlcoord 0, 0 ld bc, SCREEN_WIDTH * 2 call AddNTimes ld c, SCREEN_WIDTH * 2 diff --git a/engine/menus/text_box.asm b/engine/menus/text_box.asm index 51339ec2..2e69c5a4 100644 --- a/engine/menus/text_box.asm +++ b/engine/menus/text_box.asm @@ -111,7 +111,7 @@ GetTextBoxIDText: ; hl = address of upper left corner of text box GetAddressOfScreenCoords: push bc - coord hl, 0, 0 + hlcoord 0, 0 ld bc, 20 .loop ; loop to add d rows to the base address ld a, d @@ -274,11 +274,11 @@ DisplayMoneyBox: ld a, MONEY_BOX_TEMPLATE ld [wTextBoxID], a call DisplayTextBoxID - coord hl, 13, 1 + hlcoord 13, 1 ld b, 1 ld c, 6 call ClearScreenArea - coord hl, 12, 1 + hlcoord 12, 1 ld de, wPlayerMoney ld c, $a3 call PrintBCDNumber @@ -578,14 +578,14 @@ DisplayFieldMoveMonMenu: jr nz, .fieldMovesExist ; no field moves - coord hl, 11, 11 + hlcoord 11, 11 ld b, 5 ld c, 7 call TextBoxBorder call UpdateSprites ld a, 12 ldh [hFieldMoveMonMenuTopMenuItemX], a - coord hl, 13, 12 + hlcoord 13, 12 ld de, PokemonMenuEntries jp PlaceString @@ -594,7 +594,7 @@ DisplayFieldMoveMonMenu: ; Calculate the text box position and dimensions based on the leftmost X coord ; of the field move names before adjusting for the number of field moves. - coord hl, 0, 11 + hlcoord 0, 11 ld a, [wFieldMovesLeftmostXCoord] dec a ld e, a @@ -625,7 +625,7 @@ DisplayFieldMoveMonMenu: call UpdateSprites ; Calculate the position of the first field move name to print. - coord hl, 0, 12 + hlcoord 0, 12 ld a, [wFieldMovesLeftmostXCoord] inc a ld e, a @@ -674,7 +674,7 @@ DisplayFieldMoveMonMenu: pop hl ld a, [wFieldMovesLeftmostXCoord] ldh [hFieldMoveMonMenuTopMenuItemX], a - coord hl, 0, 12 + hlcoord 0, 12 ld a, [wFieldMovesLeftmostXCoord] inc a ld e, a diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm index 42b8e0cc..ae35a2b7 100755 --- a/engine/movie/credits.asm +++ b/engine/movie/credits.asm @@ -14,9 +14,9 @@ HallOfFamePC: ld bc, $10 ld a, $ff call FillMemory - coord hl, 0, 0 + hlcoord 0, 0 call FillFourRowsWithBlack - coord hl, 0, 14 + hlcoord 0, 14 call FillFourRowsWithBlack ld a, %11000000 ldh [rBGP], a @@ -61,7 +61,7 @@ DisplayCreditsMon: ld a, [hl] ld [wcf91], a ld [wd0b5], a - coord hl, 8, 6 + hlcoord 8, 6 call GetMonHeader call LoadFrontSpriteByMonIndex ld hl, vBGMap0 + $c @@ -162,7 +162,7 @@ FillFourRowsWithBlack: jp FillMemory FillMiddleOfScreenWithWhite: - coord hl, 0, 4 + hlcoord 0, 4 ld bc, SCREEN_WIDTH * 10 ld a, " " jp FillMemory @@ -172,7 +172,7 @@ Credits: push de .nextCreditsScreen pop de - coord hl, 9, 6 + hlcoord 9, 6 push hl call FillMiddleOfScreenWithWhite pop hl @@ -248,10 +248,10 @@ Credits: ld hl, vChars2 + $600 lb bc, BANK(TheEndGfx), (TheEndGfxEnd - TheEndGfx) / $10 call CopyVideoData - coord hl, 4, 8 + hlcoord 4, 8 ld de, TheEndTextString call PlaceString - coord hl, 4, 9 + hlcoord 4, 9 inc de call PlaceString jp FadeInCreditsText diff --git a/engine/movie/evolution.asm b/engine/movie/evolution.asm index b006dea6..cabe7254 100755 --- a/engine/movie/evolution.asm +++ b/engine/movie/evolution.asm @@ -99,7 +99,7 @@ EvolutionSetWholeScreenPalette: Evolution_LoadPic: call GetMonHeader - coord hl, 7, 2 + hlcoord 7, 2 jp LoadFlippedFrontSpriteByMonIndex Evolution_BackAndForthAnim: @@ -118,7 +118,7 @@ Evolution_ChangeMonPic: push bc xor a ldh [hAutoBGTransferEnabled], a - coord hl, 7, 2 + hlcoord 7, 2 lb bc, 7, 7 ld de, SCREEN_WIDTH - 7 .loop diff --git a/engine/movie/hall_of_fame.asm b/engine/movie/hall_of_fame.asm index 355a3f4f..071e7ca1 100755 --- a/engine/movie/hall_of_fame.asm +++ b/engine/movie/hall_of_fame.asm @@ -57,11 +57,11 @@ AnimateHallOfFame: call HoFDisplayAndRecordMonInfo ld c, 80 call DelayFrames - coord hl, 2, 13 + hlcoord 2, 13 ld b, 3 ld c, 14 call TextBoxBorder - coord hl, 4, 15 + hlcoord 4, 15 ld de, HallOfFameText call PlaceString ld c, 180 @@ -112,7 +112,7 @@ HoFShowMonOrPlayer: call HoFLoadPlayerPics jr .next1 .showMon - coord hl, 12, 5 + hlcoord 12, 5 call GetMonHeader call LoadFrontSpriteByMonIndex predef LoadMonBackPic @@ -157,22 +157,22 @@ HoFDisplayAndRecordMonInfo: jp HoFRecordMonInfo HoFDisplayMonInfo: - coord hl, 0, 2 + hlcoord 0, 2 ld b, 9 ld c, 10 call TextBoxBorder - coord hl, 2, 6 + hlcoord 2, 6 ld de, HoFMonInfoText call PlaceString - coord hl, 1, 4 + hlcoord 1, 4 ld de, wcd6d call PlaceString ld a, [wHoFMonLevel] - coord hl, 8, 7 + hlcoord 8, 7 call PrintLevelCommon ld a, [wHoFMonSpecies] ld [wd0b5], a - coord hl, 3, 9 + hlcoord 3, 9 predef PrintMonType ld a, [wHoFMonSpecies] jp PlayCry @@ -203,27 +203,27 @@ HoFLoadPlayerPics: HoFLoadMonPlayerPicTileIDs: ; c = base tile ID ld b, 0 - coord hl, 12, 5 + hlcoord 12, 5 predef_jump CopyTileIDsFromList HoFDisplayPlayerStats: SetEvent EVENT_HALL_OF_FAME_DEX_RATING predef DisplayDexRating - coord hl, 0, 4 + hlcoord 0, 4 ld b, 6 ld c, 10 call TextBoxBorder - coord hl, 5, 0 + hlcoord 5, 0 ld b, 2 ld c, 9 call TextBoxBorder - coord hl, 7, 2 + hlcoord 7, 2 ld de, wPlayerName call PlaceString - coord hl, 1, 6 + hlcoord 1, 6 ld de, HoFPlayTimeText call PlaceString - coord hl, 5, 7 + hlcoord 5, 7 ld de, wPlayTimeHours lb bc, 1, 3 call PrintNumber @@ -232,10 +232,10 @@ HoFDisplayPlayerStats: ld de, wPlayTimeMinutes lb bc, LEADING_ZEROES | 1, 2 call PrintNumber - coord hl, 1, 9 + hlcoord 1, 9 ld de, HoFMoneyText call PlaceString - coord hl, 4, 10 + hlcoord 4, 10 ld de, wPlayerMoney ld c, $a3 call PrintBCDNumber diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm index 08b6ed8b..fc404b82 100755 --- a/engine/movie/intro.asm +++ b/engine/movie/intro.asm @@ -217,7 +217,7 @@ IntroClearScreen: IntroClearMiddleOfScreen: ; clear the area of the tile map between the black bars on the top and bottom - coord hl, 0, 4 + hlcoord 0, 4 ld bc, SCREEN_WIDTH * 10 IntroClearCommon: @@ -274,7 +274,7 @@ IntroMoveMon: ret IntroCopyTiles: - coord hl, 13, 7 + hlcoord 13, 7 CopyTileIDsFromList_ZeroBaseTileID: ld c, 0 @@ -348,16 +348,16 @@ PlayShootingStar: IntroDrawBlackBars: ; clear the screen and draw black bars on the top and bottom call IntroClearScreen - coord hl, 0, 0 + hlcoord 0, 0 ld c, SCREEN_WIDTH * 4 call IntroPlaceBlackTiles - coord hl, 0, 14 + hlcoord 0, 14 ld c, SCREEN_WIDTH * 4 call IntroPlaceBlackTiles ld hl, vBGMap1 ld c, BG_MAP_WIDTH * 4 call IntroPlaceBlackTiles - ld hl, vBGMap1 + BG_MAP_WIDTH * 14 + hlbgcoord 0, 14, vBGMap1 ld c, BG_MAP_WIDTH * 4 jp IntroPlaceBlackTiles diff --git a/engine/movie/oak_speech/clear_save.asm b/engine/movie/oak_speech/clear_save.asm index c423fb0b..d5c04e6e 100755 --- a/engine/movie/oak_speech/clear_save.asm +++ b/engine/movie/oak_speech/clear_save.asm @@ -5,7 +5,7 @@ DoClearSaveDialogue: call LoadTextBoxTilePatterns ld hl, ClearSaveDataText call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, NO_YES_MENU ld [wTwoOptionMenuID], a diff --git a/engine/movie/oak_speech/oak_speech.asm b/engine/movie/oak_speech/oak_speech.asm index 2328e3ab..4b64f20d 100755 --- a/engine/movie/oak_speech/oak_speech.asm +++ b/engine/movie/oak_speech/oak_speech.asm @@ -68,7 +68,7 @@ OakSpeech: ld [wd0b5], a ld [wcf91], a call GetMonHeader - coord hl, 6, 4 + hlcoord 6, 4 call LoadFlippedFrontSpriteByMonIndex call MovePicLeft ld hl, OakSpeechText2 @@ -141,7 +141,7 @@ OakSpeech: ld [MBC1RomBank], a ld c, 20 call DelayFrames - coord hl, 6, 5 + hlcoord 6, 5 ld b, 7 ld c, 7 call ClearScreenArea @@ -224,9 +224,9 @@ IntroDisplayPicCenteredOrUpperRight: pop bc ld a, c and a - coord hl, 15, 1 + hlcoord 15, 1 jr nz, .next - coord hl, 6, 4 + hlcoord 6, 4 .next xor a ldh [hStartTileID], a diff --git a/engine/movie/oak_speech/oak_speech2.asm b/engine/movie/oak_speech/oak_speech2.asm index 5ee0a871..28208ddc 100755 --- a/engine/movie/oak_speech/oak_speech2.asm +++ b/engine/movie/oak_speech/oak_speech2.asm @@ -66,7 +66,7 @@ HisNameIsText: OakSpeechSlidePicLeft: push de - coord hl, 0, 0 + hlcoord 0, 0 lb bc, 12, 11 call ClearScreenArea ; clear the name list text box ld c, 10 @@ -76,13 +76,13 @@ OakSpeechSlidePicLeft: ld bc, NAME_LENGTH call CopyData call Delay3 - coord hl, 12, 4 + hlcoord 12, 4 lb de, 6, 6 * SCREEN_WIDTH + 5 ld a, $ff jr OakSpeechSlidePicCommon OakSpeechSlidePicRight: - coord hl, 5, 4 + hlcoord 5, 4 lb de, 6, 6 * SCREEN_WIDTH + 5 xor a @@ -161,15 +161,15 @@ OakSpeechSlidePicCommon: DisplayIntroNameTextBox: push de - coord hl, 0, 0 + hlcoord 0, 0 ld b, $a ld c, $9 call TextBoxBorder - coord hl, 3, 0 + hlcoord 3, 0 ld de, .namestring call PlaceString pop de - coord hl, 2, 2 + hlcoord 2, 2 call PlaceString call UpdateSprites xor a diff --git a/engine/movie/title.asm b/engine/movie/title.asm index 00e639ae..69838afb 100755 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -63,7 +63,7 @@ DisplayTitleScreen: call ClearBothBGMaps ; place tiles for pokemon logo (except for the last row) - coord hl, 2, 1 + hlcoord 2, 1 ld a, $80 ld de, SCREEN_WIDTH ld c, 6 @@ -81,7 +81,7 @@ DisplayTitleScreen: jr nz, .pokemonLogoTileLoop ; place tiles for the last row of the pokemon logo - coord hl, 2, 7 + hlcoord 2, 7 ld a, $31 ld b, $10 .pokemonLogoLastTileRowLoop @@ -98,7 +98,7 @@ DisplayTitleScreen: ld [hl], a ; place tiles for title screen copyright - coord hl, 2, 17 + hlcoord 2, 17 ld de, .tileScreenCopyrightTiles ld b, $10 .tileScreenCopyrightTilesLoop @@ -353,7 +353,7 @@ ClearBothBGMaps: LoadTitleMonSprite: ld [wcf91], a ld [wd0b5], a - coord hl, 5, 10 + hlcoord 5, 10 call GetMonHeader jp LoadFrontSpriteByMonIndex @@ -372,7 +372,7 @@ LoadCopyrightTiles: ld hl, vChars2 + $600 lb bc, BANK(NintendoCopyrightLogoGraphics), (GamefreakLogoGraphicsEnd - NintendoCopyrightLogoGraphics) / $10 call CopyVideoData - coord hl, 2, 7 + hlcoord 2, 7 ld de, CopyrightTextString jp PlaceString @@ -386,7 +386,7 @@ INCLUDE "data/pokemon/title_mons.asm" ; prints version text (red, blue) PrintGameVersionOnTitleScreen: - coord hl, 7, 8 + hlcoord 7, 8 ld de, VersionOnTitleScreenText jp PlaceString diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm index 6aac7e23..3883c362 100755 --- a/engine/movie/trade.asm +++ b/engine/movie/trade.asm @@ -148,7 +148,7 @@ Trade_Delay80: jp DelayFrames Trade_ClearTileMap: - coord hl, 0, 0 + hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld a, " " jp FillMemory @@ -232,7 +232,7 @@ Trade_ShowPlayerMon: ldh [hSCX], a xor a ldh [hAutoBGTransferEnabled], a - coord hl, 4, 0 + hlcoord 4, 0 ld b, 6 ld c, 10 call TextBoxBorder @@ -281,7 +281,7 @@ Trade_DrawOpenEndOfLinkCable: call DelayFrame ld a, %10001011 ldh [rLCDC], a - coord hl, 6, 2 + hlcoord 6, 2 ld b, $7 ; open end of link cable tile ID list index call CopyTileIDsFromList_ZeroBaseTileID call Trade_CopyTileMapToVRAM @@ -353,7 +353,7 @@ Trade_ShowEnemyMon: ld a, TRADE_BALL_TILT_ANIM call Trade_ShowAnimation call Trade_ShowClearedWindow - coord hl, 4, 10 + hlcoord 4, 10 ld b, 6 ld c, 10 call TextBoxBorder @@ -370,7 +370,7 @@ Trade_ShowEnemyMon: ld a, [wTradedEnemyMonSpecies] call PlayCry call Trade_Delay100 - coord hl, 4, 10 + hlcoord 4, 10 lb bc, 8, 12 call ClearScreenArea jp PrintTradeTakeCareText @@ -462,7 +462,7 @@ Trade_DrawLeftGameboy: call Trade_ClearTileMap ; draw link cable - coord hl, 11, 4 + hlcoord 11, 4 ld a, $5d ld [hli], a ld a, $5e @@ -473,16 +473,16 @@ Trade_DrawLeftGameboy: jr nz, .loop ; draw gameboy pic - coord hl, 5, 3 + hlcoord 5, 3 ld b, $6 call CopyTileIDsFromList_ZeroBaseTileID ; draw text box with player name below gameboy pic - coord hl, 4, 12 + hlcoord 4, 12 ld b, 2 ld c, 7 call TextBoxBorder - coord hl, 5, 14 + hlcoord 5, 14 ld de, wPlayerName call PlaceString @@ -492,7 +492,7 @@ Trade_DrawRightGameboy: call Trade_ClearTileMap ; draw horizontal segment of link cable - coord hl, 0, 4 + hlcoord 0, 4 ld a, $5e ld c, $e .loop @@ -520,16 +520,16 @@ Trade_DrawRightGameboy: ld [hl], a ; draw gameboy pic - coord hl, 7, 8 + hlcoord 7, 8 ld b, $6 call CopyTileIDsFromList_ZeroBaseTileID ; draw text box with enemy name above link cable - coord hl, 6, 0 + hlcoord 6, 0 ld b, 2 ld c, 7 call TextBoxBorder - coord hl, 7, 2 + hlcoord 7, 2 ld de, wLinkEnemyTrainerName call PlaceString @@ -538,7 +538,7 @@ Trade_DrawRightGameboy: Trade_DrawCableAcrossScreen: ; Draws the link cable across the screen. call Trade_ClearTileMap - coord hl, 0, 4 + hlcoord 0, 4 ld a, $5e ld c, SCREEN_WIDTH .loop @@ -551,7 +551,7 @@ Trade_CopyCableTilesOffScreen: ; This is used to copy the link cable tiles off screen so that the cable ; continues when the screen is scrolled. push hl - coord hl, 0, 4 + hlcoord 0, 4 call CopyToRedrawRowOrColumnSrcTiles pop hl ld a, h @@ -735,7 +735,7 @@ Trade_LoadMonSprite: xor $1 ldh [hAutoBGTransferEnabled], a call GetMonHeader - coord hl, 7, 2 + hlcoord 7, 2 call LoadFlippedFrontSpriteByMonIndex ld c, 10 jp DelayFrames diff --git a/engine/movie/trade2.asm b/engine/movie/trade2.asm index 6b744fd8..f0d91846 100755 --- a/engine/movie/trade2.asm +++ b/engine/movie/trade2.asm @@ -1,43 +1,43 @@ Trade_PrintPlayerMonInfoText: - coord hl, 5, 0 + hlcoord 5, 0 ld de, Trade_MonInfoText call PlaceString ld a, [wTradedPlayerMonSpecies] ld [wd11e], a predef IndexToPokedex - coord hl, 9, 0 + hlcoord 9, 0 ld de, wd11e lb bc, LEADING_ZEROES | 1, 3 call PrintNumber - coord hl, 5, 2 + hlcoord 5, 2 ld de, wcf4b call PlaceString - coord hl, 8, 4 + hlcoord 8, 4 ld de, wTradedPlayerMonOT call PlaceString - coord hl, 8, 6 + hlcoord 8, 6 ld de, wTradedPlayerMonOTID lb bc, LEADING_ZEROES | 2, 5 jp PrintNumber Trade_PrintEnemyMonInfoText: - coord hl, 5, 10 + hlcoord 5, 10 ld de, Trade_MonInfoText call PlaceString ld a, [wTradedEnemyMonSpecies] ld [wd11e], a predef IndexToPokedex - coord hl, 9, 10 + hlcoord 9, 10 ld de, wd11e lb bc, LEADING_ZEROES | 1, 3 call PrintNumber - coord hl, 5, 12 + hlcoord 5, 12 ld de, wcd6d call PlaceString - coord hl, 8, 14 + hlcoord 8, 14 ld de, wTradedEnemyMonOT call PlaceString - coord hl, 8, 16 + hlcoord 8, 16 ld de, wTradedEnemyMonOTID lb bc, LEADING_ZEROES | 2, 5 jp PrintNumber diff --git a/engine/overworld/doors.asm b/engine/overworld/doors.asm index ed893773..d38818fa 100755 --- a/engine/overworld/doors.asm +++ b/engine/overworld/doors.asm @@ -11,7 +11,7 @@ IsPlayerStandingOnDoorTile: ld a, [hli] ld h, [hl] ld l, a - aCoord 8, 9 ; a = lower left background tile under player's sprite + lda_coord 8, 9 ; a = lower left background tile under player's sprite ld b, a .loop ld a, [hli] diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm index cba544f6..254680a5 100755 --- a/engine/overworld/ledges.asm +++ b/engine/overworld/ledges.asm @@ -8,7 +8,7 @@ HandleLedges:: predef GetTileAndCoordsInFrontOfPlayer ld a, [wSpritePlayerStateData1FacingDirection] ld b, a - aCoord 8, 9 + lda_coord 8, 9 ld c, a ld a, [wTileInFrontOfPlayer] ld d, a diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index a20b3174..a2930993 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -13,7 +13,7 @@ UpdatePlayerSprite: ; background tile the sprite is standing on is greater than $5F, which is ; the maximum number for map tiles .checkIfTextBoxInFrontOfSprite - aCoord 8, 9 + lda_coord 8, 9 ldh [hTilePlayerStandingOn], a cp MAP_TILESET_SIZE jr c, .lowerLeftTileIsMapTile @@ -709,7 +709,7 @@ GetTileSpriteStandsOn: add SCREEN_WIDTH ; screen X tile + 20 ld d, $0 ld e, a - coord hl, 0, 0 + hlcoord 0, 0 add hl, bc add hl, bc add hl, bc diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index fec10daf..69c1eefc 100755 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -358,7 +358,7 @@ IsPlayerStandingOnWarpPadOrHole:: jr z, .done cp c jr nz, .nextEntry - aCoord 8, 9 + lda_coord 8, 9 cp [hl] jr z, .foundMatch .nextEntry diff --git a/engine/overworld/player_state.asm b/engine/overworld/player_state.asm index 39c8f756..70326754 100644 --- a/engine/overworld/player_state.asm +++ b/engine/overworld/player_state.asm @@ -204,7 +204,7 @@ IsPlayerStandingOnDoorTileOrWarpTile:: ld h, [hl] ld l, a ld de, $1 - aCoord 8, 9 + lda_coord 8, 9 call IsInArray jr nc, .done ld hl, wd736 @@ -223,28 +223,28 @@ PrintSafariZoneSteps:: ret c cp CERULEAN_CAVE_2F ret nc - coord hl, 0, 0 + hlcoord 0, 0 ld b, 3 ld c, 7 call TextBoxBorder - coord hl, 1, 1 + hlcoord 1, 1 ld de, wSafariSteps lb bc, 2, 3 call PrintNumber - coord hl, 4, 1 + hlcoord 4, 1 ld de, SafariSteps call PlaceString - coord hl, 1, 3 + hlcoord 1, 3 ld de, SafariBallText call PlaceString ld a, [wNumSafariBalls] cp 10 jr nc, .asm_c56d - coord hl, 5, 3 + hlcoord 5, 3 ld a, " " ld [hl], a .asm_c56d - coord hl, 6, 3 + hlcoord 6, 3 ld de, wNumSafariBalls lb bc, 1, 2 jp PrintNumber @@ -267,28 +267,28 @@ _GetTileAndCoordsInFrontOfPlayer: and a ; cp SPRITE_FACING_DOWN jr nz, .notFacingDown ; facing down - aCoord 8, 11 + lda_coord 8, 11 inc d jr .storeTile .notFacingDown cp SPRITE_FACING_UP jr nz, .notFacingUp ; facing up - aCoord 8, 7 + lda_coord 8, 7 dec d jr .storeTile .notFacingUp cp SPRITE_FACING_LEFT jr nz, .notFacingLeft ; facing left - aCoord 6, 9 + lda_coord 6, 9 dec e jr .storeTile .notFacingLeft cp SPRITE_FACING_RIGHT jr nz, .storeTile ; facing right - aCoord 10, 9 + lda_coord 10, 9 inc e .storeTile ld c, a @@ -308,7 +308,7 @@ GetTileTwoStepsInFrontOfPlayer: ; facing down ld hl, hPlayerFacing set 0, [hl] - aCoord 8, 13 + lda_coord 8, 13 inc d jr .storeTile .notFacingDown @@ -317,7 +317,7 @@ GetTileTwoStepsInFrontOfPlayer: ; facing up ld hl, hPlayerFacing set 1, [hl] - aCoord 8, 5 + lda_coord 8, 5 dec d jr .storeTile .notFacingUp @@ -326,7 +326,7 @@ GetTileTwoStepsInFrontOfPlayer: ; facing left ld hl, hPlayerFacing set 2, [hl] - aCoord 4, 9 + lda_coord 4, 9 dec e jr .storeTile .notFacingLeft @@ -335,7 +335,7 @@ GetTileTwoStepsInFrontOfPlayer: ; facing right ld hl, hPlayerFacing set 3, [hl] - aCoord 12, 9 + lda_coord 12, 9 inc e .storeTile ld c, a diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index 0a760a27..0b514111 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -10,17 +10,17 @@ DisplayPCMainMenu:: ld a, [wNumHoFTeams] and a jr nz, .leaguePCAvailable - coord hl, 0, 0 + hlcoord 0, 0 ld b, 8 ld c, 14 jr .next .noOaksPC - coord hl, 0, 0 + hlcoord 0, 0 ld b, 6 ld c, 14 jr .next .leaguePCAvailable - coord hl, 0, 0 + hlcoord 0, 0 ld b, 10 ld c, 14 .next @@ -30,15 +30,15 @@ DisplayPCMainMenu:: ld [wMaxMenuItem], a CheckEvent EVENT_MET_BILL jr nz, .metBill - coord hl, 2, 2 + hlcoord 2, 2 ld de, SomeonesPCText jr .next2 .metBill - coord hl, 2, 2 + hlcoord 2, 2 ld de, BillsPCText .next2 call PlaceString - coord hl, 2, 4 + hlcoord 2, 4 ld de, wPlayerName call PlaceString ld l, c @@ -47,7 +47,7 @@ DisplayPCMainMenu:: call PlaceString CheckEvent EVENT_GOT_POKEDEX jr z, .noOaksPC2 - coord hl, 2, 6 + hlcoord 2, 6 ld de, OaksPCText call PlaceString ld a, [wNumHoFTeams] @@ -55,20 +55,20 @@ DisplayPCMainMenu:: jr z, .noLeaguePC ld a, 4 ld [wMaxMenuItem], a - coord hl, 2, 8 + hlcoord 2, 8 ld de, PKMNLeaguePCText call PlaceString - coord hl, 2, 10 + hlcoord 2, 10 ld de, LogOffPCText jr .next3 .noLeaguePC - coord hl, 2, 8 + hlcoord 2, 8 ld de, LogOffPCText jr .next3 .noOaksPC2 ld a, $2 ld [wMaxMenuItem], a - coord hl, 2, 6 + hlcoord 2, 6 ld de, LogOffPCText .next3 call PlaceString @@ -119,11 +119,11 @@ BillsPCMenu: lb bc, BANK(PokeballTileGraphics), $01 call CopyVideoData call LoadScreenTilesFromBuffer2DisableBGTransfer - coord hl, 0, 0 + hlcoord 0, 0 ld b, 10 ld c, 12 call TextBoxBorder - coord hl, 2, 2 + hlcoord 2, 2 ld de, BillsPCMenuText call PlaceString ld hl, wTopMenuItemY @@ -146,7 +146,7 @@ BillsPCMenu: ld [wPlayerMonNumber], a ld hl, WhatText call PrintText - coord hl, 9, 14 + hlcoord 9, 14 ld b, 2 ld c, 9 call TextBoxBorder @@ -156,15 +156,15 @@ BillsPCMenu: jr c, .singleDigitBoxNum ; two digit box num sub 9 - coord hl, 17, 16 + hlcoord 17, 16 ld [hl], "1" add "0" jr .next .singleDigitBoxNum add "1" .next - Coorda 18, 16 - coord hl, 10, 16 + ldcoord_a 18, 16 + hlcoord 10, 16 ld de, BoxNoPCText call PlaceString ld a, 1 @@ -380,7 +380,7 @@ HMMoveArray: INCLUDE "data/moves/hm_moves.asm" DisplayDepositWithdrawMenu: - coord hl, 9, 10 + hlcoord 9, 10 ld b, 6 ld c, 9 call TextBoxBorder @@ -390,9 +390,9 @@ DisplayDepositWithdrawMenu: jr nz, .next ld de, WithdrawPCText .next - coord hl, 11, 12 + hlcoord 11, 12 call PlaceString - coord hl, 11, 14 + hlcoord 11, 14 ld de, StatsCancelPCText call PlaceString ld hl, wTopMenuItemY diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm index 564a8557..ed44f9a6 100755 --- a/engine/pokemon/evos_moves.asm +++ b/engine/pokemon/evos_moves.asm @@ -121,7 +121,7 @@ Evolution_PartyMonLoop: ; loop over party mons call DelayFrames xor a ldh [hAutoBGTransferEnabled], a - coord hl, 0, 0 + hlcoord 0, 0 lb bc, 12, 20 call ClearScreenArea ld a, $1 diff --git a/engine/pokemon/learn_move.asm b/engine/pokemon/learn_move.asm index e7b907d5..8e852fd4 100755 --- a/engine/pokemon/learn_move.asm +++ b/engine/pokemon/learn_move.asm @@ -76,7 +76,7 @@ DontAbandonLearning: AbandonLearning: ld hl, AbandonLearningText call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -99,7 +99,7 @@ TryingToLearn: push hl ld hl, TryingToLearnText call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -120,11 +120,11 @@ TryingToLearn: push hl ld hl, WhichMoveToForgetText call PrintText - coord hl, 4, 7 + hlcoord 4, 7 ld b, 4 ld c, 14 call TextBoxBorder - coord hl, 6, 8 + hlcoord 6, 8 ld de, wMovesString ldh a, [hFlagsFFF6] set 2, a diff --git a/engine/pokemon/status_screen.asm b/engine/pokemon/status_screen.asm index c2abeedd..83d33fe5 100755 --- a/engine/pokemon/status_screen.asm +++ b/engine/pokemon/status_screen.asm @@ -105,7 +105,7 @@ StatusScreen: push af xor a ldh [hTilesetType], a - coord hl, 19, 1 + hlcoord 19, 1 lb bc, 6, 10 call DrawLineBox ; Draws the box around name, HP and status ld de, -6 @@ -113,54 +113,54 @@ StatusScreen: ld [hl], "" dec hl ld [hl], "№" - coord hl, 19, 9 + hlcoord 19, 9 lb bc, 8, 6 call DrawLineBox ; Draws the box around types, ID No. and OT - coord hl, 10, 9 + hlcoord 10, 9 ld de, Type1Text call PlaceString ; "TYPE1/" - coord hl, 11, 3 + hlcoord 11, 3 predef DrawHP ld hl, wStatusScreenHPBarColor call GetHealthBarColor ld b, SET_PAL_STATUS_SCREEN call RunPaletteCommand - coord hl, 16, 6 + hlcoord 16, 6 ld de, wLoadedMonStatus call PrintStatusCondition jr nz, .StatusWritten - coord hl, 16, 6 + hlcoord 16, 6 ld de, OKText call PlaceString ; "OK" .StatusWritten - coord hl, 9, 6 + hlcoord 9, 6 ld de, StatusText call PlaceString ; "STATUS/" - coord hl, 14, 2 + hlcoord 14, 2 call PrintLevel ; Pokémon level ld a, [wMonHIndex] ld [wd11e], a ld [wd0b5], a predef IndexToPokedex - coord hl, 3, 7 + hlcoord 3, 7 ld de, wd11e lb bc, LEADING_ZEROES | 1, 3 call PrintNumber ; Pokémon no. - coord hl, 11, 10 + hlcoord 11, 10 predef PrintMonType ld hl, NamePointers2 call .GetStringPointer ld d, h ld e, l - coord hl, 9, 1 + hlcoord 9, 1 call PlaceString ; Pokémon name ld hl, OTPointers call .GetStringPointer ld d, h ld e, l - coord hl, 12, 16 + hlcoord 12, 16 call PlaceString ; OT - coord hl, 12, 14 + hlcoord 12, 14 ld de, wLoadedMonOTID lb bc, LEADING_ZEROES | 2, 5 call PrintNumber ; ID Number @@ -168,7 +168,7 @@ StatusScreen: call PrintStatsBox call Delay3 call GBPalNormal - coord hl, 1, 0 + hlcoord 1, 0 call LoadFlippedFrontSpriteByMonIndex ; draw Pokémon picture ld a, [wcf91] call PlayCry ; play Pokémon cry @@ -252,19 +252,19 @@ PrintStatsBox: ld a, d and a ; a is 0 from the status screen jr nz, .DifferentBox - coord hl, 0, 8 + hlcoord 0, 8 ld b, 8 ld c, 8 call TextBoxBorder ; Draws the box - coord hl, 1, 9 ; Start printing stats from here + hlcoord 1, 9 ; Start printing stats from here ld bc, $19 ; Number offset jr .PrintStats .DifferentBox - coord hl, 9, 2 + hlcoord 9, 2 ld b, 8 ld c, 9 call TextBoxBorder - coord hl, 11, 3 + hlcoord 11, 3 ld bc, $18 .PrintStats push bc @@ -311,16 +311,16 @@ StatusScreen2: ld bc, NUM_MOVES call CopyData callfar FormatMovesString - coord hl, 9, 2 + hlcoord 9, 2 lb bc, 5, 10 call ClearScreenArea ; Clear under name - coord hl, 19, 3 + hlcoord 19, 3 ld [hl], $78 - coord hl, 0, 8 + hlcoord 0, 8 ld b, 8 ld c, 18 call TextBoxBorder ; Draw move container - coord hl, 2, 9 + hlcoord 2, 9 ld de, wMovesString call PlaceString ; Print moves ld a, [wNumMovesMinusOne] @@ -329,7 +329,7 @@ StatusScreen2: ld a, $4 sub c ld b, a ; Number of moves ? - coord hl, 11, 10 + hlcoord 11, 10 ld de, SCREEN_WIDTH * 2 ld a, "" call StatusScreen_PrintPP ; Print "PP" @@ -341,7 +341,7 @@ StatusScreen2: call StatusScreen_PrintPP ; Fill the rest with -- .InitPP ld hl, wLoadedMonMoves - coord de, 14, 10 + decoord 14, 10 ld b, 0 .PrintPP ld a, [hli] @@ -391,7 +391,7 @@ StatusScreen2: cp $4 jr nz, .PrintPP .PPDone - coord hl, 9, 3 + hlcoord 9, 3 ld de, StatusScreenExpText call PlaceString ld a, [wLoadedMonLevel] @@ -401,7 +401,7 @@ StatusScreen2: inc a ld [wLoadedMonLevel], a ; Increase temporarily if not 100 .Level100 - coord hl, 14, 6 + hlcoord 14, 6 ld [hl], "" inc hl inc hl @@ -409,22 +409,22 @@ StatusScreen2: pop af ld [wLoadedMonLevel], a ld de, wLoadedMonExp - coord hl, 12, 4 + hlcoord 12, 4 lb bc, 3, 7 call PrintNumber ; exp call CalcExpToLevelUp ld de, wLoadedMonExp - coord hl, 7, 6 + hlcoord 7, 6 lb bc, 3, 7 call PrintNumber ; exp needed to level up - coord hl, 9, 0 + hlcoord 9, 0 call StatusScreen_ClearName - coord hl, 9, 1 + hlcoord 9, 1 call StatusScreen_ClearName ld a, [wMonHIndex] ld [wd11e], a call GetMonName - coord hl, 9, 1 + hlcoord 9, 1 call PlaceString ld a, $1 ldh [hAutoBGTransferEnabled], a diff --git a/engine/slots/slot_machine.asm b/engine/slots/slot_machine.asm index 64c14997..a1326240 100755 --- a/engine/slots/slot_machine.asm +++ b/engine/slots/slot_machine.asm @@ -79,11 +79,11 @@ MainSlotMachineLoop: ld [wCurrentMenuItem], a ld [wLastMenuItem], a ld [wMenuWatchMovingOutOfBounds], a - coord hl, 14, 11 + hlcoord 14, 11 ld b, 5 ld c, 4 call TextBoxBorder - coord hl, 16, 12 + hlcoord 16, 12 ld de, CoinMultiplierSlotMachineText call PlaceString call HandleMenuInput @@ -133,7 +133,7 @@ MainSlotMachineLoop: .skip2 ld hl, OneMoreGoSlotMachineText call PrintText - coord hl, 14, 12 + hlcoord 14, 12 lb bc, 13, 15 xor a ; YES_NO_MENU ld [wTwoOptionMenuID], a @@ -615,7 +615,7 @@ YeahText: SlotMachine_PrintWinningSymbol: ; prints winning symbol and down arrow in text box - coord hl, 2, 14 + hlcoord 2, 14 ld a, [wSlotMachineWinningSymbol] add $25 ld [hli], a @@ -627,7 +627,7 @@ SlotMachine_PrintWinningSymbol: ld [hli], a inc a ld [hl], a - coord hl, 18, 16 + hlcoord 18, 16 ld [hl], "▼" ret @@ -642,13 +642,13 @@ SlotMachine_SubtractBetFromPlayerCoins: predef SubBCDPredef SlotMachine_PrintCreditCoins: - coord hl, 5, 1 + hlcoord 5, 1 ld de, wPlayerCoins ld c, $2 jp PrintBCDNumber SlotMachine_PrintPayoutCoins: - coord hl, 11, 1 + hlcoord 11, 1 ld de, wPayoutCoins lb bc, LEADING_ZEROES | 2, 4 ; 2 bytes, 4 digits jp PrintNumber @@ -725,19 +725,19 @@ SlotMachine_LightBalls: jr z, SlotMachine_UpdateTwoCoinBallTiles SlotMachine_UpdateThreeCoinBallTiles: - coord hl, 3, 2 + hlcoord 3, 2 call SlotMachine_UpdateBallTiles - coord hl, 3, 10 + hlcoord 3, 10 call SlotMachine_UpdateBallTiles SlotMachine_UpdateTwoCoinBallTiles: - coord hl, 3, 4 + hlcoord 3, 4 call SlotMachine_UpdateBallTiles - coord hl, 3, 8 + hlcoord 3, 8 call SlotMachine_UpdateBallTiles SlotMachine_UpdateOneCoinBallTiles: - coord hl, 3, 6 + hlcoord 3, 6 SlotMachine_UpdateBallTiles: ld a, [wNewSlotMachineBallTile] @@ -864,7 +864,7 @@ LoadSlotMachineTiles: ld a, BANK(SlotMachineTiles2) call FarCopyData2 ld hl, SlotMachineMap - coord de, 0, 0 + decoord 0, 0 ld bc, SlotMachineMapEnd - SlotMachineMap call CopyData call EnableLCD diff --git a/home.asm b/home.asm index 3e465cdf..037a3444 100644 --- a/home.asm +++ b/home.asm @@ -869,7 +869,7 @@ UncompressSpriteFromDE:: jp UncompressSpriteData SaveScreenTilesToBuffer2:: - coord hl, 0, 0 + hlcoord 0, 0 ld de, wTileMapBackup2 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT call CopyData @@ -886,13 +886,13 @@ LoadScreenTilesFromBuffer2DisableBGTransfer:: xor a ldh [hAutoBGTransferEnabled], a ld hl, wTileMapBackup2 - coord de, 0, 0 + decoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT call CopyData ret SaveScreenTilesToBuffer1:: - coord hl, 0, 0 + hlcoord 0, 0 ld de, wTileMapBackup ld bc, SCREEN_WIDTH * SCREEN_HEIGHT jp CopyData @@ -901,7 +901,7 @@ LoadScreenTilesFromBuffer1:: xor a ldh [hAutoBGTransferEnabled], a ld hl, wTileMapBackup - coord de, 0, 0 + decoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT call CopyData ld a, 1 @@ -1071,7 +1071,7 @@ WaitForTextScrollButtonPress:: jr z, .skipAnimation call TownMapSpriteBlinkingAnimation .skipAnimation - coord hl, 18, 16 + hlcoord 18, 16 call HandleDownArrowBlinkTiming pop hl call JoypadLowSensitivity @@ -1304,7 +1304,7 @@ HandleMenuInput_:: and a ; was a key pressed? jr nz, .keyPressed push hl - coord hl, 18, 11 ; coordinates of blinking down arrow in some menus + hlcoord 18, 11 ; coordinates of blinking down arrow in some menus call HandleDownArrowBlinkTiming ; blink down arrow (if any) pop hl ld a, [wMenuJoypadPollCount] @@ -1395,7 +1395,7 @@ PlaceMenuCursor:: ld a, [wTopMenuItemY] and a ; is the y coordinate 0? jr z, .adjustForXCoord - coord hl, 0, 0 + hlcoord 0, 0 ld bc, SCREEN_WIDTH .topMenuItemLoop add hl, bc @@ -1565,7 +1565,7 @@ PrintText:: call Delay3 pop hl PrintText_NoCreatingTextBox:: - coord bc, 1, 14 + bccoord 1, 14 jp TextCommandProcessor INCLUDE "home/print_num.asm" diff --git a/home/copy2.asm b/home/copy2.asm index 01417201..1c9a56f3 100644 --- a/home/copy2.asm +++ b/home/copy2.asm @@ -184,17 +184,17 @@ CopyScreenTileBufferToVRAM:: ld c, 6 ld hl, $600 * 0 - coord de, 0, 6 * 0 + decoord 0, 6 * 0 call .setup call DelayFrame ld hl, $600 * 1 - coord de, 0, 6 * 1 + decoord 0, 6 * 1 call .setup call DelayFrame ld hl, $600 * 2 - coord de, 0, 6 * 2 + decoord 0, 6 * 2 call .setup jp DelayFrame @@ -217,7 +217,7 @@ ClearScreen:: ; for the bg map to update. ld bc, 20 * 18 inc b - coord hl, 0, 0 + hlcoord 0, 0 ld a, " " .loop ld [hli], a diff --git a/home/list_menu.asm b/home/list_menu.asm index 9c567d0d..ec775331 100644 --- a/home/list_menu.asm +++ b/home/list_menu.asm @@ -31,7 +31,7 @@ DisplayListMenuID:: call DisplayTextBoxID ; draw the menu text box call UpdateSprites ; disable sprites behind the text box ; the code up to .skipMovingSprites appears to be useless - coord hl, 4, 2 ; coordinates of upper left corner of menu text box + hlcoord 4, 2 ; coordinates of upper left corner of menu text box lb de, 9, 14 ; height and width of menu text box ld a, [wListMenuID] and a ; is it a PC pokemon list? @@ -67,12 +67,12 @@ DisplayListMenuIDLoop:: jr z, .notOldManBattle .oldManBattle ld a, "▶" - Coorda 5, 4 ; place menu cursor in front of first menu entry + ldcoord_a 5, 4 ; place menu cursor in front of first menu entry ld c, 80 call DelayFrames xor a ld [wCurrentMenuItem], a - coord hl, 5, 4 + hlcoord 5, 4 ld a, l ld [wMenuCursorLocation], a ld a, h @@ -194,23 +194,23 @@ DisplayListMenuIDLoop:: DisplayChooseQuantityMenu:: ; text box dimensions/coordinates for just quantity - coord hl, 15, 9 + hlcoord 15, 9 ld b, 1 ; height ld c, 3 ; width ld a, [wListMenuID] cp PRICEDITEMLISTMENU jr nz, .drawTextBox ; text box dimensions/coordinates for quantity and price - coord hl, 7, 9 + hlcoord 7, 9 ld b, 1 ; height ld c, 11 ; width .drawTextBox call TextBoxBorder - coord hl, 16, 10 + hlcoord 16, 10 ld a, [wListMenuID] cp PRICEDITEMLISTMENU jr nz, .printInitialQuantity - coord hl, 8, 10 + hlcoord 8, 10 .printInitialQuantity ld de, InitialQuantityText call PlaceString @@ -250,7 +250,7 @@ DisplayChooseQuantityMenu:: ld a, [wMaxItemQuantity] ld [hl], a .handleNewQuantity - coord hl, 17, 10 + hlcoord 17, 10 ld a, [wListMenuID] cp PRICEDITEMLISTMENU jr nz, .printQuantity @@ -289,13 +289,13 @@ DisplayChooseQuantityMenu:: ldh a, [hDivideBCDQuotient + 2] ldh [hMoney + 2], a .skipHalvingPrice - coord hl, 12, 10 + hlcoord 12, 10 ld de, SpacesBetweenQuantityAndPriceText call PlaceString ld de, hMoney ; total price ld c, $a3 call PrintBCDNumber - coord hl, 9, 10 + hlcoord 9, 10 .printQuantity ld de, wItemQuantity ; current quantity lb bc, LEADING_ZEROES | 1, 2 ; 1 byte, 2 digits @@ -334,7 +334,7 @@ ExitListMenu:: ret PrintListMenuEntries:: - coord hl, 5, 3 + hlcoord 5, 3 ld b, 9 ld c, 14 call ClearScreenArea @@ -359,7 +359,7 @@ PrintListMenuEntries:: jr nc, .noCarry inc d .noCarry - coord hl, 6, 4 ; coordinates of first list entry name + hlcoord 6, 4 ; coordinates of first list entry name ld b, 4 ; print 4 names .loop ld a, b diff --git a/home/overworld.asm b/home/overworld.asm index 557efa2d..af2a79b2 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -103,7 +103,7 @@ OverworldLoopLessDelay:: jr nz, .checkForOpponent bit 0, a jr nz, .checkForOpponent - aCoord 8, 9 + lda_coord 8, 9 ld [wTilePlayerStandingOn], a ; unused? call DisplayTextID ; display either the start menu or the NPC/sign text ld a, [wEnteringCableClub] @@ -688,7 +688,7 @@ CheckMapConnections:: ; function to play a sound when changing maps PlayMapChangeSound:: - aCoord 8, 8 ; upper left tile of the 4x4 square the player's sprite is standing on + lda_coord 8, 8 ; upper left tile of the 4x4 square the player's sprite is standing on cp $0b ; door tile in tileset 0 jr nz, .didNotGoThroughDoor ld a, SFX_GO_INSIDE @@ -1297,7 +1297,7 @@ CheckForJumpingAndTilePairCollisions:: ; if not jumping CheckForTilePairCollisions2:: - aCoord 8, 9 ; tile the player is on + lda_coord 8, 9 ; tile the player is on ld [wTilePlayerStandingOn], a CheckForTilePairCollisions:: @@ -1438,7 +1438,7 @@ LoadCurrentMapView:: ld bc, $2 add hl, bc .copyToVisibleAreaBuffer - coord de, 0, 0 ; base address for the tiles that are directly transferred to VRAM during V-blank + decoord 0, 0 ; base address for the tiles that are directly transferred to VRAM during V-blank ld b, SCREEN_HEIGHT .rowLoop2 ld c, SCREEN_WIDTH @@ -1711,7 +1711,7 @@ MoveTileBlockMapPointerNorth:: ; the portion of the map that was newly exposed due to the player's movement ScheduleNorthRowRedraw:: - coord hl, 0, 0 + hlcoord 0, 0 call CopyToRedrawRowOrColumnSrcTiles ld a, [wMapViewVRAMPointer] ldh [hRedrawRowOrColumnDest], a @@ -1733,7 +1733,7 @@ CopyToRedrawRowOrColumnSrcTiles:: ret ScheduleSouthRowRedraw:: - coord hl, 0, 16 + hlcoord 0, 16 call CopyToRedrawRowOrColumnSrcTiles ld a, [wMapViewVRAMPointer] ld l, a @@ -1752,7 +1752,7 @@ ScheduleSouthRowRedraw:: ret ScheduleEastColumnRedraw:: - coord hl, 18, 0 + hlcoord 18, 0 call ScheduleColumnRedrawHelper ld a, [wMapViewVRAMPointer] ld c, a @@ -1790,7 +1790,7 @@ ScheduleColumnRedrawHelper:: ret ScheduleWestColumnRedraw:: - coord hl, 0, 0 + hlcoord 0, 0 call ScheduleColumnRedrawHelper ld a, [wMapViewVRAMPointer] ldh [hRedrawRowOrColumnDest], a @@ -2342,7 +2342,7 @@ LoadMapData:: call LoadTilesetTilePatternData call LoadCurrentMapView ; copy current map view to VRAM - coord hl, 0, 0 + hlcoord 0, 0 ld de, vBGMap0 ld b, 18 .vramCopyLoop diff --git a/home/text.asm b/home/text.asm index 5bbad00b..bdd871cb 100644 --- a/home/text.asm +++ b/home/text.asm @@ -76,7 +76,7 @@ PlaceNextChar:: cp "" jr nz, .NotLine pop hl - coord hl, 1, 16 + hlcoord 1, 16 push hl jp NextChar @@ -207,12 +207,12 @@ PromptText:: cp LINK_STATE_BATTLING jp z, .ok ld a, "▼" - Coorda 18, 16 + ldcoord_a 18, 16 .ok call ProtectedDelay3 call ManualTextScroll ld a, " " - Coorda 18, 16 + ldcoord_a 18, 16 DoneText:: pop hl @@ -226,49 +226,49 @@ DoneText:: Paragraph:: push de ld a, "▼" - Coorda 18, 16 + ldcoord_a 18, 16 call ProtectedDelay3 call ManualTextScroll - coord hl, 1, 13 + hlcoord 1, 13 lb bc, 4, 18 call ClearScreenArea ld c, 20 call DelayFrames pop de - coord hl, 1, 14 + hlcoord 1, 14 jp NextChar PageChar:: push de ld a, "▼" - Coorda 18, 16 + ldcoord_a 18, 16 call ProtectedDelay3 call ManualTextScroll - coord hl, 1, 10 + hlcoord 1, 10 lb bc, 7, 18 call ClearScreenArea ld c, 20 call DelayFrames pop de pop hl - coord hl, 1, 11 + hlcoord 1, 11 push hl jp NextChar _ContText:: ld a, "▼" - Coorda 18, 16 + ldcoord_a 18, 16 call ProtectedDelay3 push de call ManualTextScroll pop de ld a, " " - Coorda 18, 16 + ldcoord_a 18, 16 _ContTextNoPause:: push de call ScrollTextUpOneLine call ScrollTextUpOneLine - coord hl, 1, 16 + hlcoord 1, 16 pop de jp NextChar @@ -277,8 +277,8 @@ _ContTextNoPause:: ; first time, copy the two rows of text to the "in between" rows that are usually emtpy ; second time, copy the bottom row of text into the top row of text ScrollTextUpOneLine:: - coord hl, 0, 14 ; top row of text - coord de, 0, 13 ; empty line above text + hlcoord 0, 14 ; top row of text + decoord 0, 13 ; empty line above text ld b, SCREEN_WIDTH * 3 .copyText ld a, [hli] @@ -286,7 +286,7 @@ ScrollTextUpOneLine:: inc de dec b jr nz, .copyText - coord hl, 1, 16 + hlcoord 1, 16 ld a, " " ld b, SCREEN_WIDTH - 2 .clearText @@ -424,7 +424,7 @@ TextCommand_MOVE:: TextCommand_LOW:: ; write text at (1,16) pop hl - coord bc, 1, 16 ; second line of dialogue text box + bccoord 1, 16 ; second line of dialogue text box jp NextTextCommand TextCommand_PROMPT_BUTTON:: @@ -433,12 +433,12 @@ TextCommand_PROMPT_BUTTON:: cp LINK_STATE_BATTLING jp z, TextCommand_WAIT_BUTTON ld a, "▼" - Coorda 18, 16 ; place down arrow in lower right corner of dialogue text box + ldcoord_a 18, 16 ; place down arrow in lower right corner of dialogue text box push bc call ManualTextScroll ; blink arrow and wait for A or B to be pressed pop bc ld a, " " - Coorda 18, 16 ; overwrite down arrow with blank space + ldcoord_a 18, 16 ; overwrite down arrow with blank space pop hl jp NextTextCommand @@ -446,11 +446,11 @@ TextCommand_SCROLL:: ; pushes text up two lines and sets the BC cursor to the border tile ; below the first character column of the text box. ld a, " " - Coorda 18, 16 ; place blank space in lower right corner of dialogue text box + ldcoord_a 18, 16 ; place blank space in lower right corner of dialogue text box call ScrollTextUpOneLine call ScrollTextUpOneLine pop hl - coord bc, 1, 16 ; second line of dialogue text box + bccoord 1, 16 ; second line of dialogue text box jp NextTextCommand TextCommand_START_ASM:: diff --git a/home/vcopy.asm b/home/vcopy.asm index d2340b7c..1a7863e9 100644 --- a/home/vcopy.asm +++ b/home/vcopy.asm @@ -134,7 +134,7 @@ AutoBgMapTransfer:: dec a jr z, .transferMiddleThird .transferBottomThird - coord hl, 0, 12 + hlcoord 0, 12 ld sp, hl ldh a, [hAutoBGTransferDest + 1] ld h, a @@ -145,7 +145,7 @@ AutoBgMapTransfer:: xor a ; TRANSFERTOP jr .doTransfer .transferTopThird - coord hl, 0, 0 + hlcoord 0, 0 ld sp, hl ldh a, [hAutoBGTransferDest + 1] ld h, a @@ -154,7 +154,7 @@ AutoBgMapTransfer:: ld a, TRANSFERMIDDLE jr .doTransfer .transferMiddleThird - coord hl, 0, 6 + hlcoord 0, 6 ld sp, hl ldh a, [hAutoBGTransferDest + 1] ld h, a diff --git a/home/yes_no.asm b/home/yes_no.asm index 61aa1390..aae27f86 100644 --- a/home/yes_no.asm +++ b/home/yes_no.asm @@ -14,7 +14,7 @@ Func_35f4:: InitYesNoTextBoxParameters:: xor a ; YES_NO_MENU ld [wTwoOptionMenuID], a - coord hl, 14, 7 + hlcoord 14, 7 ld bc, $80f ret @@ -22,7 +22,7 @@ YesNoChoicePokeCenter:: call SaveScreenTilesToBuffer1 ld a, HEAL_CANCEL_MENU ld [wTwoOptionMenuID], a - coord hl, 11, 6 + hlcoord 11, 6 lb bc, 8, 12 jr DisplayYesNoChoice @@ -30,7 +30,7 @@ WideYesNoChoice:: ; unused call SaveScreenTilesToBuffer1 ld a, WIDE_YES_NO_MENU ld [wTwoOptionMenuID], a - coord hl, 12, 7 + hlcoord 12, 7 lb bc, 8, 13 DisplayYesNoChoice:: diff --git a/macros/coords.asm b/macros/coords.asm index 302260d7..94808ba5 100644 --- a/macros/coords.asm +++ b/macros/coords.asm @@ -1,65 +1,79 @@ -validateCoords: MACRO - IF \1 >= SCREEN_WIDTH - fail "x coord out of range" - ENDC - IF \2 >= SCREEN_HEIGHT - fail "y coord out of range" +validate_coords: MACRO + IF _NARG >= 4 + IF \1 >= \3 + fail "x coord out of range" + ENDC + IF \2 >= \4 + fail "y coord out of range" + ENDC + ELSE + validate_coords \1, \2, SCREEN_WIDTH, SCREEN_HEIGHT ENDC ENDM -;\1 = r -;\2 = X -;\3 = Y -;\4 = which tilemap (optional) +hlcoord EQUS "coord hl," +bccoord EQUS "coord bc," +decoord EQUS "coord de," + coord: MACRO - validateCoords \2, \3 +; register, x, y[, origin] + validate_coords \2, \3 IF _NARG >= 4 - ld \1, \4 + SCREEN_WIDTH * \3 + \2 + ld \1, (\3) * SCREEN_WIDTH + (\2) + \4 ELSE - ld \1, wTileMap + SCREEN_WIDTH * \3 + \2 + ld \1, (\3) * SCREEN_WIDTH + (\2) + wTileMap ENDC ENDM -;\1 = X -;\2 = Y -;\3 = which tilemap (optional) -aCoord: MACRO - validateCoords \1, \2 - IF _NARG >= 3 - ld a, [\3 + SCREEN_WIDTH * \2 + \1] +hlbgcoord EQUS "bgcoord hl," +bcbgcoord EQUS "bgcoord bc," +debgcoord EQUS "bgcoord de," + +bgcoord: MACRO +; register, x, y[, origin] + validate_coords \2, \3, BG_MAP_WIDTH, BG_MAP_HEIGHT + IF _NARG >= 4 + ld \1, (\3) * BG_MAP_WIDTH + (\2) + \4 ELSE - ld a, [wTileMap + SCREEN_WIDTH * \2 + \1] + ld \1, (\3) * BG_MAP_WIDTH + (\2) + vBGMap0 ENDC ENDM -;\1 = X -;\2 = Y -;\3 = which tilemap (optional) -Coorda: MACRO - validateCoords \1, \2 +hlowcoord EQUS "owcoord hl," +bcowcoord EQUS "owcoord bc," +deowcoord EQUS "owcoord de," + +owcoord: MACRO +; register, x, y, map width + ld \1, wOverworldMap + ((\2) + 3) + (((\3) + 3) * ((\4) + (3 * 2))) +ENDM + +dwcoord: MACRO +; x, y + validate_coords \1, \2 IF _NARG >= 3 - ld [\3 + SCREEN_WIDTH * \2 + \1], a + dw (\2) * SCREEN_WIDTH + (\1) + \3 ELSE - ld [wTileMap + SCREEN_WIDTH * \2 + \1], a + dw (\2) * SCREEN_WIDTH + (\1) + wTileMap ENDC ENDM -;\1 = X -;\2 = Y -;\3 = which tilemap (optional) -dwCoord: MACRO - validateCoords \1, \2 +ldcoord_a: MACRO +; x, y[, origin] + validate_coords \1, \2 IF _NARG >= 3 - dw \3 + SCREEN_WIDTH * \2 + \1 + ld [(\2) * SCREEN_WIDTH + (\1) + \3], a ELSE - dw wTileMap + SCREEN_WIDTH * \2 + \1 + ld [(\2) * SCREEN_WIDTH + (\1) + wTileMap], a ENDC ENDM -;\1 = r -;\2 = X -;\3 = Y -;\4 = map width -overworldMapCoord: MACRO - ld \1, wOverworldMap + ((\2) + 3) + (((\3) + 3) * ((\4) + (3 * 2))) +lda_coord: MACRO +; x, y[, origin] + validate_coords \1, \2 + IF _NARG >= 3 + ld a, [(\2) * SCREEN_WIDTH + (\1) + \3] + ELSE + ld a, [(\2) * SCREEN_WIDTH + (\1) + wTileMap] + ENDC ENDM diff --git a/macros/data.asm b/macros/data.asm index 7a813529..16742d53 100755 --- a/macros/data.asm +++ b/macros/data.asm @@ -33,7 +33,7 @@ _tms3 = _tms3 | (1 << ((\1_TMNUM) - 1 - 48)) else fail "\1 is not a TM or HM move" ENDC - shift + SHIFT ENDR REPT 3 ; TM01-TM24 (24/24) db _tms1 & $ff diff --git a/macros/gfx.asm b/macros/gfx.asm index 950daee1..8803dad2 100644 --- a/macros/gfx.asm +++ b/macros/gfx.asm @@ -1,7 +1,7 @@ RGB: MACRO REPT _NARG / 3 dw palred (\1) + palgreen (\2) + palblue (\3) - shift 3 + SHIFT 3 ENDR ENDM diff --git a/macros/scripts/events.asm b/macros/scripts/events.asm index 9e84ec62..8087c5c2 100755 --- a/macros/scripts/events.asm +++ b/macros/scripts/events.asm @@ -185,7 +185,7 @@ SetEvents: MACRO SetEvent \1 REPT _NARG - 1 SetEventReuseHL \2 - shift + SHIFT ENDR ENDM @@ -237,7 +237,7 @@ ResetEvents: MACRO ResetEvent \1 REPT _NARG - 1 ResetEventReuseHL \2 - shift + SHIFT ENDR ENDM diff --git a/macros/scripts/text.asm b/macros/scripts/text.asm index efecdd1c..261ab5f4 100755 --- a/macros/scripts/text.asm +++ b/macros/scripts/text.asm @@ -200,7 +200,7 @@ script_mart: MACRO db _NARG ; number of items REPT _NARG db \1 ; item id - shift + SHIFT ENDR db -1 ; end ENDM diff --git a/scripts/BikeShop.asm b/scripts/BikeShop.asm index 8ff581a3..7b290f31 100755 --- a/scripts/BikeShop.asm +++ b/scripts/BikeShop.asm @@ -49,15 +49,15 @@ BikeShopText1: ld [wTopMenuItemX], a ld hl, wd730 set 6, [hl] - coord hl, 0, 0 + hlcoord 0, 0 ld b, $4 ld c, $f call TextBoxBorder call UpdateSprites - coord hl, 2, 2 + hlcoord 2, 2 ld de, BikeShopMenuText call PlaceString - coord hl, 8, 3 + hlcoord 8, 3 ld de, BikeShopMenuPrice call PlaceString ld hl, BikeShopText_1d815 diff --git a/scripts/CeladonMartRoof.asm b/scripts/CeladonMartRoof.asm index e880211b..b1f6a8a3 100755 --- a/scripts/CeladonMartRoof.asm +++ b/scripts/CeladonMartRoof.asm @@ -64,7 +64,7 @@ CeladonMartRoofScript_GiveDrinkToGirl: dec l ld b, l ld c, 12 - coord hl, 0, 0 + hlcoord 0, 0 call TextBoxBorder call UpdateSprites call CeladonMartRoofScript_PrintDrinksInBag @@ -194,7 +194,7 @@ CeladonMartRoofScript_PrintDrinksInBag: push hl ld [wd11e], a call GetItemName - coord hl, 2, 2 + hlcoord 2, 2 ldh a, [hItemCounter] ld bc, SCREEN_WIDTH * 2 call AddNTimes diff --git a/scripts/GameCorner.asm b/scripts/GameCorner.asm index d5f43e6b..ded5854f 100755 --- a/scripts/GameCorner.asm +++ b/scripts/GameCorner.asm @@ -474,32 +474,32 @@ CeladonGameCornerText_48f19: CeladonGameCornerScript_48f1e: ld hl, wd730 set 6, [hl] - coord hl, 11, 0 + hlcoord 11, 0 ld b, $5 ld c, $7 call TextBoxBorder call UpdateSprites - coord hl, 12, 1 + hlcoord 12, 1 ld b, 4 ld c, 7 call ClearScreenArea - coord hl, 12, 2 + hlcoord 12, 2 ld de, GameCornerMoneyText call PlaceString - coord hl, 12, 3 + hlcoord 12, 3 ld de, GameCornerBlankText1 call PlaceString - coord hl, 12, 3 + hlcoord 12, 3 ld de, wPlayerMoney ld c, $a3 call PrintBCDNumber - coord hl, 12, 4 + hlcoord 12, 4 ld de, GameCornerCoinText call PlaceString - coord hl, 12, 5 + hlcoord 12, 5 ld de, GameCornerBlankText2 call PlaceString - coord hl, 15, 5 + hlcoord 15, 5 ld de, wPlayerCoins ld c, $82 call PrintBCDNumber diff --git a/scripts/VermilionDock.asm b/scripts/VermilionDock.asm index 5af5e5a2..9dc4b2b9 100755 --- a/scripts/VermilionDock.asm +++ b/scripts/VermilionDock.asm @@ -52,7 +52,7 @@ VermilionDock_1db9b: call DelayFrames ld b, $9c call CopyScreenTileBufferToVRAM - coord hl, 0, 10 + hlcoord 0, 10 ld bc, SCREEN_WIDTH * 6 ld a, $14 ; water tile call FillMemory @@ -184,7 +184,7 @@ VermilionDock_EraseSSAnne: ld bc, (5 * BG_MAP_WIDTH) + SCREEN_WIDTH ld a, $14 ; water tile call FillMemory - ld hl, vBGMap0 + 10 * BG_MAP_WIDTH + hlbgcoord 0, 10 ld de, wVermilionDockTileMapBuffer ld bc, (6 * BG_MAP_WIDTH) / 16 call CopyVideoData @@ -194,7 +194,7 @@ VermilionDock_EraseSSAnne: ; the blocks is unnecessary because the blocks the ship occupies are south of ; the player and won't be redrawn when the player automatically walks north and ; exits the map. This code could be removed without affecting anything. - overworldMapCoord hl, 5, 2, VERMILION_DOCK_WIDTH + hlowcoord 5, 2, VERMILION_DOCK_WIDTH ld a, $d ; water block ld [hli], a ld [hli], a -- cgit v1.3.1-sl0p From 4a7d1513f3135a3c926233d47921b21bf8b1fab4 Mon Sep 17 00:00:00 2001 From: Rangi Date: Tue, 7 Jul 2020 15:09:54 -0400 Subject: Use 'tile' and 'tiles' macros --- data/icon_pointers.asm | 175 +++++------------------- engine/battle/animations.asm | 3 +- engine/battle/battle_transitions.asm | 8 +- engine/battle/core.asm | 8 +- engine/battle/draw_hud_pokeball_gfx.asm | 2 +- engine/events/diploma.asm | 2 +- engine/events/hidden_objects/museum_fossils.asm | 2 +- engine/gfx/load_pokedex_tiles.asm | 6 +- engine/gfx/mon_icons.asm | 4 +- engine/items/town_map.asm | 12 +- engine/link/cable_club.asm | 2 +- engine/menus/naming_screen.asm | 2 +- engine/menus/start_sub_menus.asm | 34 ++--- engine/movie/credits.asm | 14 +- engine/movie/gamefreak.asm | 14 +- engine/movie/title.asm | 18 +-- engine/movie/trade.asm | 4 +- engine/overworld/cut.asm | 24 ++-- engine/overworld/dust_smoke.asm | 6 +- engine/overworld/emotion_bubbles.asm | 4 +- engine/overworld/healing_machine.asm | 4 +- engine/overworld/ledges.asm | 2 +- engine/overworld/map_sprites.asm | 8 +- engine/overworld/player_animations.asm | 36 +++-- engine/pokemon/bills_pc.asm | 4 +- engine/pokemon/status_screen.asm | 24 ++-- engine/slots/slot_machine.asm | 9 +- home.asm | 8 +- home/vcopy.asm | 4 +- scripts/RocketHideoutB2F.asm | 48 +++---- 30 files changed, 188 insertions(+), 303 deletions(-) (limited to 'engine/battle') diff --git a/data/icon_pointers.asm b/data/icon_pointers.asm index b615798e..585a0a29 100644 --- a/data/icon_pointers.asm +++ b/data/icon_pointers.asm @@ -1,140 +1,37 @@ -MonPartySpritePointers: - dw SlowbroSprite + $c0 - db $40 / $10 ; 40 bytes - db BANK(SlowbroSprite) - dw vSprites - - dw BallSprite - db $80 / $10 ; $80 bytes - db BANK(BallSprite) - dw vSprites + $40 - - dw ClefairySprite + $c0 - db $40 / $10 ; $40 bytes - db BANK(ClefairySprite) - dw vSprites + $c0 - - dw BirdSprite + $c0 - db $40 / $10 ; $40 bytes - db BANK(BirdSprite) - dw vSprites + $100 - - dw SeelSprite - db $40 / $10 ; $40 bytes - db BANK(SeelSprite) - dw vSprites + $140 - - dw BugIconFrame2 - db $10 / $10 ; $10 bytes - db BANK(BugIconFrame2) - dw vSprites + $180 - - dw BugIconFrame2 + $10 - db $10 / $10 ; $10 bytes - db BANK(BugIconFrame2) - dw vSprites + $1a0 - - dw PlantIconFrame2 - db $10 / $10 ; $10 bytes - db BANK(PlantIconFrame2) - dw vSprites + $1c0 - - dw PlantIconFrame2 + $10 - db $10 / $10 ; $10 bytes - db BANK(PlantIconFrame2) - dw vSprites + $1e0 - - dw SnakeIconFrame1 - db $10 / $10 ; $10 bytes - db BANK(SnakeIconFrame1) - dw vSprites + $200 - - dw SnakeIconFrame1 + $10 - db $10 / $10 ; $10 bytes - db BANK(SnakeIconFrame1) - dw vSprites + $220 - - dw QuadrupedIconFrame1 - db $10 / $10 ; $10 bytes - db BANK(QuadrupedIconFrame1) - dw vSprites + $240 - - dw QuadrupedIconFrame1 + $10 - db $10 / $10 ; $10 bytes - db BANK(QuadrupedIconFrame1) - dw vSprites + $260 - - dw TradeBubbleIconGFX - db $40 / $10 ; $40 bytes - db BANK(TradeBubbleIconGFX) - dw vSprites + $380 +mon_icon_header: MACRO + dw \1 tile \2 + db \3 + db BANK(\1) + dw vSprites tile \4 +ENDM - dw SlowbroSprite - db $40 / $10 ; $40 bytes - db BANK(SlowbroSprite) - dw vSprites + $400 - - dw BallSprite - db $80 / $10 ; $80 bytes - db BANK(BallSprite) - dw vSprites + $440 - - dw ClefairySprite - db $40 / $10 ; $40 bytes - db BANK(ClefairySprite) - dw vSprites + $4c0 - - dw BirdSprite - db $40 / $10 ; $40 bytes - db BANK(BirdSprite) - dw vSprites + $500 - - dw SeelSprite + $C0 - db $40 / $10 ; $40 bytes - db BANK(SeelSprite) - dw vSprites + $540 - - dw BugIconFrame1 - db $10 / $10 ; $10 bytes - db BANK(BugIconFrame1) - dw vSprites + $580 - - dw BugIconFrame1 + $10 - db $10 / $10 ; $10 bytes - db BANK(BugIconFrame1) - dw vSprites + $5a0 - - dw PlantIconFrame1 - db $10 / $10 ; $10 bytes - db BANK(PlantIconFrame1) - dw vSprites + $5c0 - - dw PlantIconFrame1 + $10 - db $10 / $10 ; $10 bytes - db BANK(PlantIconFrame1) - dw vSprites + $5E0 - - dw SnakeIconFrame2 - db $10 / $10 ; $10 bytes - db BANK(SnakeIconFrame2) - dw vSprites + $600 - - dw SnakeIconFrame2 + $10 - db $10 / $10 ; $10 bytes - db BANK(SnakeIconFrame2) - dw vSprites + $620 - - dw QuadrupedIconFrame2 - db $10 / $10 ; $10 bytes - db BANK(QuadrupedIconFrame2) - dw vSprites + $640 - - dw QuadrupedIconFrame2 + $10 - db $10 / $10 ; $10 bytes - db BANK(QuadrupedIconFrame2) - dw vSprites + $660 - - dw TradeBubbleIconGFX + $40 - db $40 / $10 ; $40 bytes - db BANK(TradeBubbleIconGFX) - dw vSprites + $780 +MonPartySpritePointers: +; gfx pointer, gfx tile offset, # tiles, vSprites tile offset + mon_icon_header SlowbroSprite, 12, 4, $00 + mon_icon_header BallSprite, 0, 8, $04 + mon_icon_header ClefairySprite, 12, 4, $0c + mon_icon_header BirdSprite, 12, 4, $10 + mon_icon_header SeelSprite, 0, 4, $14 + mon_icon_header BugIconFrame2, 0, 1, $18 + mon_icon_header BugIconFrame2, 1, 1, $1a + mon_icon_header PlantIconFrame2, 0, 1, $1c + mon_icon_header PlantIconFrame2, 1, 1, $1e + mon_icon_header SnakeIconFrame1, 0, 1, $20 + mon_icon_header SnakeIconFrame1, 1, 1, $22 + mon_icon_header QuadrupedIconFrame1, 0, 1, $24 + mon_icon_header QuadrupedIconFrame1, 1, 1, $26 + mon_icon_header TradeBubbleIconGFX, 0, 4, $38 + mon_icon_header SlowbroSprite, 0, 4, $40 + mon_icon_header BallSprite, 0, 8, $44 + mon_icon_header ClefairySprite, 0, 4, $4c + mon_icon_header BirdSprite, 0, 4, $50 + mon_icon_header SeelSprite, 12, 4, $54 + mon_icon_header BugIconFrame1, 0, 1, $58 + mon_icon_header BugIconFrame1, 1, 1, $5a + mon_icon_header PlantIconFrame1, 0, 1, $5c + mon_icon_header PlantIconFrame1, 1, 1, $5e + mon_icon_header SnakeIconFrame2, 0, 1, $60 + mon_icon_header SnakeIconFrame2, 1, 1, $62 + mon_icon_header QuadrupedIconFrame2, 0, 1, $64 + mon_icon_header QuadrupedIconFrame2, 1, 1, $66 + mon_icon_header TradeBubbleIconGFX, 4, 4, $78 diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index 9f7b728a..4e836510 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -341,7 +341,7 @@ LoadAnimationTileset: ld e, a ld a, [hl] ld d, a ; de = address of tileset - ld hl, vSprites + $310 + ld hl, vSprites tile $31 ld b, BANK(AnimationTileset1) ; ROM bank ld a, [wTempTilesetNumTiles] ld c, a ; number of tiles @@ -373,6 +373,7 @@ ENDC IF DEF(_BLUE) INCBIN "gfx/slots/blue_slots_2.2bpp" ENDC +SlotMachineTiles2End: MoveAnimation: push hl diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index e563855d..34b3fbdb 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -154,14 +154,12 @@ GetBattleTransitionID_IsDungeonMap: INCLUDE "data/maps/dungeon_maps.asm" LoadBattleTransitionTile: - ld hl, vChars1 + $7f0 + ld hl, vChars1 tile $7f ld de, BattleTransitionTile - lb bc, BANK(BattleTransitionTile), (BattleTransitionTileEnd - BattleTransitionTile) / $10 + lb bc, BANK(BattleTransitionTile), 1 jp CopyVideoData -BattleTransitionTile: - INCBIN "gfx/overworld/battle_transition.2bpp" -BattleTransitionTileEnd: +BattleTransitionTile: INCBIN "gfx/overworld/battle_transition.2bpp" BattleTransition_BlackScreen: ld a, $ff diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 859f30d5..5cf8a45d 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6610,22 +6610,22 @@ LoadHudTilePatterns: jr c, .lcdEnabled .lcdDisabled ld hl, BattleHudTiles1 - ld de, vChars2 + $6d0 + ld de, vChars2 tile $6d ld bc, BattleHudTiles1End - BattleHudTiles1 ld a, BANK(BattleHudTiles1) call FarCopyDataDouble ld hl, BattleHudTiles2 - ld de, vChars2 + $730 + ld de, vChars2 tile $73 ld bc, BattleHudTiles3End - BattleHudTiles2 ld a, BANK(BattleHudTiles2) jp FarCopyDataDouble .lcdEnabled ld de, BattleHudTiles1 - ld hl, vChars2 + $6d0 + ld hl, vChars2 tile $6d lb bc, BANK(BattleHudTiles1), (BattleHudTiles1End - BattleHudTiles1) / $8 call CopyVideoDataDouble ld de, BattleHudTiles2 - ld hl, vChars2 + $730 + ld hl, vChars2 tile $73 lb bc, BANK(BattleHudTiles2), (BattleHudTiles3End - BattleHudTiles2) / $8 jp CopyVideoDataDouble diff --git a/engine/battle/draw_hud_pokeball_gfx.asm b/engine/battle/draw_hud_pokeball_gfx.asm index 8cd9528d..097a0fcc 100644 --- a/engine/battle/draw_hud_pokeball_gfx.asm +++ b/engine/battle/draw_hud_pokeball_gfx.asm @@ -12,7 +12,7 @@ DrawEnemyPokeballs: LoadPartyPokeballGfx: ld de, PokeballTileGraphics - ld hl, vSprites + $310 + ld hl, vSprites tile $31 lb bc, BANK(PokeballTileGraphics), (PokeballTileGraphicsEnd - PokeballTileGraphics) / $10 jp CopyVideoData diff --git a/engine/events/diploma.asm b/engine/events/diploma.asm index 3248e152..c282b49b 100755 --- a/engine/events/diploma.asm +++ b/engine/events/diploma.asm @@ -10,7 +10,7 @@ DisplayDiploma:: set 6, [hl] call DisableLCD ld hl, CircleTile - ld de, vChars2 + CIRCLE_TILE_ID * $10 + ld de, vChars2 tile CIRCLE_TILE_ID ld bc, $10 ld a, BANK(CircleTile) call FarCopyData2 diff --git a/engine/events/hidden_objects/museum_fossils.asm b/engine/events/hidden_objects/museum_fossils.asm index 5d7e08fd..27714981 100644 --- a/engine/events/hidden_objects/museum_fossils.asm +++ b/engine/events/hidden_objects/museum_fossils.asm @@ -38,7 +38,7 @@ DisplayMonFrontSpriteInBox: ld a, [wcf91] ld [wd0b5], a call GetMonHeader - ld de, vChars1 + $310 + ld de, vChars1 tile $31 call LoadMonFrontSprite ld a, $80 ldh [hStartTileID], a diff --git a/engine/gfx/load_pokedex_tiles.asm b/engine/gfx/load_pokedex_tiles.asm index 70bcf04d..a3f69171 100755 --- a/engine/gfx/load_pokedex_tiles.asm +++ b/engine/gfx/load_pokedex_tiles.asm @@ -2,10 +2,10 @@ LoadPokedexTilePatterns: call LoadHpBarAndStatusTilePatterns ld de, PokedexTileGraphics - ld hl, vChars2 + $600 + ld hl, vChars2 tile $60 lb bc, BANK(PokedexTileGraphics), (PokedexTileGraphicsEnd - PokedexTileGraphics) / $10 call CopyVideoData ld de, PokeballTileGraphics - ld hl, vChars2 + $720 - lb bc, BANK(PokeballTileGraphics), $01 + ld hl, vChars2 tile $72 + lb bc, BANK(PokeballTileGraphics), 1 jp CopyVideoData ; load pokeball tile for marking caught mons diff --git a/engine/gfx/mon_icons.asm b/engine/gfx/mon_icons.asm index 253fca35..8dd6fe75 100755 --- a/engine/gfx/mon_icons.asm +++ b/engine/gfx/mon_icons.asm @@ -201,11 +201,11 @@ UnusedPartyMonSpriteFunction: ld a, [wcf91] call GetPartyMonSpriteID push af - ld hl, vSprites + ld hl, vSprites tile $00 call .LoadTilePatterns pop af add $54 - ld hl, vSprites + $40 + ld hl, vSprites tile $04 call .LoadTilePatterns xor a ld [wMonPartySpriteSpecies], a diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm index db066268..83ea81bf 100755 --- a/engine/items/town_map.asm +++ b/engine/items/town_map.asm @@ -18,7 +18,7 @@ DisplayTownMap: ld de, wTileMapBackup ld bc, $10 call CopyData - ld hl, vSprites + $40 + ld hl, vSprites tile $04 ld de, TownMapCursor lb bc, BANK(TownMapCursor), (TownMapCursorEnd - TownMapCursor) / $8 call CopyVideoDataDouble @@ -140,11 +140,11 @@ LoadTownMap_Fly:: call LoadPlayerSpriteGraphics call LoadFontTilePatterns ld de, BirdSprite - ld hl, vSprites + $40 - lb bc, BANK(BirdSprite), $c + ld hl, vSprites tile $04 + lb bc, BANK(BirdSprite), 12 call CopyVideoData ld de, TownMapUpArrow - ld hl, vChars1 + $6d0 + ld hl, vChars1 tile $6d lb bc, BANK(TownMapUpArrow), (TownMapUpArrowEnd - TownMapUpArrow) / $8 call CopyVideoDataDouble call BuildFlyLocationsList @@ -284,12 +284,12 @@ LoadTownMap: call TextBoxBorder call DisableLCD ld hl, WorldMapTileGraphics - ld de, vChars2 + $600 + ld de, vChars2 tile $60 ld bc, WorldMapTileGraphicsEnd - WorldMapTileGraphics ld a, BANK(WorldMapTileGraphics) call FarCopyData2 ld hl, MonNestIcon - ld de, vSprites + $40 + ld de, vSprites tile $04 ld bc, MonNestIconEnd - MonNestIcon ld a, BANK(MonNestIcon) call FarCopyDataDouble diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm index 42d06846..67c0e471 100755 --- a/engine/link/cable_club.asm +++ b/engine/link/cable_club.asm @@ -972,6 +972,6 @@ CableClub_DrawHorizontalLine: LoadTrainerInfoTextBoxTiles: ld de, TrainerInfoTextBoxTileGraphics - ld hl, vChars2 + $760 + ld hl, vChars2 tile $76 lb bc, BANK(TrainerInfoTextBoxTileGraphics), (TrainerInfoTextBoxTileGraphicsEnd - TrainerInfoTextBoxTileGraphics) / $10 jp CopyVideoData diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index a16c9501..8ca2ec9b 100755 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -325,7 +325,7 @@ DisplayNamingScreen: LoadEDTile: ld de, ED_Tile - ld hl, vFont + $700 + ld hl, vFont tile $70 ld bc, (ED_TileEnd - ED_Tile) / $8 ; to fix the graphical bug on poor emulators ;lb bc, BANK(ED_Tile), (ED_TileEnd - ED_Tile) / $8 diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm index 8f1a2d61..a845592f 100755 --- a/engine/menus/start_sub_menus.asm +++ b/engine/menus/start_sub_menus.asm @@ -485,39 +485,39 @@ DrawTrainerInfo: call TrainerInfo_DrawVerticalLine hlcoord 1, 2 call TrainerInfo_DrawVerticalLine - ld hl, vChars2 + $70 - ld de, vChars2 - ld bc, $70 * 4 + ld hl, vChars2 tile $07 + ld de, vChars2 tile $00 + ld bc, $1c tiles call CopyData ld hl, TrainerInfoTextBoxTileGraphics ; trainer info text box tile patterns - ld de, vChars2 + $770 - ld bc, $80 + ld de, vChars2 tile $77 + ld bc, 8 tiles push bc call TrainerInfo_FarCopyData ld hl, BlankLeaderNames - ld de, vChars2 + $600 - ld bc, $170 + ld de, vChars2 tile $60 + ld bc, $17 tiles call TrainerInfo_FarCopyData pop bc ld hl, BadgeNumbersTileGraphics ; badge number tile patterns - ld de, vChars1 + $580 + ld de, vChars1 tile $58 call TrainerInfo_FarCopyData ld hl, GymLeaderFaceAndBadgeTileGraphics ; gym leader face and badge tile patterns - ld de, vChars2 + $200 - ld bc, $400 - ld a, $03 + ld de, vChars2 tile $20 + ld bc, 8 * 8 tiles + ld a, BANK(GymLeaderFaceAndBadgeTileGraphics) call FarCopyData2 ld hl, TextBoxGraphics - ld de, $d0 + ld de, 13 tiles add hl, de ; hl = colon tile pattern - ld de, vChars1 + $560 - ld bc, $10 - ld a, $04 + ld de, vChars1 tile $56 + ld bc, 1 tiles + ld a, BANK(TextBoxGraphics) push bc call FarCopyData2 pop bc - ld hl, TrainerInfoTextBoxTileGraphics + $80 ; background tile pattern - ld de, vChars1 + $570 + ld hl, TrainerInfoTextBoxTileGraphics tile 8 ; background tile pattern + ld de, vChars1 tile $57 call TrainerInfo_FarCopyData call EnableLCD ld hl, wTrainerInfoTextBoxWidthPlus1 diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm index ae35a2b7..6fb0598e 100755 --- a/engine/movie/credits.asm +++ b/engine/movie/credits.asm @@ -5,14 +5,14 @@ HallOfFamePC: call DelayFrames call DisableLCD ld hl, vFont - ld bc, $800 / 2 + ld bc, ($80 tiles) / 2 call ZeroMemory - ld hl, vChars2 + $600 - ld bc, $200 / 2 + ld hl, vChars2 tile $60 + ld bc, ($20 tiles) / 2 call ZeroMemory - ld hl, vChars2 + $7e0 - ld bc, $10 - ld a, $ff + ld hl, vChars2 tile $7e + ld bc, 1 tiles + ld a, $ff ; solid black call FillMemory hlcoord 0, 0 call FillFourRowsWithBlack @@ -245,7 +245,7 @@ Credits: call FillMiddleOfScreenWithWhite pop de ld de, TheEndGfx - ld hl, vChars2 + $600 + ld hl, vChars2 tile $60 lb bc, BANK(TheEndGfx), (TheEndGfxEnd - TheEndGfx) / $10 call CopyVideoData hlcoord 4, 8 diff --git a/engine/movie/gamefreak.asm b/engine/movie/gamefreak.asm index d3b5eb88..1463eb4f 100755 --- a/engine/movie/gamefreak.asm +++ b/engine/movie/gamefreak.asm @@ -3,16 +3,16 @@ LoadShootingStarGraphics: ldh [rOBP0], a ld a, $a4 ldh [rOBP1], a - ld de, AnimationTileset2 + $30 ; star tile (top left quadrant) - ld hl, vChars1 + $200 - lb bc, BANK(AnimationTileset2), $01 + ld de, AnimationTileset2 tile 3 ; star tile (top left quadrant) + ld hl, vChars1 tile $20 + lb bc, BANK(AnimationTileset2), 1 call CopyVideoData - ld de, AnimationTileset2 + $130 ; star tile (bottom left quadrant) - ld hl, vChars1 + $210 - lb bc, BANK(AnimationTileset2), $01 + ld de, AnimationTileset2 tile 19 ; star tile (bottom left quadrant) + ld hl, vChars1 tile $21 + lb bc, BANK(AnimationTileset2), 1 call CopyVideoData ld de, FallingStar - ld hl, vChars1 + $220 + ld hl, vChars1 tile $22 lb bc, BANK(FallingStar), (FallingStarEnd - FallingStar) / $10 call CopyVideoData ld hl, GameFreakLogoOAMData diff --git a/engine/movie/title.asm b/engine/movie/title.asm index 69838afb..bdb24d6a 100755 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -36,27 +36,27 @@ DisplayTitleScreen: call DisableLCD call LoadFontTilePatterns ld hl, NintendoCopyrightLogoGraphics - ld de, vTitleLogo2 + $100 - ld bc, $50 + ld de, vTitleLogo2 tile 16 + ld bc, 5 tiles ld a, BANK(NintendoCopyrightLogoGraphics) call FarCopyData2 ld hl, GamefreakLogoGraphics - ld de, vTitleLogo2 + $100 + $50 - ld bc, $90 + ld de, vTitleLogo2 tile (16 + 5) + ld bc, 9 tiles ld a, BANK(GamefreakLogoGraphics) call FarCopyData2 ld hl, PokemonLogoGraphics ld de, vTitleLogo - ld bc, $600 + ld bc, $60 tiles ld a, BANK(PokemonLogoGraphics) call FarCopyData2 ; first chunk - ld hl, PokemonLogoGraphics+$600 + ld hl, PokemonLogoGraphics tile $60 ld de, vTitleLogo2 - ld bc, $100 + ld bc, $10 tiles ld a, BANK(PokemonLogoGraphics) call FarCopyData2 ; second chunk ld hl, Version_GFX - ld de, vChars2 + $600 - (Version_GFXEnd - Version_GFX - $50) + ld de, vChars2 tile $60 + (10 tiles - (Version_GFXEnd - Version_GFX) * 2) / 2 ld bc, Version_GFXEnd - Version_GFX ld a, BANK(Version_GFX) call FarCopyDataDouble @@ -369,7 +369,7 @@ LoadCopyrightAndTextBoxTiles: LoadCopyrightTiles: ld de, NintendoCopyrightLogoGraphics - ld hl, vChars2 + $600 + ld hl, vChars2 tile $60 lb bc, BANK(NintendoCopyrightLogoGraphics), (GamefreakLogoGraphicsEnd - NintendoCopyrightLogoGraphics) / $10 call CopyVideoData hlcoord 2, 7 diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm index 3883c362..fc2da9bd 100755 --- a/engine/movie/trade.asm +++ b/engine/movie/trade.asm @@ -157,12 +157,12 @@ LoadTradingGFXAndMonNames: call Trade_ClearTileMap call DisableLCD ld hl, TradingAnimationGraphics - ld de, vChars2 + $310 + ld de, vChars2 tile $31 ld bc, TradingAnimationGraphicsEnd - TradingAnimationGraphics ld a, BANK(TradingAnimationGraphics) call FarCopyData2 ld hl, TradingAnimationGraphics2 - ld de, vSprites + $7c0 + ld de, vSprites tile $7c ld bc, TradingAnimationGraphics2End - TradingAnimationGraphics2 ld a, BANK(TradingAnimationGraphics2) call FarCopyData2 diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index 97842079..07039e03 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -80,23 +80,23 @@ InitCutAnimOAM: cp $52 jr z, .grass ; tree - ld de, Overworld_GFX + $2d0 ; cuttable tree sprite top row - ld hl, vChars1 + $7c0 - lb bc, BANK(Overworld_GFX), $02 + ld de, Overworld_GFX tile $2d ; cuttable tree sprite top row + ld hl, vChars1 tile $7c + lb bc, BANK(Overworld_GFX), 2 call CopyVideoData - ld de, Overworld_GFX + $3d0 ; cuttable tree sprite bottom row - ld hl, vChars1 + $7e0 - lb bc, BANK(Overworld_GFX), $02 + ld de, Overworld_GFX tile $3d ; cuttable tree sprite bottom row + ld hl, vChars1 tile $7e + lb bc, BANK(Overworld_GFX), 2 call CopyVideoData jr WriteCutOrBoulderDustAnimationOAMBlock .grass - ld hl, vChars1 + $7c0 + ld hl, vChars1 tile $7c call LoadCutGrassAnimationTilePattern - ld hl, vChars1 + $7d0 + ld hl, vChars1 tile $7d call LoadCutGrassAnimationTilePattern - ld hl, vChars1 + $7e0 + ld hl, vChars1 tile $7e call LoadCutGrassAnimationTilePattern - ld hl, vChars1 + $7f0 + ld hl, vChars1 tile $7f call LoadCutGrassAnimationTilePattern call WriteCutOrBoulderDustAnimationOAMBlock ld hl, wOAMBuffer + $93 @@ -112,8 +112,8 @@ InitCutAnimOAM: ret LoadCutGrassAnimationTilePattern: - ld de, AnimationTileset2 + $60 ; tile depicting a leaf - lb bc, BANK(AnimationTileset2), $01 + ld de, AnimationTileset2 tile 6 ; tile depicting a leaf + lb bc, BANK(AnimationTileset2), 1 jp CopyVideoData WriteCutOrBoulderDustAnimationOAMBlock: diff --git a/engine/overworld/dust_smoke.asm b/engine/overworld/dust_smoke.asm index 09a71a18..a20a0591 100755 --- a/engine/overworld/dust_smoke.asm +++ b/engine/overworld/dust_smoke.asm @@ -69,14 +69,14 @@ MoveBoulderDustFunctionPointerTable: dw AdjustOAMBlockXPos LoadSmokeTileFourTimes:: - ld hl, vChars1 + $7c0 - ld c, $4 + ld hl, vChars1 tile $7c + ld c, 4 .loop push bc push hl call LoadSmokeTile pop hl - ld bc, $10 + ld bc, 1 tiles add hl, bc pop bc dec c diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm index 1ac07b80..298858a2 100755 --- a/engine/overworld/emotion_bubbles.asm +++ b/engine/overworld/emotion_bubbles.asm @@ -8,8 +8,8 @@ EmotionBubble: ld e, [hl] inc hl ld d, [hl] - ld hl, vChars1 + $780 - lb bc, BANK(EmotionBubbles), $04 + ld hl, vChars1 tile $78 + lb bc, BANK(EmotionBubbles), 4 call CopyVideoData ld a, [wUpdateSpritesEnabled] push af diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm index 062ef7ea..eaa396d0 100755 --- a/engine/overworld/healing_machine.asm +++ b/engine/overworld/healing_machine.asm @@ -1,7 +1,7 @@ AnimateHealingMachine: ld de, PokeCenterFlashingMonitorAndHealBall - ld hl, vChars0 + $7c0 - lb bc, BANK(PokeCenterFlashingMonitorAndHealBall), $03 ; loads one too many tiles + ld hl, vChars0 tile $7c + lb bc, BANK(PokeCenterFlashingMonitorAndHealBall), 3 ; should be 2 call CopyVideoData ld hl, wUpdateSpritesEnabled ld a, [hl] diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm index 254680a5..0e006c5e 100755 --- a/engine/overworld/ledges.asm +++ b/engine/overworld/ledges.asm @@ -57,7 +57,7 @@ HandleLedges:: INCLUDE "data/tilesets/ledge_tiles.asm" LoadHoppingShadowOAM: - ld hl, vChars1 + $7f0 + ld hl, vChars1 tile $7f ld de, LedgeHoppingShadow lb bc, BANK(LedgeHoppingShadow), (LedgeHoppingShadowEnd - LedgeHoppingShadow) / $8 call CopyVideoDataDouble diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm index 4a68169a..8f1f3931 100755 --- a/engine/overworld/map_sprites.asm +++ b/engine/overworld/map_sprites.asm @@ -130,25 +130,25 @@ LoadMapSpriteTilePatterns: push de push bc ld hl, vNPCSprites ; VRAM base address - ld bc, $c0 ; number of bytes per VRAM slot + ld bc, 12 tiles ; number of bytes per VRAM slot ldh a, [hVRAMSlot] cp 11 ; is it a 4-tile sprite? jr nc, .fourTileSpriteVRAMAddr ld d, a dec d -; hl = vSprites + [hVRAMSlot] * $C0 (the number of bytes in 12 tiles) +; hl = vSprites + [hVRAMSlot] * 12 tiles .calculateVRAMAddrLoop add hl, bc dec d jr nz, .calculateVRAMAddrLoop jr .loadStillTilePattern .fourTileSpriteVRAMAddr - ld hl, vSprites + $7c0 ; address for second 4-tile sprite + ld hl, vSprites tile $7c ; address for second 4-tile sprite ldh a, [hFourTileSpriteCount] and a jr nz, .loadStillTilePattern ; if it's the first 4-tile sprite - ld hl, vSprites + $780 ; address for first 4-tile sprite + ld hl, vSprites tile $78 ; address for first 4-tile sprite inc a ldh [hFourTileSpriteCount], a .loadStillTilePattern diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index 69c1eefc..9e9b4073 100755 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -250,11 +250,11 @@ DoFlyAnimation: LoadBirdSpriteGraphics: ld de, BirdSprite ld hl, vNPCSprites - lb bc, BANK(BirdSprite), $0c + lb bc, BANK(BirdSprite), 12 call CopyVideoData - ld de, BirdSprite + $c0 ; moving animation sprite + ld de, BirdSprite tile 12 ; moving animation sprite ld hl, vNPCSprites2 - lb bc, BANK(BirdSprite), $0c + lb bc, BANK(BirdSprite), 12 jp CopyVideoData InitFacingDirectionList: @@ -381,8 +381,8 @@ FishingAnim: ld hl, wd736 set 6, [hl] ; reserve the last 4 OAM entries ld de, RedSprite - ld hl, vNPCSprites - lb bc, BANK(RedSprite), $c + ld hl, vNPCSprites tile $00 + lb bc, BANK(RedSprite), 12 call CopyVideoData ld a, $4 ld hl, RedFishingTiles @@ -479,22 +479,18 @@ FishingRodOAM: db $50, $40, $FE, $00 ; player facing left db $50, $58, $FE, $20 ; player facing right ($20 means "horizontally flip the tile") -RedFishingTiles: - dw RedFishingTilesFront - db 2, BANK(RedFishingTilesFront) - dw vNPCSprites + $20 +fishing_gfx: MACRO + dw \1 + db \2 + db BANK(\1) + dw vNPCSprites tile \3 +ENDM - dw RedFishingTilesBack - db 2, BANK(RedFishingTilesBack) - dw vNPCSprites + $60 - - dw RedFishingTilesSide - db 2, BANK(RedFishingTilesSide) - dw vNPCSprites + $a0 - - dw RedFishingRodTiles - db 3, BANK(RedFishingRodTiles) - dw vNPCSprites2 + $7d0 +RedFishingTiles: + fishing_gfx RedFishingTilesFront, 2, $02 + fishing_gfx RedFishingTilesBack, 2, $06 + fishing_gfx RedFishingTilesSide, 2, $0a + fishing_gfx RedFishingRodTiles, 3, $fd _HandleMidJump:: ld a, [wPlayerJumpingYScreenCoordsIndex] diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index 0b514111..df02a496 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -114,9 +114,9 @@ BillsPC_:: BillsPCMenu: ld a, [wParentMenuItem] ld [wCurrentMenuItem], a - ld hl, vChars2 + $780 + ld hl, vChars2 tile $78 ld de, PokeballTileGraphics - lb bc, BANK(PokeballTileGraphics), $01 + lb bc, BANK(PokeballTileGraphics), 1 call CopyVideoData call LoadScreenTilesFromBuffer2DisableBGTransfer hlcoord 0, 0 diff --git a/engine/pokemon/status_screen.asm b/engine/pokemon/status_screen.asm index 83d33fe5..d4a4e59a 100755 --- a/engine/pokemon/status_screen.asm +++ b/engine/pokemon/status_screen.asm @@ -86,21 +86,21 @@ StatusScreen: call UpdateSprites call LoadHpBarAndStatusTilePatterns ld de, BattleHudTiles1 ; source - ld hl, vChars2 + $6d0 ; dest - lb bc, BANK(BattleHudTiles1), $03 + ld hl, vChars2 tile $6d ; dest + lb bc, BANK(BattleHudTiles1), 3 call CopyVideoDataDouble ; ·│ :L and halfarrow line end ld de, BattleHudTiles2 - ld hl, vChars2 + $780 - lb bc, BANK(BattleHudTiles2), $01 + ld hl, vChars2 tile $78 + lb bc, BANK(BattleHudTiles2), 1 call CopyVideoDataDouble ; │ ld de, BattleHudTiles3 - ld hl, vChars2 + $760 - lb bc, BANK(BattleHudTiles3), $02 - call CopyVideoDataDouble ; ─┘ + ld hl, vChars2 tile $76 + lb bc, BANK(BattleHudTiles3), 2 + call CopyVideoDataDouble ; ─ ┘ ld de, PTile - ld hl, vChars2 + $720 - lb bc, BANK(PTile), (PTileEnd - PTile) / $8 - call CopyVideoDataDouble ; P (for PP), inline + ld hl, vChars2 tile $72 + lb bc, BANK(PTile), 1 + call CopyVideoDataDouble ; bold P (for PP) ldh a, [hTilesetType] push af xor a @@ -244,9 +244,7 @@ DrawLineBox: ld [hl], $6f ; ← (halfarrow ending) ret -PTile: - INCBIN "gfx/font/P.1bpp" -PTileEnd: +PTile: INCBIN "gfx/font/P.1bpp" PrintStatsBox: ld a, d diff --git a/engine/slots/slot_machine.asm b/engine/slots/slot_machine.asm index a1326240..9af17a81 100755 --- a/engine/slots/slot_machine.asm +++ b/engine/slots/slot_machine.asm @@ -850,17 +850,17 @@ LoadSlotMachineTiles: call DisableLCD ld hl, SlotMachineTiles2 ld de, vChars0 - ld bc, $1c0 + ld bc, $1c tiles ; should be SlotMachineTiles2End - SlotMachineTiles2, or $18 tiles ld a, BANK(SlotMachineTiles2) call FarCopyData2 ld hl, SlotMachineTiles1 ld de, vChars2 - ld bc, $250 + ld bc, SlotMachineTiles1End - SlotMachineTiles1 ld a, BANK(SlotMachineTiles1) call FarCopyData2 ld hl, SlotMachineTiles2 - ld de, vChars2 + $250 - ld bc, $1c0 + ld de, vChars2 tile $25 + ld bc, $1c tiles ; should be SlotMachineTiles2End - SlotMachineTiles2, or $18 tiles ld a, BANK(SlotMachineTiles2) call FarCopyData2 ld hl, SlotMachineMap @@ -890,3 +890,4 @@ ENDC IF DEF(_BLUE) INCBIN "gfx/slots/blue_slots_1.2bpp" ENDC +SlotMachineTiles1End: diff --git a/home.asm b/home.asm index 037a3444..6735e23c 100644 --- a/home.asm +++ b/home.asm @@ -820,13 +820,13 @@ LoadTextBoxTilePatterns:: jr nz, .on .off ld hl, TextBoxGraphics - ld de, vChars2 + $600 + ld de, vChars2 tile $60 ld bc, TextBoxGraphicsEnd - TextBoxGraphics ld a, BANK(TextBoxGraphics) jp FarCopyData2 ; if LCD is off, transfer all at once .on ld de, TextBoxGraphics - ld hl, vChars2 + $600 + ld hl, vChars2 tile $60 lb bc, BANK(TextBoxGraphics), (TextBoxGraphicsEnd - TextBoxGraphics) / $10 jp CopyVideoData ; if LCD is on, transfer during V-blank @@ -836,13 +836,13 @@ LoadHpBarAndStatusTilePatterns:: jr nz, .on .off ld hl, HpBarAndStatusGraphics - ld de, vChars2 + $620 + ld de, vChars2 tile $62 ld bc, HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics ld a, BANK(HpBarAndStatusGraphics) jp FarCopyData2 ; if LCD is off, transfer all at once .on ld de, HpBarAndStatusGraphics - ld hl, vChars2 + $620 + ld hl, vChars2 tile $62 lb bc, BANK(HpBarAndStatusGraphics), (HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics) / $10 jp CopyVideoData ; if LCD is on, transfer during V-blank diff --git a/home/vcopy.asm b/home/vcopy.asm index 1a7863e9..458fa610 100644 --- a/home/vcopy.asm +++ b/home/vcopy.asm @@ -393,7 +393,7 @@ UpdateMovingBgTiles:: ; water - ld hl, vTileset + $14 * $10 + ld hl, vTileset tile $14 ld c, $10 ld a, [wMovingBGTilesCounter2] @@ -438,7 +438,7 @@ UpdateMovingBgTiles:: jr z, .copy ld hl, FlowerTile3 .copy - ld de, vTileset + $3 * $10 + ld de, vTileset tile $03 ld c, $10 .loop ld a, [hli] diff --git a/scripts/RocketHideoutB2F.asm b/scripts/RocketHideoutB2F.asm index 95d8b0d2..47c0581c 100755 --- a/scripts/RocketHideoutB2F.asm +++ b/scripts/RocketHideoutB2F.asm @@ -367,38 +367,32 @@ LoadSpinnerArrowTiles:: spinner: MACRO ; \1: source ; \2: offset (BANK() chokes on literals) -; \3: length -; \4: dest - dw \1 + \2 - db \3, BANK(\1) - dw \4 +; \3: dest + dw \1 tile \2 + db 1 + db BANK(\1) + dw vTileset tile \3 ENDM FacilitySpinnerArrows: -FACILITY_SPINNER EQU $20 * $10 -vFacilitySpinner EQUS "vTileset + FACILITY_SPINNER" - - spinner SpinnerArrowAnimTiles, $00, 1, vFacilitySpinner - spinner SpinnerArrowAnimTiles, $10, 1, vFacilitySpinner + $10 - spinner SpinnerArrowAnimTiles, $20, 1, vFacilitySpinner + $100 - spinner SpinnerArrowAnimTiles, $30, 1, vFacilitySpinner + $110 - spinner Facility_GFX, FACILITY_SPINNER + $000, 1, vFacilitySpinner - spinner Facility_GFX, FACILITY_SPINNER + $010, 1, vFacilitySpinner + $10 - spinner Facility_GFX, FACILITY_SPINNER + $100, 1, vFacilitySpinner + $100 - spinner Facility_GFX, FACILITY_SPINNER + $110, 1, vFacilitySpinner + $110 + spinner SpinnerArrowAnimTiles, 0, $20 + spinner SpinnerArrowAnimTiles, 1, $21 + spinner SpinnerArrowAnimTiles, 2, $30 + spinner SpinnerArrowAnimTiles, 3, $31 + spinner Facility_GFX, $20, $20 + spinner Facility_GFX, $21, $21 + spinner Facility_GFX, $30, $30 + spinner Facility_GFX, $31, $31 GymSpinnerArrows: -GYM_SPINNER EQU $3c * $10 -vGymSpinner EQUS "vTileset + GYM_SPINNER" - - spinner SpinnerArrowAnimTiles, $10, 1, vGymSpinner - spinner SpinnerArrowAnimTiles, $30, 1, vGymSpinner + $10 - spinner SpinnerArrowAnimTiles, $00, 1, vGymSpinner + $100 - spinner SpinnerArrowAnimTiles, $20, 1, vGymSpinner + $110 - spinner Gym_GFX, GYM_SPINNER + $000, 1, vGymSpinner - spinner Gym_GFX, GYM_SPINNER + $010, 1, vGymSpinner + $10 - spinner Gym_GFX, GYM_SPINNER + $100, 1, vGymSpinner + $100 - spinner Gym_GFX, GYM_SPINNER + $110, 1, vGymSpinner + $110 + spinner SpinnerArrowAnimTiles, 1, $3c + spinner SpinnerArrowAnimTiles, 3, $3d + spinner SpinnerArrowAnimTiles, 0, $4c + spinner SpinnerArrowAnimTiles, 2, $4d + spinner Gym_GFX, $3c, $3c + spinner Gym_GFX, $3d, $3d + spinner Gym_GFX, $4c, $4c + spinner Gym_GFX, $4d, $4d SpinnerPlayerFacingDirections: ; This isn't the order of the facing directions. Rather, it's a list of -- cgit v1.3.1-sl0p