Skip to content

Commit

Permalink
jpab/jpba macros
Browse files Browse the repository at this point in the history
  • Loading branch information
YamaArashi committed Jul 19, 2015
1 parent 64b4cf6 commit 02bd91b
Show file tree
Hide file tree
Showing 22 changed files with 66 additions and 162 deletions.
76 changes: 19 additions & 57 deletions engine/battle/core.asm
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: ; 3c04c (f:404c)
ld b, $1
call GoPAL_SET
call HideSprites
ld hl, PrintBeginningBattleText
ld b, BANK(PrintBeginningBattleText)
jp Bankswitch
jpab 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
Expand Down Expand Up @@ -359,9 +357,7 @@ EnemyRan: ; 3c202 (f:4202)
call PlaySoundWaitForCurrent
xor a
ld [H_WHOSETURN], a
ld hl, AnimationSlideEnemyMonOut
ld b, BANK(AnimationSlideEnemyMonOut)
jp Bankswitch
jpab AnimationSlideEnemyMonOut

WildRanText: ; 3c229 (f:4229)
TX_FAR _WildRanText
Expand Down Expand Up @@ -938,9 +934,7 @@ FaintEnemyPokemon: ; 0x3c567
jr nz, .gainExpFlagsLoop
ld a, b
ld [wPartyGainExpFlags], a
ld hl, GainExperience
ld b, BANK(GainExperience)
jp Bankswitch
jpab GainExperience

EnemyMonFaintedText: ; 0x3c63e
TX_FAR _EnemyMonFaintedText
Expand Down Expand Up @@ -6462,14 +6456,10 @@ LoadPlayerBackPic: ; 3ec92 (f:6c92)
; does nothing since no stats are ever selected (barring glitches)
DoubleOrHalveSelectedStats: ; 3ed02 (f:6d02)
callab DoubleSelectedStats
ld hl, HalveSelectedStats
ld b, BANK(HalveSelectedStats)
jp Bankswitch
jpab HalveSelectedStats

ScrollTrainerPicAfterBattle: ; 3ed12 (f:6d12)
ld hl, _ScrollTrainerPicAfterBattle
ld b, BANK(_ScrollTrainerPicAfterBattle)
jp Bankswitch
jpab _ScrollTrainerPicAfterBattle

ApplyBurnAndParalysisPenaltiesToPlayer: ; 3ed1a (f:6d1a)
ld a, $1
Expand Down Expand Up @@ -7372,9 +7362,7 @@ BadlyPoisonedText: ; 3f2e4 (f:72e4)
db "@"

DrainHPEffect: ; 3f2e9 (f:72e9)
ld hl, DrainHPEffect_
ld b, BANK(DrainHPEffect_)
jp Bankswitch
jpab DrainHPEffect_

ExplodeEffect: ; 3f2f1 (f:72f1)
ld hl, wBattleMonHP
Expand Down Expand Up @@ -8209,9 +8197,7 @@ FlinchSideEffect: ; 3f85b (f:785b)
ret

OneHitKOEffect: ; 3f884 (f:7884)
ld hl, OneHitKOEffect_
ld b, BANK(OneHitKOEffect_)
jp Bankswitch
jpab OneHitKOEffect_

ChargeEffect: ; 3f88c (f:788c)
ld hl, W_PLAYERBATTSTATUS1
Expand Down Expand Up @@ -8321,19 +8307,13 @@ TrappingEffect: ; 3f917 (f:7917)
ret

MistEffect: ; 3f941 (f:7941)
ld hl, MistEffect_
ld b, BANK(MistEffect_)
jp Bankswitch
jpab MistEffect_

FocusEnergyEffect: ; 3f949 (f:7949)
ld hl, FocusEnergyEffect_
ld b, BANK(FocusEnergyEffect_)
jp Bankswitch
jpab FocusEnergyEffect_

RecoilEffect: ; 3f951 (f:7951)
ld hl, RecoilEffect_
ld b, BANK(RecoilEffect_)
jp Bankswitch
jpab RecoilEffect_

ConfusionSideEffect: ; 3f959 (f:7959)
call BattleRandom
Expand Down Expand Up @@ -8387,14 +8367,10 @@ ConfusionEffectFailed: ; 3f9a6 (f:79a6)
jp ConditionalPrintButItFailed

ParalyzeEffect: ; 3f9b1 (f:79b1)
ld hl, ParalyzeEffect_
ld b, BANK(ParalyzeEffect_)
jp Bankswitch
jpab ParalyzeEffect_

SubstituteEffect: ; 3f9b9 (f:79b9)
ld hl, SubstituteEffect_
ld b, BANK(SubstituteEffect_)
jp Bankswitch
jpab SubstituteEffect_

HyperBeamEffect: ; 3f9c1 (f:79c1)
ld hl, W_PLAYERBATTSTATUS2
Expand Down Expand Up @@ -8505,9 +8481,7 @@ MimicLearnedMoveText: ; 3fa77 (f:7a77)
db "@"

LeechSeedEffect: ; 3fa7c (f:7a7c)
ld hl, LeechSeedEffect_
ld b, BANK(LeechSeedEffect_)
jp Bankswitch
jpab LeechSeedEffect_

SplashEffect: ; 3fa84 (f:7a84)
call PlayCurrentMoveAnimation
Expand Down Expand Up @@ -8601,34 +8575,22 @@ MoveWasDisabledText: ; 3fb09 (f:7b09)
db "@"

PayDayEffect: ; 3fb0e (f:7b0e)
ld hl, PayDayEffect_
ld b, BANK(PayDayEffect_)
jp Bankswitch
jpab PayDayEffect_

ConversionEffect: ; 3fb16 (f:7b16)
ld hl, ConversionEffect_
ld b, BANK(ConversionEffect_)
jp Bankswitch
jpab ConversionEffect_

HazeEffect: ; 3fb1e (f:7b1e)
ld hl, HazeEffect_
ld b, BANK(HazeEffect_)
jp Bankswitch
jpab HazeEffect_

HealEffect: ; 3fb26 (f:7b26)
ld hl, HealEffect_
ld b, BANK(HealEffect_)
jp Bankswitch
jpab HealEffect_

TransformEffect: ; 3fb2e (f:7b2e)
ld hl, TransformEffect_
ld b, BANK(TransformEffect_)
jp Bankswitch
jpab TransformEffect_

ReflectLightScreenEffect: ; 3fb36 (f:7b36)
ld hl, ReflectLightScreenEffect_
ld b, BANK(ReflectLightScreenEffect_)
jp Bankswitch
jpab ReflectLightScreenEffect_

NothingHappenedText: ; 3fb3e (f:7b3e)
TX_FAR _NothingHappenedText
Expand Down
4 changes: 1 addition & 3 deletions engine/battle/init_battle_variables.asm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,4 @@ InitBattleVariables: ; 525af (14:65af)
ld a, $2 ; safari battle
ld [W_BATTLETYPE], a
.notSafariBattle
ld hl, PlayBattleMusic
ld b, BANK(PlayBattleMusic)
jp Bankswitch
jpab PlayBattleMusic
4 changes: 1 addition & 3 deletions engine/battle/moveEffects/focus_energy_effect.asm
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ FocusEnergyEffect_: ; 27f86 (9:7f86)
.alreadyUsing
ld c, 50
call DelayFrames
ld hl, PrintButItFailedText_
ld b, BANK(PrintButItFailedText_)
jp Bankswitch
jpab PrintButItFailedText_

GettingPumpedText: ; 27fb3 (9:7fb3)
db $0a
Expand Down
4 changes: 1 addition & 3 deletions engine/battle/moveEffects/mist_effect.asm
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ MistEffect_: ; 33f2b (c:7f2b)
ld hl, ShroudedInMistText
jp PrintText
.mistAlreadyInUse
ld hl, PrintButItFailedText_
ld b, BANK(PrintButItFailedText_)
jp Bankswitch
jpab PrintButItFailedText_

ShroudedInMistText: ; 33f52 (c:7f52)
TX_FAR _ShroudedInMistText
Expand Down
12 changes: 3 additions & 9 deletions engine/battle/moveEffects/paralyze_effect.asm
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,12 @@ ParalyzeEffect_: ; 52601 (14:6601)
ld c, 30
call DelayFrames
callab PlayCurrentMoveAnimation
ld hl, PrintMayNotAttackText
ld b, BANK(PrintMayNotAttackText)
jp Bankswitch
jpab PrintMayNotAttackText
.didntAffect
ld c, 50
call DelayFrames
ld hl, PrintDidntAffectText
ld b, BANK(PrintDidntAffectText)
jp Bankswitch
jpab PrintDidntAffectText
.doesntAffect
ld c, 50
call DelayFrames
ld hl, PrintDoesntAffectText
ld b, BANK(PrintDoesntAffectText)
jp Bankswitch
jpab PrintDoesntAffectText
4 changes: 1 addition & 3 deletions engine/battle/moveEffects/substitute_effect.asm
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ SubstituteEffect_: ; 17dad (5:7dad)
call Bankswitch ; jump to routine depending on animation setting
ld hl, SubstituteText
call PrintText
ld hl, DrawHUDsAndHPBars
ld b, BANK(DrawHUDsAndHPBars)
jp Bankswitch
jpab DrawHUDsAndHPBars
.alreadyHasSubstitute
ld hl, HasSubstituteText
jr .printText
Expand Down
4 changes: 1 addition & 3 deletions engine/hidden_object_functions3.asm
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ PrintBookshelfText: ; fb50 (3:7b50)
.noMatch
ld a, $ff
ld [$ffdb], a
ld b, BANK(PrintCardKeyText)
ld hl, PrintCardKeyText
jp Bankswitch
jpba PrintCardKeyText

; format: db tileset id, bookshelf tile id, text id
BookshelfTileIDs: ; fb8b (3:7b8b)
Expand Down
4 changes: 1 addition & 3 deletions engine/in_game_trades.asm
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ InGameTrade_RestoreScreen: ; 71ca2 (1c:5ca2)
call LoadGBPal
ld c, 10
call DelayFrames
ld b, BANK(LoadWildData)
ld hl, LoadWildData
jp Bankswitch
jpba LoadWildData

InGameTrade_PrepareTradeData: ; 71cc1 (1c:5cc1)
ld hl, wTradedPlayerMonSpecies
Expand Down
4 changes: 1 addition & 3 deletions engine/items/items.asm
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,7 @@ ItemUseTownMap: ; d968 (3:5968)
ld a,[W_ISINBATTLE]
and a
jp nz,ItemUseNotTime
ld b, BANK(DisplayTownMap)
ld hl, DisplayTownMap
jp Bankswitch ; display Town Map
jpba DisplayTownMap

ItemUseBicycle: ; d977 (3:5977)
ld a,[W_ISINBATTLE]
Expand Down
4 changes: 1 addition & 3 deletions engine/menu/league_pc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ LeaguePCShowMon: ; 76610 (1d:6610)
ld de, wHoFTeamNo
ld bc, $0103
call PrintNumber
ld b, BANK(HoFDisplayMonInfo)
ld hl, HoFDisplayMonInfo
jp Bankswitch
jpba HoFDisplayMonInfo

HallOfFameNoText: ; 76670 (1d:6670)
db "HALL OF FAME No @"
Expand Down
4 changes: 1 addition & 3 deletions engine/menu/naming_screen.asm
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@ DisplayNamingScreen: ; 6596 (1:6596)
ld a, [W_ISINBATTLE]
and a
jp z, LoadTextBoxTilePatterns
ld hl, LoadHudTilePatterns
ld b, BANK(LoadHudTilePatterns)
jp Bankswitch
jpab LoadHudTilePatterns

.namingScreenButtonFunctions
dw .dPadReturnPoint
Expand Down
4 changes: 1 addition & 3 deletions engine/overworld/cable_club_npc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ Func_72a8: ; 72a8 (1:72a8)
xor a
ld [hld], a
ld [hl], a
ld hl, LinkMenu
ld b, BANK(LinkMenu)
jp Bankswitch
jpab LinkMenu

CableClubNPCAreaReservedFor2FriendsLinkedByCableText: ; 72b3 (1:72b3)
TX_FAR _CableClubNPCAreaReservedFor2FriendsLinkedByCableText
Expand Down
4 changes: 1 addition & 3 deletions engine/overworld/saffron_guards.asm
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ RemoveGuardDrink: ; 5a59f (16:659f)
call IsItemInBag
pop hl
jr z, .drinkLoop
ld b, BANK(RemoveItemByID)
ld hl, RemoveItemByID
jp Bankswitch
jpba RemoveItemByID

GuardDrinksList: ; 5a5b7 (16:65b7)
db FRESH_WATER, SODA_POP, LEMONADE, $00
4 changes: 1 addition & 3 deletions engine/titlescreen.asm
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,7 @@ ENDC
jp MainMenu

.doClearSaveDialogue
ld b, BANK(DoClearSaveDialogue)
ld hl, DoClearSaveDialogue
jp Bankswitch
jpba DoClearSaveDialogue

TitleScreenPickNewMon: ; 4496 (1:4496)
ld a, vBGMap0 / $100
Expand Down
4 changes: 1 addition & 3 deletions engine/trade.asm
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,7 @@ LoadTradingGFXAndMonNames: ; 411a1 (10:51a1)
Trade_LoadMonPartySpriteGfx: ; 4120b (10:520b)
ld a, %11010000
ld [rOBP1], a
ld b, BANK(LoadMonPartySpriteGfx)
ld hl, LoadMonPartySpriteGfx
jp Bankswitch
jpba LoadMonPartySpriteGfx

Trade_SwapNames: ; 41217 (10:5217)
ld hl, wPlayerName
Expand Down
Loading

0 comments on commit 02bd91b

Please sign in to comment.