aboutsummaryrefslogtreecommitdiffstats
path: root/engine/events
diff options
context:
space:
mode:
authorRangi <35663410+Rangi42@users.noreply.github.com>2020-07-07 19:48:22 -0400
committerGitHub <noreply@github.com>2020-07-07 19:48:22 -0400
commit9571c550b6a0dcb3a4f54513c881661a87271024 (patch)
treed73507228a57e4f3cece2fb93fe7df3a9439553f /engine/events
parentMerge pull request #262 from Rangi42/master (diff)
parentMove all code out of home.asm into home/ (diff)
downloadpokeyellow-9571c550b6a0dcb3a4f54513c881661a87271024.tar.gz
pokeyellow-9571c550b6a0dcb3a4f54513c881661a87271024.tar.xz
pokeyellow-9571c550b6a0dcb3a4f54513c881661a87271024.zip
Merge pull request #263 from Rangi42/master
Syncing style with pokecrystal
Diffstat (limited to 'engine/events')
-rw-r--r--engine/events/black_out.asm26
-rwxr-xr-xengine/events/card_key.asm4
-rwxr-xr-xengine/events/cinnabar_lab.asm14
-rwxr-xr-xengine/events/diploma.asm22
-rwxr-xr-xengine/events/evolve_trade.asm2
-rwxr-xr-xengine/events/give_pokemon.asm4
-rwxr-xr-xengine/events/hidden_items.asm14
-rw-r--r--engine/events/hidden_objects/bills_house_pc.asm4
-rw-r--r--engine/events/hidden_objects/book_or_sculpture.asm2
-rw-r--r--engine/events/hidden_objects/bookshelves.asm8
-rw-r--r--engine/events/hidden_objects/cinnabar_gym_quiz.asm28
-rw-r--r--engine/events/hidden_objects/gym_statues.asm2
-rw-r--r--engine/events/hidden_objects/museum_fossils.asm12
-rw-r--r--engine/events/hidden_objects/safari_game.asm4
-rw-r--r--engine/events/hidden_objects/school_blackboard.asm10
-rw-r--r--engine/events/hidden_objects/town_map.asm8
-rw-r--r--engine/events/hidden_objects/vermilion_gym_trash.asm4
-rwxr-xr-xengine/events/in_game_trades.asm6
-rwxr-xr-xengine/events/oaks_aide.asm8
-rw-r--r--engine/events/pick_up_item.asm8
-rw-r--r--engine/events/poison.asm4
-rwxr-xr-xengine/events/pokecenter.asm2
-rwxr-xr-xengine/events/pokedex_rating.asm12
-rwxr-xr-xengine/events/pokemart.asm12
-rwxr-xr-xengine/events/prize_menu.asm38
-rwxr-xr-xengine/events/saffron_guards.asm4
-rwxr-xr-xengine/events/starter_dex.asm4
-rwxr-xr-xengine/events/vending_machine.asm22
28 files changed, 144 insertions, 144 deletions
diff --git a/engine/events/black_out.asm b/engine/events/black_out.asm
index 6c358ce3..16d2081f 100644
--- a/engine/events/black_out.asm
+++ b/engine/events/black_out.asm
@@ -6,34 +6,34 @@ ResetStatusAndHalveMoneyOnBlackout::
ld [wIsInBattle], a
ld [wMapPalOffset], a
ld [wNPCMovementScriptFunctionNum], a
- ld [hJoyHeld], a
+ ldh [hJoyHeld], a
ld [wNPCMovementScriptPointerTableNum], a
ld [wFlags_0xcd60], a
- ld [hMoney], a
- ld [hMoney + 1], a
- ld [hMoney + 2], a
+ ldh [hMoney], a
+ ldh [hMoney + 1], a
+ ldh [hMoney + 2], a
call HasEnoughMoney
jr c, .lostmoney ; never happens
; Halve the player's money.
ld a, [wPlayerMoney]
- ld [hMoney], a
+ ldh [hMoney], a
ld a, [wPlayerMoney + 1]
- ld [hMoney + 1], a
+ ldh [hMoney + 1], a
ld a, [wPlayerMoney + 2]
- ld [hMoney + 2], a
+ ldh [hMoney + 2], a
xor a
- ld [hDivideBCDDivisor], a
- ld [hDivideBCDDivisor + 1], a
+ ldh [hDivideBCDDivisor], a
+ ldh [hDivideBCDDivisor + 1], a
ld a, 2
- ld [hDivideBCDDivisor + 2], a
+ ldh [hDivideBCDDivisor + 2], a
predef DivideBCDPredef3
- ld a, [hDivideBCDQuotient]
+ ldh a, [hDivideBCDQuotient]
ld [wPlayerMoney], a
- ld a, [hDivideBCDQuotient + 1]
+ ldh a, [hDivideBCDQuotient + 1]
ld [wPlayerMoney + 1], a
- ld a, [hDivideBCDQuotient + 2]
+ ldh a, [hDivideBCDQuotient + 2]
ld [wPlayerMoney + 2], a
.lostmoney
diff --git a/engine/events/card_key.asm b/engine/events/card_key.asm
index a37a1f27..7ac39a6f 100755
--- a/engine/events/card_key.asm
+++ b/engine/events/card_key.asm
@@ -28,7 +28,7 @@ PrintCardKeyText:
call GetCoordsInFrontOfPlayer
push de
tx_pre_id CardKeySuccessText
- ld [hSpriteIndexOrTextID], a
+ ldh [hSpriteIndexOrTextID], a
call PrintPredefTextID
pop de
srl d
@@ -55,7 +55,7 @@ PrintCardKeyText:
jp PlaySound
.noCardKey
tx_pre_id CardKeyFailText
- ld [hSpriteIndexOrTextID], a
+ ldh [hSpriteIndexOrTextID], a
jp PrintPredefTextID
SilphCoMapList:
diff --git a/engine/events/cinnabar_lab.asm b/engine/events/cinnabar_lab.asm
index 7878780c..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
@@ -35,7 +35,7 @@ GiveFossilToCinnabarLab::
ld e, a
add hl, de
ld a, [hl]
- ld [hItemToRemoveID], a
+ ldh [hItemToRemoveID], a
cp DOME_FOSSIL
jr z, .choseDomeFossil
cp HELIX_FOSSIL
@@ -61,8 +61,8 @@ GiveFossilToCinnabarLab::
ld hl, LabFossil_610b3
call PrintText
ld a, [wFossilItem]
- ld [hItemToRemoveID], a
- callba RemoveItemByID
+ ldh [hItemToRemoveID], a
+ farcall RemoveItemByID
ld hl, LabFossil_610b8
call PrintText
SetEvents EVENT_GAVE_FOSSIL_TO_LAB, EVENT_LAB_STILL_REVIVING_FOSSIL
@@ -92,7 +92,7 @@ PrintFossilsInBag:
; Prints each fossil in the player's bag on a separate line in the menu.
ld hl, wFilteredBagItems
xor a
- ld [hItemCounter], a
+ ldh [hItemCounter], a
.loop
ld a, [hli]
cp $ff
@@ -100,8 +100,8 @@ PrintFossilsInBag:
push hl
ld [wd11e], a
call GetItemName
- coord hl, 2, 2
- ld a, [hItemCounter]
+ hlcoord 2, 2
+ ldh a, [hItemCounter]
ld bc, SCREEN_WIDTH * 2
call AddNTimes
ld de, wcd6d
diff --git a/engine/events/diploma.asm b/engine/events/diploma.asm
index 92196537..c282b49b 100755
--- a/engine/events/diploma.asm
+++ b/engine/events/diploma.asm
@@ -10,11 +10,11 @@ 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
- coord hl, 0, 0
+ hlcoord 0, 0
lb bc, 16, 18
predef Diploma_TextBoxBorder
ld hl, DiplomaTextPointersAndCoords
@@ -35,10 +35,10 @@ DisplayDiploma::
pop bc
dec c
jr nz, .asm_56715
- coord hl, 10, 4
+ hlcoord 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,13 +56,13 @@ DisplayDiploma::
jr nz, .adjustPlayerGfxLoop
call EnableLCD
- callba LoadTrainerInfoTextBoxTiles
+ farcall LoadTrainerInfoTextBoxTiles
ld b, SET_PAL_GENERIC
call RunPaletteCommand
call Delay3
call GBPalNormal
ld a, $90
- ld [rOBP0], a
+ ldh [rOBP0], a
call WaitForTextScrollButtonPress
ld hl, wd730
res 6, [hl]
@@ -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/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_items.asm b/engine/events/hidden_items.asm
index 85ae7c93..6a5835cd 100755
--- a/engine/events/hidden_items.asm
+++ b/engine/events/hidden_items.asm
@@ -67,9 +67,9 @@ HiddenCoins:
and a
ret nz
xor a
- ld [hUnusedCoinsByte], a
- ld [hCoins], a
- ld [hCoins + 1], a
+ ldh [hUnusedCoinsByte], a
+ ldh [hCoins], a
+ ldh [hCoins + 1], a
ld a, [wHiddenObjectFunctionArgument]
sub COIN
cp 10
@@ -81,19 +81,19 @@ HiddenCoins:
jr .bcd100
.bcd10
ld a, $10
- ld [hCoins + 1], a
+ ldh [hCoins + 1], a
jr .bcdDone
.bcd20
ld a, $20
- ld [hCoins + 1], a
+ ldh [hCoins + 1], a
jr .bcdDone
.bcd40 ; due to a typo, this is never used
ld a, $40
- ld [hCoins + 1], a
+ ldh [hCoins + 1], a
jr .bcdDone
.bcd100
ld a, $1
- ld [hCoins], a
+ ldh [hCoins], a
.bcdDone
ld de, wPlayerCoins + 1
ld hl, hCoins + 1
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 9cdd037a..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
@@ -24,7 +24,7 @@ PrintBookshelfText::
pop af
call PrintPredefTextID
xor a
- ld [hFFDB], a
+ ldh [hFFDB], a
ret
.nextBookshelfEntry1
inc hl
@@ -33,7 +33,7 @@ PrintBookshelfText::
jr .loop
.noMatch
ld a, $ff
- ld [hFFDB], a
- jpba PrintCardKeyText
+ ldh [hFFDB], a
+ farjp PrintCardKeyText
INCLUDE "data/tilesets/bookshelf_tile_ids.asm"
diff --git a/engine/events/hidden_objects/cinnabar_gym_quiz.asm b/engine/events/hidden_objects/cinnabar_gym_quiz.asm
index da309f87..2e4f48f3 100644
--- a/engine/events/hidden_objects/cinnabar_gym_quiz.asm
+++ b/engine/events/hidden_objects/cinnabar_gym_quiz.asm
@@ -12,14 +12,14 @@ CinnabarGymQuiz::
ld a, [wHiddenObjectFunctionArgument]
push af
and $f
- ld [hGymGateIndex], a
+ ldh [hGymGateIndex], a
pop af
and $f0
swap a
- ld [hGymGateAnswer], a
+ ldh [hGymGateAnswer], a
ld hl, CinnabarGymQuizIntroText
call PrintText
- ld a, [hGymGateIndex]
+ ldh a, [hGymGateIndex]
dec a
add a
ld d, 0
@@ -77,18 +77,18 @@ CinnabarGymGateFlagAction:
CinnabarGymQuiz_1ea92:
call YesNoChoice
- ld a, [hGymGateAnswer]
+ ldh a, [hGymGateAnswer]
ld c, a
ld a, [wCurrentMenuItem]
cp c
jr nz, .wrongAnswer
ld hl, wCurrentMapScriptFlags
set 5, [hl]
- ld a, [hGymGateIndex]
- ld [hBackupGymGateIndex], a
+ ldh a, [hGymGateIndex]
+ ldh [hBackupGymGateIndex], a
ld hl, CinnabarGymQuizCorrectText
call PrintText
- ld a, [hBackupGymGateIndex]
+ ldh a, [hBackupGymGateIndex]
AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0
ld c, a
ld b, FLAG_SET
@@ -101,7 +101,7 @@ CinnabarGymQuiz_1ea92:
call WaitForSoundToFinish
ld hl, CinnabarGymQuizIncorrectText
call PrintText
- ld a, [hGymGateIndex]
+ ldh a, [hGymGateIndex]
add $2
AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2
ld c, a
@@ -111,7 +111,7 @@ CinnabarGymQuiz_1ea92:
ld a, c
and a
ret nz
- ld a, [hGymGateIndex]
+ ldh a, [hGymGateIndex]
add $2
ld [wOpponentAfterWrongAnswer], a
ret
@@ -122,7 +122,7 @@ CinnabarGymQuizCorrectText:
text_promptbutton
text_asm
- ld a, [hBackupGymGateIndex]
+ ldh a, [hBackupGymGateIndex]
AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0
ld c, a
ld b, FLAG_TEST
@@ -144,9 +144,9 @@ UpdateCinnabarGymGateTileBlocks_::
; Update the overworld map with open floor blocks or locked gate blocks
; depending on event flags.
ld a, 6
- ld [hGymGateIndex], a
+ ldh [hGymGateIndex], a
.loop
- ld a, [hGymGateIndex]
+ ldh a, [hGymGateIndex]
dec a
add a
add a
@@ -161,8 +161,8 @@ UpdateCinnabarGymGateTileBlocks_::
ld a, [hl]
ld [wGymGateTileBlock], a
push bc
- ld a, [hGymGateIndex]
- ld [hBackupGymGateIndex], a
+ ldh a, [hGymGateIndex]
+ ldh [hBackupGymGateIndex], a
AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0
ld c, a
ld b, FLAG_TEST
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/engine/events/hidden_objects/museum_fossils.asm b/engine/events/hidden_objects/museum_fossils.asm
index 36fb2556..27714981 100644
--- a/engine/events/hidden_objects/museum_fossils.asm
+++ b/engine/events/hidden_objects/museum_fossils.asm
@@ -26,10 +26,10 @@ DisplayMonFrontSpriteInBox:
; Displays a pokemon's front sprite in a pop-up window.
; [wcf91] = pokemon internal id number
ld a, 1
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
call Delay3
xor a
- ld [hWY], a
+ ldh [hWY], a
call SaveScreenTilesToBuffer1
ld a, MON_SPRITE_POPUP
ld [wTextBoxID], a
@@ -38,15 +38,15 @@ DisplayMonFrontSpriteInBox:
ld a, [wcf91]
ld [wd0b5], a
call GetMonHeader
- ld de, vChars1 + $310
+ ld de, vChars1 tile $31
call LoadMonFrontSprite
ld a, $80
- ld [hStartTileID], a
- coord hl, 10, 11
+ ldh [hStartTileID], a
+ hlcoord 10, 11
predef AnimateSendingOutMon
call WaitForTextScrollButtonPress
call LoadScreenTilesFromBuffer1
call Delay3
ld a, $90
- ld [hWY], a
+ ldh [hWY], a
ret
diff --git a/engine/events/hidden_objects/safari_game.asm b/engine/events/hidden_objects/safari_game.asm
index 656e872a..5996fc6f 100644
--- a/engine/events/hidden_objects/safari_game.asm
+++ b/engine/events/hidden_objects/safari_game.asm
@@ -37,12 +37,12 @@ SafariZoneGameOver:
cp SFX_SAFARI_ZONE_PA
jr nz, .waitForMusicToPlay
ld a, TEXT_SAFARI_GAME_OVER
- ld [hSpriteIndexOrTextID], a
+ ldh [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [wPlayerMovingDirection], a
ld a, SAFARI_ZONE_GATE
- ld [hWarpDestinationMap], a
+ ldh [hWarpDestinationMap], a
ld a, $3
ld [wDestinationWarpID], a
ld a, $5
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/hidden_objects/town_map.asm b/engine/events/hidden_objects/town_map.asm
index 9481b902..4284214f 100644
--- a/engine/events/hidden_objects/town_map.asm
+++ b/engine/events/hidden_objects/town_map.asm
@@ -8,15 +8,15 @@ TownMapText::
set 6, [hl]
call GBPalWhiteOutWithDelay3
xor a
- ld [hWY], a
+ ldh [hWY], a
inc a
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
call LoadFontTilePatterns
- callba DisplayTownMap
+ farcall DisplayTownMap
ld hl, wd730
res 6, [hl]
ld de, TextScriptEnd
push de
- ld a, [hLoadedROMBank]
+ ldh a, [hLoadedROMBank]
push af
jp CloseTextDisplay
diff --git a/engine/events/hidden_objects/vermilion_gym_trash.asm b/engine/events/hidden_objects/vermilion_gym_trash.asm
index f46b53c2..c2bfed06 100644
--- a/engine/events/hidden_objects/vermilion_gym_trash.asm
+++ b/engine/events/hidden_objects/vermilion_gym_trash.asm
@@ -56,12 +56,12 @@ GymTrashScript:
; first lock was in trash can 1 or 3. However, due to this bug, trash can 0 can
; have the second lock regardless of which trash can had the first lock.
- ld [hGymTrashCanRandNumMask], a
+ ldh [hGymTrashCanRandNumMask], a
push hl
call Random
swap a
ld b, a
- ld a, [hGymTrashCanRandNumMask]
+ ldh a, [hGymTrashCanRandNumMask]
and b
dec a
pop hl
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/oaks_aide.asm b/engine/events/oaks_aide.asm
index 61304877..dd4e5fd7 100755
--- a/engine/events/oaks_aide.asm
+++ b/engine/events/oaks_aide.asm
@@ -9,16 +9,16 @@ OaksAideScript:
ld b, wPokedexOwnedEnd - wPokedexOwned
call CountSetBits
ld a, [wNumSetBits]
- ld [hOaksAideNumMonsOwned], a
+ ldh [hOaksAideNumMonsOwned], a
ld b, a
- ld a, [hOaksAideRequirement]
+ ldh a, [hOaksAideRequirement]
cp b
jr z, .giveItem
jr nc, .notEnoughOwnedMons
.giveItem
ld hl, OaksAideHereYouGoText
call PrintText
- ld a, [hOaksAideRewardItem]
+ ldh a, [hOaksAideRewardItem]
ld b, a
ld c, 1
call GiveItem
@@ -42,7 +42,7 @@ OaksAideScript:
call PrintText
ld a, $ff
.done
- ld [hOaksAideResult], a
+ ldh [hOaksAideResult], a
ret
OaksAideHiText:
diff --git a/engine/events/pick_up_item.asm b/engine/events/pick_up_item.asm
index ec50d9c4..548db5be 100644
--- a/engine/events/pick_up_item.asm
+++ b/engine/events/pick_up_item.asm
@@ -1,7 +1,7 @@
PickUpItem:
call EnableAutoTextBoxDrawing
- ld a, [hSpriteIndexOrTextID]
+ ldh a, [hSpriteIndexOrTextID]
ld b, a
ld hl, wMissableObjectList
.missableObjectsListLoop
@@ -15,10 +15,10 @@ PickUpItem:
.isMissable
ld a, [hl]
- ld [hMissableObjectIndex], a
+ ldh [hMissableObjectIndex], a
ld hl, wMapSpriteExtraData
- ld a, [hSpriteIndexOrTextID]
+ ldh a, [hSpriteIndexOrTextID]
dec a
add a
ld d, 0
@@ -30,7 +30,7 @@ PickUpItem:
call GiveItem
jr nc, .BagFull
- ld a, [hMissableObjectIndex]
+ ldh a, [hMissableObjectIndex]
ld [wMissableObjectIndex], a
predef HideObject
ld a, 1
diff --git a/engine/events/poison.asm b/engine/events/poison.asm
index 5d8eb9fd..8bb756b5 100644
--- a/engine/events/poison.asm
+++ b/engine/events/poison.asm
@@ -52,7 +52,7 @@ ApplyOutOfBattlePoisonDamage:
ld [wJoyIgnore], a
call EnableAutoTextBoxDrawing
ld a, TEXT_MON_FAINTED
- ld [hSpriteIndexOrTextID], a
+ ldh [hSpriteIndexOrTextID], a
call DisplayTextID
pop de
pop hl
@@ -99,7 +99,7 @@ ApplyOutOfBattlePoisonDamage:
jr nz, .noBlackOut
call EnableAutoTextBoxDrawing
ld a, TEXT_BLACKED_OUT
- ld [hSpriteIndexOrTextID], a
+ ldh [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd72e
set 5, [hl]
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 9dbe2138..490ae05a 100755
--- a/engine/events/pokedex_rating.asm
+++ b/engine/events/pokedex_rating.asm
@@ -3,17 +3,17 @@ DisplayDexRating:
ld b, wPokedexSeenEnd - wPokedexSeen
call CountSetBits
ld a, [wNumSetBits]
- ld [hDexRatingNumMonsSeen], a
+ ldh [hDexRatingNumMonsSeen], a
ld hl, wPokedexOwned
ld b, wPokedexOwnedEnd - wPokedexOwned
call CountSetBits
ld a, [wNumSetBits]
- ld [hDexRatingNumMonsOwned], a
+ ldh [hDexRatingNumMonsOwned], a
ld hl, DexRatingsTable
.findRating
ld a, [hli]
ld b, a
- ld a, [hDexRatingNumMonsOwned]
+ ldh a, [hDexRatingNumMonsOwned]
cp b
jr c, .foundRating
inc hl
@@ -30,14 +30,14 @@ DisplayDexRating:
call PrintText
pop hl
call PrintText
- callba PlayPokedexRatingSfx
+ farcall PlayPokedexRatingSfx
jp WaitForTextScrollButtonPress
.hallOfFame
ld de, wDexRatingNumMonsSeen
- ld a, [hDexRatingNumMonsSeen]
+ ldh a, [hDexRatingNumMonsSeen]
ld [de], a
inc de
- ld a, [hDexRatingNumMonsOwned]
+ ldh a, [hDexRatingNumMonsOwned]
ld [de], a
inc de
.copyRatingTextLoop
diff --git a/engine/events/pokemart.asm b/engine/events/pokemart.asm
index b05e4ed6..c7cb8115 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
@@ -77,14 +77,14 @@ DisplayPokemartDialogue_::
jr c, .unsellableItem
ld a, PRICEDITEMLISTMENU
ld [wListMenuID], a
- ld [hHalveItemPrices], a ; halve prices when selling
+ ldh [hHalveItemPrices], a ; halve prices when selling
call DisplayChooseQuantityMenu
inc a
jr z, .sellMenuLoop ; if the player closed the choose quantity menu with the B button
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
@@ -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
@@ -152,7 +152,7 @@ DisplayPokemartDialogue_::
ld a, 99
ld [wMaxItemQuantity], a
xor a
- ld [hHalveItemPrices], a ; don't halve item prices when buying
+ ldh [hHalveItemPrices], a ; don't halve item prices when buying
call DisplayChooseQuantityMenu
inc a
jr z, .buyMenuLoop ; if the player closed the choose quantity menu with the B button
@@ -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 0030aafb..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
@@ -64,7 +64,7 @@ GetPrizeMenuId:
; display the three prizes' names
; (distinguishing between Pokemon names
; and Items (specifically TMs) names)
- ld a, [hSpriteIndexOrTextID]
+ ldh a, [hSpriteIndexOrTextID]
sub 3 ; prize-texts' id are 3, 4 and 5
ld [wWhichPrizeWindow], a ; prize-texts' id (relative, i.e. 0, 1 or 2)
add a
@@ -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
@@ -177,11 +177,11 @@ LoadCoinsToSubtract:
ld hl, wPrize1Price
add hl, de ; get selected prize's price
xor a
- ld [hUnusedCoinsByte], a
+ ldh [hUnusedCoinsByte], a
ld a, [hli]
- ld [hCoins], a
+ ldh [hCoins], a
ld a, [hl]
- ld [hCoins + 1], a
+ ldh [hCoins + 1], a
ret
HandlePrizeChoice:
diff --git a/engine/events/saffron_guards.asm b/engine/events/saffron_guards.asm
index 59c2725c..bf30b8c5 100755
--- a/engine/events/saffron_guards.asm
+++ b/engine/events/saffron_guards.asm
@@ -2,7 +2,7 @@ RemoveGuardDrink::
ld hl, GuardDrinksList
.drinkLoop
ld a, [hli]
- ld [hItemToRemoveID], a
+ ldh [hItemToRemoveID], a
and a
ret z
push hl
@@ -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/events/starter_dex.asm b/engine/events/starter_dex.asm
index 21289c6a..7cfe9af2 100755
--- a/engine/events/starter_dex.asm
+++ b/engine/events/starter_dex.asm
@@ -1,9 +1,9 @@
; this function temporarily makes the starters (and Ivysaur) seen
; so that the full Pokedex information gets displayed in Oak's lab
StarterDex:
- ld a, %01001011 ; set starter flags
+ ld a, 1 << (DEX_BULBASAUR - 1) | 1 << (DEX_IVYSAUR - 1) | 1 << (DEX_CHARMANDER - 1) | 1 << (DEX_SQUIRTLE - 1)
ld [wPokedexOwned], a
predef ShowPokedexData
- xor a ; unset starter flags
+ xor a
ld [wPokedexOwned], a
ret
diff --git a/engine/events/vending_machine.asm b/engine/events/vending_machine.asm
index acb8dce8..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
@@ -37,17 +37,17 @@ VendingMachineMenu::
cp 3 ; chose Cancel?
jr z, .notThirsty
xor a
- ld [hMoney], a
- ld [hMoney + 2], a
+ ldh [hMoney], a
+ ldh [hMoney + 2], a
ld a, $2
- ld [hMoney + 1], a
+ ldh [hMoney + 1], a
call HasEnoughMoney
jr nc, .enoughMoney
ld hl, VendingMachineText4
jp PrintText
.enoughMoney
call LoadVendingMachineItem
- ld a, [hVendingMachineItem]
+ ldh a, [hVendingMachineItem]
ld b, a
ld c, 1
call GiveItem
@@ -121,13 +121,13 @@ LoadVendingMachineItem:
ld e, a
add hl, de
ld a, [hli]
- ld [hVendingMachineItem], a
+ ldh [hVendingMachineItem], a
ld a, [hli]
- ld [hVendingMachinePrice], a
+ ldh [hVendingMachinePrice], a
ld a, [hli]
- ld [hVendingMachinePrice + 1], a
+ ldh [hVendingMachinePrice + 1], a
ld a, [hl]
- ld [hVendingMachinePrice + 2], a
+ ldh [hVendingMachinePrice + 2], a
ret
INCLUDE "data/items/vending_prices.asm"