Use macros for predef calls/jumps instead of static ids.

This commit is contained in:
yenatch 2014-06-16 13:57:26 -07:00
parent d10108a066
commit b36f793667
122 changed files with 360 additions and 719 deletions

View file

@ -76,12 +76,9 @@ Func_7861: ; 7861 (1:7861)
xor a
.asm_78aa
ld [wListMenuID], a ; wListMenuID
ld a, $48
call Predef
ld a, $0
call Predef
ld a, $49
call Predef
predef UpdateHPBar2
predef Func_3cd60
predef Func_3cdec
callab ReadPlayerMonCurHPAndStatus
ld hl, SuckedHealthText ; $78dc
ld a, [H_WHOSETURN] ; $fff3

View file

@ -17,8 +17,7 @@ Func_5525f: ; 5525f (15:525f)
ld a, [wWhichPokemon]
ld c, a
ld b, $2
ld a, $10 ; FlagActionPredef
call Predef
predef FlagActionPredef
ld a, c
and a
pop hl
@ -245,14 +244,12 @@ Func_5525f: ; 5525f (15:525f)
ld [wcc49], a
ld a, [wd0b5]
ld [wd11e], a
ld a, $1a
call Predef
predef Func_3af5b
ld hl, wccd3
ld a, [wWhichPokemon] ; wWhichPokemon
ld c, a
ld b, $1
ld a, $10 ; FlagActionPredef
call Predef
predef FlagActionPredef
pop hl
pop af
ld [W_CURENEMYLVL], a ; W_CURENEMYLVL
@ -277,14 +274,12 @@ Func_55436: ; 55436 (15:5436)
ld c, a
ld b, $1
push bc
ld a, $10 ; FlagActionPredef
call Predef
predef FlagActionPredef
ld hl, wccf5
xor a
ld [hl], a
pop bc
ld a, $10 ; FlagActionPredef
jp Predef
predef_jump FlagActionPredef
Func_5546c: ; 5546c (15:546c)
ld a, [wPartyAliveFlags]

View file

@ -43,8 +43,7 @@ asm_128fb: ; 128fb (4:68fb)
ld d, a
ld a, [wcfbb]
ld e, a
ld a, $26
call Predef
predef HPBarLength
ld a, $6
ld d, a
ld c, a

View file

@ -36,15 +36,13 @@ Func_137aa: ; 137aa (4:77aa)
jr z, .asm_1380a
ld de, wPlayerMoney + 2 ; wd349
ld c, $3
ld a, $b ; AddBCDPredef
call Predef
predef AddBCDPredef
ld hl, PickUpPayDayMoneyText
call PrintText
.asm_1380a
xor a
ld [wccd4], a
ld a, $2a
call Predef
predef Func_3ad1c
.asm_13813
xor a
ld [wd083], a
@ -263,8 +261,7 @@ RecoilEffect_: ; 1392c (4:792c)
xor a
.asm_13990
ld [wListMenuID], a ; wListMenuID
ld a, $48
call Predef
predef UpdateHPBar2
ld hl, HitWithRecoilText ; $799e
jp PrintText
HitWithRecoilText: ; 1399e (4:799e)

View file

@ -831,11 +831,9 @@ DoRockSlideSpecialEffects: ; 78fd9 (1e:4fd9)
; if the subaninmation counter is between 8 and 11, shake the screen horizontally and vertically
.shakeScreen
ld b,1
ld a,$24
call Predef ; shake horizontally
predef Func_48125 ; shake horizontally
ld b,1
ld a,$21
jp Predef ; shake vertically
predef_jump Func_480ff ; shake vertically
FlashScreenEveryEightFrameBlocks: ; 78ff7 (1e:4ff7)
ld a,[W_SUBANIMCOUNTER]
@ -1227,16 +1225,14 @@ Func_791fc: ; 791fc (1e:51fc)
ld b, $5
Func_79209: ; 79209 (1e:5209)
ld a, $21
jp Predef
predef_jump Func_480ff
AnimationShakeScreen: ; 7920e (1e:520e)
; Shakes the screen for a while. Used in Earthquake/Fissure/etc. animations.
ld b, $8
Func_79210: ; 79210 (1e:5210)
ld a, $24
jp Predef
predef_jump Func_48125
AnimationWaterDropletsEverywhere: ; 79215 (1e:5215)
; Draws water droplets all over the screen and makes them
@ -2143,8 +2139,7 @@ Func_79793: ; 79793 (1e:5793)
ld [wBattleMonSpecies2], a
ld [wd0b5], a
call GetMonHeader
ld a, $4
call Predef
predef LoadMonBackPic
xor a
call Func_79842
call Func_79820

View file

@ -120,8 +120,7 @@ PayDayEffect_ ; 2feb8 (b:7eb8)
ld [hl], a
ld de, wcce7
ld c, $3
ld a, $b ; AddBCDPredef
call Predef
predef AddBCDPredef
ld hl, CoinsScatteredText ; $7f04
jp PrintText

View file

@ -173,8 +173,7 @@ Func_3c04c: ; 3c04c (f:404c)
ld [$ffe1], a
FuncCoord 1, 5
ld hl, Coord
ld a, $1
call Predef
predef Func_3f0c6
xor a
ld [$ffb0], a
ld [rWY], a ; $ff4a
@ -320,12 +319,10 @@ Func_3c1ad: ; 3c1ad (f:41ad)
ld b, $1
push bc
ld hl, wPartyAliveFlags
ld a, $10 ; FlagActionPredef
call Predef
predef FlagActionPredef
ld hl, wccf5
pop bc
ld a, $10 ; FlagActionPredef
call Predef
predef FlagActionPredef
call Func_3cba6
call LoadScreenTilesFromBuffer1
call Func_3cc91
@ -751,8 +748,7 @@ UpdateCurMonHPBar: ; 3c4f6 (f:44f6)
.playersTurn
push bc
ld [wListMenuID], a ; wListMenuID
ld a, $48
call Predef
predef UpdateHPBar2
pop bc
ret
@ -996,8 +992,7 @@ TrainerBattleVictory: ; 3c696 (f:4696)
ld de, wPlayerMoney + 2 ; wd349
ld hl, wd07b
ld c, $3
ld a, $b ; AddBCDPredef
jp Predef
predef_jump AddBCDPredef
MoneyForWinningText: ; 3c6e4 (f:46e4)
TX_FAR _MoneyForWinningText
@ -1053,8 +1048,7 @@ Func_3c741: ; 3c741 (f:4741)
ld c, a
ld hl, wPartyAliveFlags ; clear fainted mon's alive flag
ld b, $0
ld a, $10 ; FlagActionPredef
call Predef
predef FlagActionPredef
ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1
res 2, [hl] ; reset "attacking multiple times" flag
ld a, [wd083]
@ -1153,12 +1147,10 @@ Func_3c7d8: ; 3c7d8 (f:47d8)
ld hl, wPartyAliveFlags
ld b, $1
push bc
ld a, $10 ; FlagActionPredef
call Predef
predef FlagActionPredef
pop bc
ld hl, wccf5
ld a, $10 ; FlagActionPredef
call Predef
predef FlagActionPredef
call Func_3cba6
call GBPalWhiteOut
call Func_3ee5b
@ -1317,14 +1309,12 @@ EnemySendOut: ; 3c90e (f:490e)
ld c,a
ld b,1
push bc
ld a,$10
call Predef
predef FlagActionPredef
ld hl,wccf5
xor a
ld [hl],a
pop bc
ld a,$10
call Predef
predef FlagActionPredef
Func_3c92a: ; 3c92a (f:492a)
xor a
ld hl,wd065
@ -1468,8 +1458,7 @@ Func_3c92a: ; 3c92a (f:492a)
ld [$FFE1],a
FuncCoord 15, 6
ld hl,Coord
ld a,2
call Predef
predef Func_3f073
ld a,[wEnemyMonSpecies2]
call PlayCry
call Func_3cdec
@ -1759,8 +1748,7 @@ Func_3cc91: ; 3cc91 (f:4c91)
Func_3cca4: ; 3cca4 (f:4ca4)
call Func_3cd60
ld a, $4
call Predef
predef LoadMonBackPic
xor a
ld [$ffe1], a
ld hl, wcc2d
@ -1791,8 +1779,7 @@ Func_3cca4: ; 3cca4 (f:4ca4)
call PlayMoveAnimation
FuncCoord 4, 11
ld hl, Coord
ld a, $2
call Predef
predef Func_3f073
ld a, [wcf91]
call PlayCry
call Func_3ee94
@ -1809,8 +1796,7 @@ Func_3ccfa: ; 3ccfa (f:4cfa)
xor a
ld [wcd6c], a
ld [H_DOWNARROWBLINKCNT1], a ; $ff8b
ld a, $5
call Predef
predef Func_79aba
ld c, $4
call DelayFrames
call Func_3cd3a
@ -1821,8 +1807,7 @@ Func_3ccfa: ; 3ccfa (f:4cfa)
ld [wcd6c], a
xor a
ld [H_DOWNARROWBLINKCNT1], a ; $ff8b
ld a, $5
call Predef
predef Func_79aba
call Delay3
call Func_3cd3a
ld a, $4c
@ -1889,8 +1874,7 @@ Func_3cd60: ; 3cd60 (f:4d60)
ld [wcf91], a
FuncCoord 10, 9
ld hl, Coord
ld a, $5f
call Predef
predef DrawHP
ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
ld hl, wcf1d
@ -2384,10 +2368,8 @@ Func_3d119: ; 3d119 (f:5119)
ld [wcc49], a
ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1)
call ClearSprites
ld a, $36
call Predef
ld a, $37
call Predef
predef StatusScreen
predef StatusScreen2
ld a, [W_ENEMYBATTSTATUS2] ; W_ENEMYBATTSTATUS2
bit 4, a
ld hl, AnimationSubstitute
@ -2440,12 +2422,10 @@ Func_3d1ba: ; 3d1ba (f:51ba)
ld b, $1
push bc
ld hl, wPartyAliveFlags
ld a, $10 ; FlagActionPredef
call Predef
predef FlagActionPredef
pop bc
ld hl, wccf5
ld a, $10 ; FlagActionPredef
call Predef
predef FlagActionPredef
call Func_3cba6
call Func_3cc91
call SaveScreenTilesToBuffer1
@ -2922,8 +2902,7 @@ Func_3d4b6: ; 3d4b6 (f:54b6)
call GetCurrentMove
FuncCoord 2, 10
ld hl, Coord
ld a, $5d
call Predef
predef Func_27d98
.asm_3d54e
ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
@ -3872,8 +3851,7 @@ PrintMoveFailureText: ; 3dbe2 (f:5be2)
ld hl, KeptGoingAndCrashedText ; $5c47
call PrintText
ld b, $4
ld a, $24
call Predef
predef Func_48125
ld a, [H_WHOSETURN] ; $fff3
and a
jr nz, .asm_3dc3f
@ -4799,8 +4777,7 @@ ApplyDamageToEnemyPokemon: ; 3e142 (f:6142)
ld hl,Coord
xor a
ld [wListMenuID],a
ld a,$48
call Predef ; animate the HP bar shortening
predef UpdateHPBar2 ; animate the HP bar shortening
ApplyAttackToEnemyPokemonDone: ; 3e19d (f:619d)
jp Func_3cd5a ; redraw pokemon names and HP bars
@ -4919,8 +4896,7 @@ ApplyDamageToPlayerPokemon: ; 3e200 (f:6200)
ld hl,Coord
ld a,$01
ld [wListMenuID],a
ld a,$48
call Predef ; animate the HP bar shortening
predef UpdateHPBar2 ; animate the HP bar shortening
ApplyAttackToPlayerPokemonDone
jp Func_3cd5a ; redraw pokemon names and HP bars
@ -6147,13 +6123,11 @@ Func_3eb01: ; 3eb01 (f:6b01)
dec de
xor a
ld [wHPBarMaxHP], a
ld a, $3e
call Predef
predef WriteMonMoves
.asm_3ebca
ld hl, wEnemyMonMoves
ld de, wEnemyMonSpecial + 1
ld a, $5e
call Predef
predef LoadMovePPs
ld hl, W_MONHBASESTATS
ld de, wd002
ld b, $5
@ -6178,15 +6152,13 @@ Func_3eb01: ; 3eb01 (f:6b01)
call CopyData
ld a, [wEnemyMonSpecies2]
ld [wd11e], a
ld a, $3a
call Predef
predef IndexToPokedex
ld a, [wd11e]
dec a
ld c, a
ld b, $1
ld hl, wPokedexSeen ; wd30a
ld a, $10 ; FlagActionPredef
call Predef
predef FlagActionPredef
ld hl, wEnemyMonLevel ; wEnemyMonLevel
ld de, wcd23
ld bc, $b
@ -6212,8 +6184,7 @@ Func_3ec32: ; 3ec32 (f:6c32)
call ClearScreen
.asm_3ec4d
call DelayFrame
ld a, $30
call Predef
predef BattleTransition
callab Func_3ee58
ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
@ -6255,8 +6226,7 @@ Func_3ec92: ; 3ec92 (f:6c92)
.asm_3ec9e
ld a, BANK(RedPicBack)
call UncompressSpriteFromDE
ld a, $3
call Predef
predef ScaleSpriteByTwo
ld hl, wOAMBuffer
xor a
ld [H_DOWNARROWBLINKCNT1], a ; $ff8b
@ -6306,8 +6276,7 @@ Func_3ec92: ; 3ec92 (f:6c92)
ld [$ffe1], a
FuncCoord 1, 5
ld hl, Coord
ld a, $1
jp Predef
predef_jump Func_3f0c6
Func_3ed02: ; 3ed02 (f:6d02)
callab Func_39680
@ -6709,8 +6678,7 @@ asm_3ef3d: ; 3ef3d (f:6f3d)
ld [wAICount], a ; wccdf
FuncCoord 12, 0
ld hl, Coord
ld a, $1
call Predef
predef Func_3f0c6
ld a, $ff
ld [wEnemyMonPartyPos], a
ld a, $2
@ -6765,8 +6733,7 @@ InitWildBattle: ; 3ef8b (f:6f8b)
ld [$ffe1], a
FuncCoord 12, 0
ld hl, Coord
ld a, $1
call Predef
predef Func_3f0c6
Func_3efeb: ; 3efeb (f:6feb)
ld b, $0
@ -6855,8 +6822,7 @@ Func_3f073: ; 3f073 (f:7073)
ld a, $1
ld [wcd6c], a
ld bc, $303
ld a, $5
call Predef
predef Func_79aba
ld c, $4
call DelayFrames
ld bc, $ffd7
@ -6864,8 +6830,7 @@ Func_3f073: ; 3f073 (f:7073)
xor a
ld [wcd6c], a
ld bc, $505
ld a, $5
call Predef
predef Func_79aba
ld c, $5
call DelayFrames
ld bc, $ffd7
@ -6942,8 +6907,7 @@ LoadMonBackPic:
call ClearScreenArea
ld hl, W_MONHBACKSPRITE - W_MONHEADER
call UncompressMonSprite
ld a, $3
call Predef
predef ScaleSpriteByTwo
ld de, vBackPic
call InterlaceMergeSpriteBuffers ; combine the two buffers to a single 2bpp sprite
ld hl, vSprites
@ -8546,8 +8510,7 @@ Func_3fbbc: ; 3fbbc (f:7bbc)
push hl
push de
push bc
ld a, $8
call Predef
predef MoveAnimation
pop bc
pop de
pop hl

View file

@ -855,8 +855,7 @@ ReadTrainer: ; 39c53 (e:5c53)
ld hl,wd047
ld c,2
push bc
ld a,$B
call Predef
predef AddBCDPredef
pop bc
inc de
inc de
@ -1178,8 +1177,7 @@ Func_3a718: ; 3a718 (e:6718)
ld hl,Coord
xor a
ld [wListMenuID],a
ld a,$48
call Predef
predef UpdateHPBar2
jp DecrementAICount
Func_3a72a: ; 3a72a (e:672a)

View file

@ -94,8 +94,7 @@ HealEffect_: ; 3b9ec (e:79ec)
xor a
.asm_3ba83
ld [wListMenuID], a ; wListMenuID
ld a, $48
call Predef
predef UpdateHPBar2
ld hl, Func_3cd5a ; $4d5a
call BankswitchEtoF
ld hl, RegainedHealthText ; $7aac

View file

@ -273,10 +273,8 @@ Func_5345: ; 5345
call Delay3
ld hl, W_OPTIONS ; W_OPTIONS
res 7, [hl]
ld a, $2c
call Predef
ld a, $7
call Predef
predef InitOpponent
predef HealParty
jp Func_577d
.asm_5506
ld c, BANK(Music_GameCorner)
@ -610,10 +608,8 @@ Func_57c7:
Func_57d6:
ld a, [wCurrentMenuItem]
ld [wWhichPokemon], a
ld a, $36
call Predef
ld a, $37
call Predef
predef StatusScreen
predef StatusScreen2
call GBPalNormal
call LoadTrainerInfoTextBoxTiles
call Func_57f2
@ -827,12 +823,10 @@ TradeCenter_Trade:
ld a, [$ffaa]
cp $1
jr z, .asm_59d9 ; 0x59d0 $7
ld a, $38
call Predef
predef Func_410e2
jr .asm_59de ; 0x59d7 $5
.asm_59d9
ld a, $2f
call Predef
predef Func_410f3
.asm_59de
callab Func_3ad0e
call ClearScreen
@ -847,8 +841,7 @@ TradeCenter_Trade:
ld hl, wTileMap + $119
ld de, TradeCompleted
call PlaceString
ld a, $50
call Predef
predef SaveSAVtoSRAM2
ld c, $32
call DelayFrames
xor a
@ -885,8 +878,7 @@ Func_5a5f: ; 5a5f (1:5a5f)
jr z, .asm_5a75
cp $5
ret nz
ld a, $4d
call Predef
predef Func_5aaf
jp Init
.asm_5a75
call Func_5317

View file

@ -152,8 +152,7 @@ Func_3ad71: ; 3ad71 (e:6d71)
push af
ld a, [wd0b5]
ld [wd11e], a
ld a, $3a
call Predef
predef IndexToPokedex
ld a, [wd11e]
dec a
ld hl, BaseStats
@ -205,13 +204,11 @@ Func_3ad71: ; 3ad71 (e:6d71)
ld [wcc49], a
call Func_3af5b
pop hl
ld a, $42
call Predef
predef SetPartyMonTypes
ld a, [W_ISINBATTLE] ; W_ISINBATTLE
and a
call z, Func_3af52
ld a, $3a
call Predef
predef IndexToPokedex
ld a, [wd11e]
dec a
ld c, a
@ -361,8 +358,7 @@ Func_3af5b: ; 3af5b (e:6f5b)
ld [wd11e], a
call GetMoveName
call CopyStringToCF4B
ld a, $1b
call Predef
predef LearnMove
.asm_3afb1
ld a, [wcf91]
ld [wd11e], a
@ -489,7 +485,6 @@ WriteMonMoves_ShiftMoveData: ; 3b04e (e:704e)
ret
Func_3b057: ; 3b057 (e:7057)
ld a, $10 ; FlagActionPredef
jp Predef
predef_jump FlagActionPredef
INCLUDE "data/evos_moves.asm"

View file

@ -3,8 +3,7 @@ AbleToPlaySlotsCheck ; 2ff09 (b:7f09)
and $8
jr z, .done ; not able
ld b, COIN_CASE
ld a, $1c
call Predef ; IsItemInBag_
predef IsItemInBag_ ; IsItemInBag_
ld a, b
and a
ld b, $33 ; GameCornerCoinCaseText

View file

@ -52,15 +52,13 @@ SetPokedexOwnedFlag: ; 4fe11 (13:7e11)
ld a, [wcf91]
push af
ld [wd11e], a
ld a, $3a
call Predef
predef IndexToPokedex
ld a, [wd11e]
dec a
ld c, a
ld hl, wPokedexOwned ; wPokedexOwned
ld b, $1
ld a, $10 ; FlagActionPredef
call Predef
predef FlagActionPredef
pop af
ld [wd11e], a
call GetMonName

View file

@ -117,8 +117,7 @@ Func_70278: ; 70278 (1c:4278)
ld hl, Coord
call GetMonHeader
call LoadFrontSpriteByMonIndex
ld a, $4
call Predef
predef LoadMonBackPic
.asm_702ab
ld b, $b
ld c, $0
@ -179,8 +178,7 @@ Func_702f0: ; 702f0 (1c:42f0)
ld [wd0b5], a
FuncCoord 3, 9
ld hl, Coord
ld a, $4b
call Predef
predef Func_27d6b
ld a, [wWhichTrade] ; wWhichTrade
jp PlayCry
@ -202,8 +200,7 @@ Func_7033e: ; 7033e (1c:433e)
ld de, RedPicBack ; $7e0a
ld a, BANK(RedPicBack)
call UncompressSpriteFromDE
ld a, $3
call Predef
predef ScaleSpriteByTwo
ld de, vBackPic
call InterlaceMergeSpriteBuffers
ld c, $1
@ -212,14 +209,12 @@ Func_7036d: ; 7036d (1c:436d)
ld b, $0
FuncCoord 12, 5
ld hl, Coord
ld a, $31
jp Predef
predef_jump Func_79dda
Func_70377: ; 70377 (1c:4377)
ld hl, wd747
set 3, [hl]
ld a, $56
call Predef
predef DisplayDexRating
FuncCoord 0, 4
ld hl, Coord
ld b, $6

View file

@ -79,8 +79,7 @@ DisplayMonFrontSpriteInBox: ; 5dbd9 (17:5bd9)
ld [$ffe1], a
FuncCoord 10, 11
ld hl, Coord
ld a, $2
call Predef
predef Func_3f073
call WaitForTextScrollButtonPress
call LoadScreenTilesFromBuffer1
call Delay3

View file

@ -194,8 +194,7 @@ CinnabarQuizQuestionsText6: ; 1ea85 (7:6a85)
CinnabarGymQuiz_1ea8a: ; 1ea8a (7:6a8a)
ld hl, wd79c
ld a, $10 ; FlagActionPredef
jp Predef
predef_jump FlagActionPredef
CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92)
call YesNoChoice
@ -227,8 +226,7 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92)
ld c, a
ld b, $2
ld hl, wd79a
ld a, $10 ; FlagActionPredef
call Predef
predef FlagActionPredef
ld a, c
and a
ret nz
@ -293,8 +291,7 @@ CinnabarGymQuiz_1eb0a: ; 1eb0a (7:6b0a)
.asm_1eb38
pop bc
ld [wd09f], a
ld a, $17
call Predef
predef Func_ee9e
ld hl, $ffdb
dec [hl]
jr nz, .asm_1eb0e

View file

@ -39,8 +39,7 @@ Predef54: ; 71ad9 (1c:5ad9)
ld a,[wWhichTrade]
ld c,a
ld b,$2
ld a,$10
call Predef
predef FlagActionPredef
ld a,c
and a
ld a,$4
@ -112,8 +111,7 @@ Func_71c07: ; 71c07 (1c:5c07)
ld a,[wWhichTrade]
ld c,a
ld b,$1
ld a,$10
call Predef
predef FlagActionPredef
ld hl, ConnectCableText
call PrintText
ld a,[wWhichPokemon]
@ -122,8 +120,7 @@ Func_71c07: ; 71c07 (1c:5c07)
push af
call LoadHpBarAndStatusTilePatterns
call Func_71cc1
ld a,$38
call Predef
predef Func_410e2
pop af
ld [W_CURENEMYLVL],a
pop af

View file

@ -264,12 +264,10 @@ Func_4183f: ; 4183f (10:583f)
Func_41842: ; 41842 (10:5842)
ld c, $0
ld a, $31
jp Predef
predef_jump Func_79dda
Func_41849: ; 41849 (10:5849)
ld a, $33
call Predef
predef Func_79869
ld a, b
jp PlaySound

View file

@ -11,8 +11,7 @@ HiddenItemNear: ; 7481f (1d:481f)
ld hl, wd6f0
ld c, b
ld b, $2
ld a, $10 ; FlagActionPredef
call Predef
predef FlagActionPredef
ld a, c
pop hl
pop bc

View file

@ -326,8 +326,7 @@ ItemUseBall: ; d687 (3:5687)
push af
ld a,[wcf91]
push af
ld a,$08 ;probably animations
call Predef
predef MoveAnimation
pop af
ld [wcf91],a
pop af
@ -397,23 +396,20 @@ ItemUseBall: ; d687 (3:5687)
jr z,.printText1
ld hl,ItemUseBallText05
call PrintText
ld a,$3a ;convert order: Internal->Dex
call Predef
predef IndexToPokedex
ld a,[wd11e]
dec a
ld c,a
ld b,2
ld hl,wPokedexOwned ;Dex_own_flags (pokemon)
ld a,$10
call Predef ;check Dex flag (own already or not)
predef FlagActionPredef
ld a,c
push af
ld a,[wd11e]
dec a
ld c,a
ld b,1
ld a,$10 ;set Dex_own_flag?
call Predef
predef FlagActionPredef
pop af
and a
jr nz,.checkParty
@ -422,8 +418,7 @@ ItemUseBall: ; d687 (3:5687)
call ClearSprites
ld a,[wEnemyMonSpecies] ;caught mon_ID
ld [wd11e],a
ld a,$3d
call Predef
predef ShowPokedexData
.checkParty ;$58f4
ld a,[wPartyCount]
cp a,6 ;is party full?
@ -627,8 +622,7 @@ SurfingNoPlaceToGetOffText: ; da51 (3:5a51)
db "@"
ItemUsePokedex: ; da56 (3:5a56)
ld a,$29
jp Predef
predef_jump ShowPokedexMenu
ItemUseEvoStone: ; da5b (3:5a5b)
ld a,[W_ISINBATTLE]
@ -783,8 +777,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld de,wBattleMonMaxHP
ld bc,10
call CopyData ; copy party stats to in-battle stat data
ld a,$28
call Predef
predef Func_3ed02
jp .doneHealing
.healHP
inc hl ; hl = address of current HP
@ -814,8 +807,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld c,a
ld hl,wccf5
ld b,$02
ld a,$10
call Predef
predef FlagActionPredef
ld a,c
and a
jr z,.next
@ -823,8 +815,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld c,a
ld hl,wPartyAliveFlags
ld b,$01
ld a,$10
call Predef
predef FlagActionPredef
.next
pop bc
pop de
@ -934,8 +925,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld [$fff6],a
ld a,$02
ld [wListMenuID],a
ld a,$48
call Predef ; animate HP bar decrease of pokemon that used Softboiled
predef UpdateHPBar2 ; animate HP bar decrease of pokemon that used Softboiled
ld a,[$fff6]
res 0,a
ld [$fff6],a
@ -1085,8 +1075,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld [$fff6],a
ld a,$02
ld [wListMenuID],a
ld a,$48
call Predef ; animate the HP bar lengthening
predef UpdateHPBar2 ; animate the HP bar lengthening
ld a,[$fff6]
res 0,a
ld [$fff6],a
@ -1285,8 +1274,7 @@ ItemUseMedicine: ; dabb (3:5abb)
call WaitForTextScrollButtonPress ; wait for button press
xor a
ld [wcc49],a
ld a,$1a
call Predef ; learn level up move, if any
predef Func_3af5b ; learn level up move, if any
xor a
ld [wccd4],a
callab Func_3ad0e ; evolve pokemon, if appropriate
@ -1356,8 +1344,7 @@ BaitRockCommon: ; df7f (3:5f7f)
ld a,$ff
.noCarry
ld [hl],a
ld a,$08
call Predef ; do animation
predef MoveAnimation ; do animation
ld c,70
jp DelayFrames
@ -2096,8 +2083,7 @@ ItemUseTMHM: ; e479 (3:6479)
.skipAdding
inc a
ld [wd11e],a
ld a,$44
call Predef ; get move ID from TM/HM ID
predef TMToMove ; get move ID from TM/HM ID
ld a,[wd11e]
ld [wd0e0],a
call GetMoveName
@ -2152,8 +2138,7 @@ ItemUseTMHM: ; e479 (3:6479)
call GoPAL_SET_CF1C
jp LoadScreenTilesFromBuffer1 ; restore saved screen
.checkIfAbleToLearnMove
ld a,$43
call Predef ; check if the pokemon can learn the move
predef CanLearnTM ; check if the pokemon can learn the move
push bc
ld a,[wWhichPokemon]
ld hl,wPartyMonNicks
@ -2171,8 +2156,7 @@ ItemUseTMHM: ; e479 (3:6479)
.checkIfAlreadyLearnedMove
callab CheckIfMoveIsKnown ; check if the pokemon already knows the move
jr c,.chooseMon
ld a,$1b
call Predef ; teach move
predef LearnMove ; teach move
pop af
ld [wcf91],a
pop af
@ -2232,8 +2216,7 @@ ThrowBallAtTrainerMon: ; e58b (3:658b)
call Delay3
ld a,TOSS_ANIM
ld [W_ANIMATIONID],a
ld a,$08
call Predef ; do animation
predef MoveAnimation ; do animation
ld hl,ThrowBallAtTrainerMonText1
call PrintText
ld hl,ThrowBallAtTrainerMonText2
@ -2321,8 +2304,7 @@ RestoreBonusPP: ; e606 (3:6606)
call AddNTimes
push hl
ld de,wcd78 - 1
ld a,$5e
call Predef ; loads the normal max PP of each of the pokemon's moves to wcd78
predef LoadMovePPs ; loads the normal max PP of each of the pokemon's moves to wcd78
pop hl
ld c,21
ld b,0
@ -2574,8 +2556,7 @@ IsKeyItem_: ; e764 (3:6764)
ld c,a
ld hl,wHPBarMaxHP
ld b,$02 ; test bit
ld a,$10
call Predef ; bitfield operation function
predef FlagActionPredef ; bitfield operation function
ld a,c
and a
ret nz
@ -2674,8 +2655,7 @@ Func_e7a4: ; e7a4 (3:67a4)
ld hl, wBoxMonNicks
ld a, $2
ld [wd07d], a
ld a, $4e
call Predef
predef AskName
ld a, [W_NUMINBOX] ; wda80
dec a
jr z, .asm_e867

View file

@ -18,8 +18,7 @@ CanLearnTM: ; 1373e (4:773e)
.TMfoundLoop
pop hl
ld b, $2 ; read corresponding bit from TM compatibility array
ld a, $10 ; FlagActionPredef
jp Predef
predef_jump FlagActionPredef
; converts TM/HM number in wd11e into move number
; HMs start at 51

View file

@ -466,10 +466,8 @@ Func_2174b: ; 2174b (8:574b)
ld a, $2
.asm_217b0
ld [wcc49], a
ld a, $36
call Predef
ld a, $37
call Predef
predef StatusScreen
predef StatusScreen2
call LoadScreenTilesFromBuffer1
call ReloadTilesetTilePatterns
call GoPAL_SET_CF1C

View file

@ -14,8 +14,7 @@ DisplayDiploma: ; 566e2 (15:66e2)
call FarCopyData2
ld hl, wTileMap
ld bc, $1012
ld a, $27
call Predef
predef Func_5ab0
ld hl, DiplomaTextPointersAndCoords ; $6784
ld c, $5
.asm_56715

View file

@ -9,8 +9,7 @@ MainMenu: ; 5af2 (1:5af2)
jr nc,.next0
; Predef 52 loads the save from SRAM to RAM
ld a,$52
call Predef
predef LoadSAV
.next0
ld c,20

View file

@ -8,8 +8,7 @@ OpenOaksPC: ; 1e915 (7:6915)
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
and a
jr nz, .asm_1e932
ld a, $56
call Predef
predef DisplayDexRating
.asm_1e932
ld hl, ClosedOaksPCText
call PrintText

View file

@ -93,8 +93,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
set 0,a
ld [$FFF6],a
add hl,bc
ld a,$60
call Predef ; draw HP bar and prints current / max HP
predef Func_128f6 ; draw HP bar and prints current / max HP
ld a,[$FFF6]
res 0,a
ld [$FFF6],a
@ -103,8 +102,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
jr .printLevel
.teachMoveMenu
push hl
ld a,$43
call Predef ; check if the pokemon can learn the move
predef CanLearnTM ; check if the pokemon can learn the move
pop hl
ld de,.ableToLearnMoveText
ld a,c

View file

@ -145,8 +145,7 @@ HandlePokedexSideMenu: ; 4006d (10:406d)
call PlaySound ; play sound
jr .handleMenuInput
.choseArea
ld a,$4a
call Predef ; display pokemon areas
predef LoadTownMap_Nest ; display pokemon areas
ld b,0
jr .exitSideMenu
@ -392,8 +391,7 @@ IsPokemonBitSet: ; 402c2 (10:42c2)
dec a
ld c,a
ld b,2
ld a,$10
call Predef
predef FlagActionPredef
ld a,c
and a
ret

View file

@ -257,8 +257,7 @@ HandlePrizeChoice: ; 528c6 (14:68c6)
ld hl,$FFA1
ld de,wPlayerCoins + 1
ld c,$02 ; how many bytes
ld a,$0C
call Predef ; subtract coins (BCD daa operations)
predef SubBCDPredef ; subtract coins (BCD daa operations)
jp PrintPrizePrice
.BagFull
ld hl,PrizeRoomBagIsFullTextPtr

View file

@ -1,6 +1,5 @@
StartMenu_Pokedex: ; 13095 (4:7095)
ld a,$29
call Predef
predef ShowPokedexMenu
call LoadScreenTilesFromBuffer2 ; restore saved screen
call Delay3
call LoadGBPal
@ -98,10 +97,8 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
call ClearSprites
xor a
ld [wcc49],a
ld a,$36
call Predef
ld a,$37
call Predef
predef StatusScreen
predef StatusScreen2
call ReloadMapData
jp StartMenu_Pokemon
.choseOutOfBattleMove
@ -155,8 +152,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
.cut
bit 1,a ; does the player have the Cascade Badge?
jp z,.newBadgeRequired
ld a,$3c
call Predef
predef UsedCut
ld a,[wcd6a]
and a
jp z,.loop
@ -181,8 +177,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
.strength
bit 3,a ; does the player have the Rainbow Badge?
jp z,.newBadgeRequired
ld a,$5b
call Predef
predef PrintStrengthTxt
call GBPalWhiteOutWithDelay3
jp .goBackToMap
.flash
@ -515,8 +510,7 @@ StartMenu_TrainerInfo: ; 13460 (4:7460)
xor a
ld [$ffd7],a
call DrawTrainerInfo
ld a,$2e
call Predef ; draw badges
predef DrawBadges ; draw badges
ld b,$0d
call GoPAL_SET
call GBPalNormal
@ -535,8 +529,7 @@ StartMenu_TrainerInfo: ; 13460 (4:7460)
DrawTrainerInfo: ; 1349a (4:749a)
ld de,RedPicFront
ld bc,(BANK(RedPicFront) << 8) | $01
ld a,$3b
call Predef
predef Predef3B
call DisableLCD
FuncCoord 0,2
ld hl,Coord
@ -711,8 +704,7 @@ StartMenu_SaveReset: ; 135e3 (4:75e3)
ld a,[wd72e]
bit 6,a ; is the player using the link feature?
jp nz,Init
ld a,$3f
call Predef ; save the game
predef SaveSAV ; save the game
call LoadScreenTilesFromBuffer2 ; restore saved screen
jp HoldTextDisplayOpen

View file

@ -84,8 +84,7 @@ StatusScreen: ; 12953 (4:6953)
ld a, [W_MONHDEXNUM]
ld [wd11e], a
ld [wd0b5], a
ld a, $3a
call Predef
predef IndexToPokedex
FuncCoord 3,7
ld hl, Coord
ld de, wd11e
@ -93,8 +92,7 @@ StatusScreen: ; 12953 (4:6953)
call PrintNumber ; Pokémon no.
FuncCoord 11,10
ld hl, Coord
ld a, $4b
call Predef ; Prints the type (?)
predef Func_27d6b ; Prints the type (?)
ld hl, NamePointers2 ; $6a9d
call .unk_12a7e
ld d, h

View file

@ -71,8 +71,7 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0)
ld hl, $ffde
ld de, wPlayerMoney + 2 ; wd349
ld c, $3
ld a, $c ; SubBCDPredef
call Predef
predef SubBCDPredef
ld a, $13
ld [wd125], a
jp DisplayTextBoxID

View file

@ -377,8 +377,7 @@ Func_718c3: ; 718c3 (1c:58c3)
GetPartyMonSpriteID: ; 718e9 (1c:58e9)
ld [wd11e], a
ld a, $3a
call Predef
predef IndexToPokedex
ld a, [wd11e]
ld c, a
dec a

View file

@ -41,8 +41,7 @@ OakSpeech: ; 6115 (1:6115)
call ClearScreen
call LoadTextBoxTilePatterns
call SetDefaultNames
ld a,$18
call Predef
predef InitPlayerData2
ld hl,wNumBoxItems
ld a,POTION
ld [wcf91],a
@ -234,5 +233,4 @@ IntroPredef3B: ; 62a4 (1:62a4)
.next
xor a
ld [$FFE1],a
ld a,1
jp Predef
predef_jump Func_3f0c6

View file

@ -8,8 +8,7 @@ PrintCardKeyText: ; 52673 (14:6673)
ret z
cp b
jr nz, .asm_5267a
ld a, $35
call Predef
predef Func_c586
ld a, [wcfc6]
cp $18
jr z, .asm_5269c
@ -49,8 +48,7 @@ PrintCardKeyText: ; 52673 (14:6673)
ld a, $e
.asm_526ca
ld [wd09f], a
ld a, $17
call Predef
predef Func_ee9e
ld hl, wd126
set 5, [hl]
ld a, (SFX_1f_57 - SFX_Headers_1f) / 3

View file

@ -6,8 +6,7 @@ HiddenItems: ; 76688 (1d:6688)
ld a, [wTrainerScreenX]
ld c, a
ld b, $2
ld a, $10
call Predef
predef FlagActionPredef
ld a, c
and a
ret nz
@ -35,8 +34,7 @@ FoundHiddenItemText: ; 7675b (1d:675b)
ld a, [wTrainerScreenX]
ld c, a
ld b, $1
ld a, $10
call Predef
predef FlagActionPredef
ld a, (SFX_02_3b - SFX_Headers_02) / 3
call PlaySoundWaitForCurrent ; play sound
call WaitForSoundToFinish ; wait for sound to finish playing
@ -55,8 +53,7 @@ HiddenItemBagFullText: ; 76794 (1d:6794)
HiddenCoins: ; 76799 (1d:6799)
ld b, COIN_CASE
ld a, $1c
call Predef
predef IsItemInBag_
ld a, b
and a
ret z
@ -67,8 +64,7 @@ HiddenCoins: ; 76799 (1d:6799)
ld a, [wTrainerScreenX]
ld c, a
ld b, $2
ld a, $10
call Predef
predef FlagActionPredef
ld a, c
and a
ret nz
@ -104,14 +100,12 @@ HiddenCoins: ; 76799 (1d:6799)
ld de, wPlayerCoins + 1
ld hl, $ffa1
ld c, $2
ld a, $b ; AddBCDPredef
call Predef
predef AddBCDPredef
ld hl, wd6fe
ld a, [wTrainerScreenX]
ld c, a
ld b, $1
ld a, $10
call Predef
predef FlagActionPredef
call EnableAutoTextBoxDrawing
ld a, [wPlayerCoins]
cp $99

View file

@ -32,8 +32,7 @@ PickupItem:
ld a, [$ffdb]
ld [wcc4d], a
ld a, $11 ; HideObject
call Predef
predef HideObject
ld a, 1
ld [wcc3c], a
ld hl, FoundItemText

View file

@ -5,8 +5,7 @@ HandleLedges: ; 1a672 (6:6672)
ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET
and a ; OVERWORLD
ret nz
ld a, $35
call Predef
predef Func_c586
ld a, [wSpriteStateData1 + 9]
ld b, a
FuncCoord 8, 9

View file

@ -458,8 +458,7 @@ InitializeSpriteScreenPosition: ; 50bd (1:50bd)
; tests if sprite is off screen or otherwise unable to do anything
CheckSpriteAvailability: ; 50dc (1:50dc)
ld a, $12
call Predef
predef IsObjectHidden
ld a, [$ffe5]
and a
jp nz, .spriteInvisible

View file

@ -86,8 +86,7 @@ Func_1a485: ; 1a485 (6:6485)
ld a, [wcca1]
ld [wcd38], a
ld [$ff95], a
ld a, $23
call Predef
predef Func_f9a0
call Func_3486
ld a, $2
ld [wcf10], a
@ -145,8 +144,7 @@ Func_1a4f4: ; 1a4f4 (6:64f4)
ret nz
ld a, $0
ld [wcc4d], a
ld a, $11
call Predef
predef HideObject
ld hl, wd730
res 7, [hl]
ld hl, wd72e
@ -175,8 +173,7 @@ Func_1a514: ; 1a514 (6:6514)
ld [wcd38], a
xor a
ld [wd12f], a
ld a, $4f
call Predef
predef PewterGuys
ld hl, wcc97
ld de, RLEList_PewterMuseumGuy
call DecodeRLEList
@ -233,8 +230,7 @@ Func_1a581: ; 1a581 (6:6581)
ld [wcd38], a
ld a, $1
ld [wd12f], a
ld a, $4f
call Predef
predef PewterGuys
ld hl, wcc97
ld de, RLEList_PewterGymGuy
call DecodeRLEList

View file

@ -421,8 +421,7 @@ Func_707b6: ; 707b6 (1c:47b6)
xor a
ld [hli], a
ld [hl], a
ld a, $4c
call Predef
predef EmotionBubble
ld a, [wSpriteStateData1 + 2]
cp $4
jr nz, .asm_70833

View file

@ -268,8 +268,7 @@ DeterminePaletteIDOutOfBattle: ; 71f9d (1c:5f9d)
and a
jr z, .idZero
push bc
ld a, $3A
call Predef ; turn Pokemon ID number into Pokedex number
predef IndexToPokedex ; turn Pokemon ID number into Pokedex number
pop bc
ld a, [wd11e]
.idZero

View file

@ -49,7 +49,7 @@ GetPredefPointer:
ret
PredefPointers: ; 4fe79 (13:7e79)
PredefPointers:: ; 4fe79 (13:7e79)
; these are pointers to ASM routines.
; they appear to be used in overworld map scripts.
add_predef Func_3cd60

View file

@ -3,8 +3,7 @@
StarterDex: ; 5c0dc (17:40dc)
ld a, %01001011 ; set starter flags
ld [wPokedexOwned], a ; wPokedexOwned
ld a, $3d
call Predef
predef ShowPokedexData
xor a ; unset starter flags
ld [wPokedexOwned], a ; wPokedexOwned
ret

View file

@ -17,8 +17,7 @@ PromptUserToPlaySlots: ; 3730e (d:730e)
xor a
ld [hli], a
ld [hl], $2
ld a, $4c
call Predef
predef EmotionBubble
call GBPalWhiteOutWithDelay3
call LoadSlotMachineTiles
call LoadFontTilePatterns
@ -618,8 +617,7 @@ SlotMachine_37741: ; 37741 (d:7741)
ld [hli], a
ld de, wPlayerCoins + 1
ld c, $2
ld a, $c ; SubBCDPredef
call Predef
predef SubBCDPredef
SlotMachine_37754: ; 37754 (d:7754)
ld hl, wTileMap + $19
@ -660,8 +658,7 @@ SlotMachine_3776b: ; 3776b (d:776b)
ld hl, wcd47
ld de, wPlayerCoins + 1
ld c, $2
ld a, $b ; AddBCDPredef
call Predef
predef AddBCDPredef
call SlotMachine_37754
call SlotMachine_3775f
ld a, (SFX_1f_65 - SFX_Headers_1f) / 3

View file

@ -766,5 +766,4 @@ Func_41676: ; 41676 (10:5676)
ld [W_ANIMATIONID], a ; W_ANIMATIONID
xor a
ld [wcc5b], a
ld a, $8
jp Predef
predef_jump MoveAnimation

View file

@ -5,8 +5,7 @@ Func_42769: ; 42769 (10:6769)
call PlaceString
ld a,[wWhichTrade]
ld [wd11e],a
ld a,$3A
call Predef
predef IndexToPokedex
FuncCoord 9, 0
ld hl,Coord
ld de,wd11e
@ -33,8 +32,7 @@ Func_427a7: ; 427a7 (10:67a7)
call PlaceString
ld a,[wTrainerEngageDistance]
ld [wd11e],a
ld a,$3A
call Predef
predef IndexToPokedex
FuncCoord 9, 10
ld hl,Coord
ld de,wd11e