callba/callab -> farcall/callfar; jpba/jpab -> farjp/jpfar

This commit is contained in:
Rangi 2020-07-06 21:18:22 -04:00
parent 77ed5f3820
commit 06db7ec55b
90 changed files with 251 additions and 253 deletions

View file

@ -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

View file

@ -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

View file

@ -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::

View file

@ -225,7 +225,7 @@ Serial_ExchangeLinkMenuSelection::
Serial_PrintWaitingTextAndSyncAndExchangeNybble::
call SaveScreenTilesToBuffer1
callab PrintWaitingText
callfar PrintWaitingText
call Serial_SyncAndExchangeNybble
jp LoadScreenTilesFromBuffer1

View file

@ -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

View file

@ -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::

View file

@ -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::

View file

@ -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