mirror of https://github.com/pret/pokecrystal.git
Use a predef macro that takes labels instead of juggling constants.
Besides making predefs convenient, naming a predef no longer requires adding or renaming a predef constant. This also lets predefs be rearranged at will.
This commit is contained in:
parent
0b7dfeb9b2
commit
8639fcd29b
|
@ -643,8 +643,7 @@ asm_38436: ; 38436 (e:4436)
|
|||
xor a
|
||||
ld [$d10a], a
|
||||
call Function3839a
|
||||
ld a, $b
|
||||
call Predef
|
||||
predef Functionc6e0
|
||||
jp Function38387
|
||||
|
||||
|
||||
|
|
|
@ -1336,8 +1336,7 @@ AIScoring_Encore: ; 38c3b
|
|||
push hl
|
||||
ld a, [wEnemyMoveStruct + MOVE_TYPE]
|
||||
ld hl, EnemyMonType1
|
||||
ld a, $41
|
||||
call Predef
|
||||
predef Function347d3
|
||||
|
||||
pop hl
|
||||
ld a, [$d265]
|
||||
|
|
|
@ -954,22 +954,18 @@ BattleAnimCmd_DC: ; cc5dc (33:45dc)
|
|||
ld a, [TempBattleMonSpecies] ; $d205
|
||||
ld [CurPartySpecies], a ; $d108
|
||||
ld hl, BattleMonDVs ; $c632
|
||||
ld a, PREDEF_GET_UNOWN_LETTER
|
||||
call Predef
|
||||
predef GetUnownLetter
|
||||
ld de, $8000
|
||||
ld a, $3c
|
||||
call Predef
|
||||
predef Function51077
|
||||
jr .done
|
||||
|
||||
.player
|
||||
ld a, [TempEnemyMonSpecies] ; $d204
|
||||
ld [CurPartySpecies], a ; $d108
|
||||
ld hl, EnemyMonDVs ; $d20c
|
||||
ld a, PREDEF_GET_UNOWN_LETTER
|
||||
call Predef
|
||||
predef GetUnownLetter
|
||||
ld de, $8000
|
||||
ld a, $3d
|
||||
call Predef
|
||||
predef Function5116c
|
||||
|
||||
.done
|
||||
pop af
|
||||
|
@ -1194,20 +1190,16 @@ BattleAnimCmd_E6: ; cc776 (33:4776)
|
|||
jr z, .player
|
||||
|
||||
ld hl, BattleMonDVs ; $c632
|
||||
ld a, PREDEF_GET_UNOWN_LETTER
|
||||
call Predef
|
||||
predef GetUnownLetter
|
||||
ld de, $9000
|
||||
ld a, $3c
|
||||
call Predef
|
||||
predef Function51077
|
||||
jr .done
|
||||
|
||||
.player
|
||||
ld hl, EnemyMonDVs ; $d20c
|
||||
ld a, PREDEF_GET_UNOWN_LETTER
|
||||
call Predef
|
||||
predef GetUnownLetter
|
||||
ld de, $9310
|
||||
ld a, $3d
|
||||
call Predef
|
||||
predef Function5116c
|
||||
|
||||
.done
|
||||
pop af
|
||||
|
|
135
battle/core.asm
135
battle/core.asm
|
@ -1311,8 +1311,7 @@ Function3c874: ; 3c874
|
|||
xor a
|
||||
ld [$cfca], a
|
||||
ld [FXAnimIDHi], a
|
||||
ld a, $37
|
||||
call Predef
|
||||
predef PlayBattleAnim
|
||||
call SwitchTurnCore
|
||||
|
||||
.asm_3c8d3
|
||||
|
@ -2078,8 +2077,7 @@ Function3cd3c: ; 3cd3c
|
|||
.asm_3cd4a
|
||||
push bc
|
||||
ld [$d10a], a
|
||||
ld a, $b
|
||||
call Predef
|
||||
predef Functionc6e0
|
||||
pop bc
|
||||
ret
|
||||
; 3cd55
|
||||
|
@ -2461,8 +2459,7 @@ Function3cfa4: ; 3cfa4
|
|||
ld a, [BattleType]
|
||||
cp BATTLETYPE_CANLOSE
|
||||
jr nz, .asm_3cfe8
|
||||
ld a, $2
|
||||
call Predef
|
||||
predef Functionc658
|
||||
|
||||
.asm_3cfe8
|
||||
ld a, [$c2cc]
|
||||
|
@ -2791,8 +2788,7 @@ Function3d1aa: ; 3d1aa
|
|||
ld c, a
|
||||
ld hl, $c664
|
||||
ld b, $0
|
||||
ld a, $3
|
||||
call Predef
|
||||
predef FlagPredef
|
||||
ld hl, EnemySubStatus3
|
||||
res 2, [hl]
|
||||
xor a
|
||||
|
@ -3379,12 +3375,10 @@ Function3d581: ; 3d581
|
|||
ld hl, $c664
|
||||
ld b, $1
|
||||
push bc
|
||||
ld a, $3
|
||||
call Predef
|
||||
predef FlagPredef
|
||||
pop bc
|
||||
ld hl, $c6fc
|
||||
ld a, $3
|
||||
jp Predef
|
||||
predef_jump FlagPredef
|
||||
; 3d599
|
||||
|
||||
Function3d599: ; 3d599
|
||||
|
@ -3599,8 +3593,7 @@ Function3d6ca: ; 3d6ca
|
|||
and a
|
||||
jr nz, .asm_3d708
|
||||
ld hl, EnemyMonDVs
|
||||
ld a, PREDEF_GET_UNOWN_LETTER
|
||||
call Predef
|
||||
predef GetUnownLetter
|
||||
ld a, [UnownLetter]
|
||||
ld [$def4], a
|
||||
|
||||
|
@ -3710,8 +3703,7 @@ Function3d7c7: ; 3d7c7
|
|||
call GetBaseData
|
||||
ld a, $1
|
||||
ld [MonType], a
|
||||
ld a, $1f
|
||||
call Predef
|
||||
predef Function5084a
|
||||
call Function3f47c
|
||||
xor a
|
||||
ld [$cfca], a
|
||||
|
@ -3735,8 +3727,7 @@ Function3d7c7: ; 3d7c7
|
|||
hlcoord 12, 0
|
||||
ld d, $0
|
||||
ld e, $0
|
||||
ld a, $47
|
||||
call Predef
|
||||
predef Functiond008e
|
||||
jr .asm_3d82c
|
||||
|
||||
.asm_3d821
|
||||
|
@ -4192,8 +4183,7 @@ Function3db32: ; 3db32
|
|||
|
||||
Function3db5f: ; 3db5f
|
||||
ld hl, BattleMonDVs
|
||||
ld a, PREDEF_GET_UNOWN_LETTER
|
||||
call Predef
|
||||
predef GetUnownLetter
|
||||
hlcoord 1, 5
|
||||
ld b, 7
|
||||
ld c, 8
|
||||
|
@ -4376,8 +4366,7 @@ Function3dc5b: ; 3dc5b
|
|||
ld c, a
|
||||
ld hl, $c664
|
||||
ld b, $0
|
||||
ld a, $3
|
||||
call Predef
|
||||
predef FlagPredef
|
||||
call Function3d43b
|
||||
ld hl, BattleText_0x80a75
|
||||
jr .asm_3dcdf
|
||||
|
@ -4523,8 +4512,7 @@ Function3dd2f: ; 3dd2f
|
|||
|
||||
.asm_3dda4
|
||||
ld [$d10a], a
|
||||
ld a, $b
|
||||
call Predef
|
||||
predef Functionc6e0
|
||||
Function3ddac:
|
||||
call RefreshBattleHuds
|
||||
callab GetOpponentItem
|
||||
|
@ -4548,8 +4536,7 @@ Function3ddc8: ; 3ddc8
|
|||
xor a
|
||||
ld [$cfca], a
|
||||
ld [FXAnimIDHi], a
|
||||
ld a, $37
|
||||
call Predef
|
||||
predef PlayBattleAnim
|
||||
call SwitchTurnCore
|
||||
pop bc
|
||||
pop de
|
||||
|
@ -4815,8 +4802,7 @@ DrawPlayerHUD: ; 3df58
|
|||
ld b, OTPARTYMON
|
||||
xor a
|
||||
ld [MonType], a
|
||||
ld a, PREDEF_DRAW_PLAYER_HP
|
||||
call Predef
|
||||
predef DrawPlayerHP
|
||||
|
||||
; Exp bar
|
||||
push de
|
||||
|
@ -4912,8 +4898,7 @@ PrintPlayerHUD: ; 3dfbf
|
|||
push af
|
||||
push hl
|
||||
ld de, BattleMonStatus
|
||||
ld a, $21
|
||||
call Predef
|
||||
predef Function50d2e
|
||||
pop hl
|
||||
pop bc
|
||||
ret nz
|
||||
|
@ -4986,8 +4971,7 @@ Function3e043: ; 3e043
|
|||
push af
|
||||
push hl
|
||||
ld de, EnemyMonStatus
|
||||
ld a, $21
|
||||
call Predef
|
||||
predef Function50d2e
|
||||
pop hl
|
||||
pop bc
|
||||
jr nz, .asm_3e0be
|
||||
|
@ -5593,8 +5577,7 @@ Function3e4bc: ; 3e4bc
|
|||
.asm_3e513
|
||||
ld a, SCREEN_WIDTH
|
||||
ld [Buffer1], a
|
||||
ld a, PREDEF_LIST_MOVES
|
||||
call Predef
|
||||
predef ListMoves
|
||||
|
||||
ld b, 5
|
||||
ld a, [$d235]
|
||||
|
@ -5921,8 +5904,7 @@ MoveInfoBox: ; 3e6c8
|
|||
ld a, [wPlayerMoveStruct + MOVE_ANIM]
|
||||
ld b, a
|
||||
hlcoord 2, 10
|
||||
ld a, PREDEF_PRINT_MOVE_TYPE
|
||||
call Predef
|
||||
predef PrintMoveType
|
||||
|
||||
.done
|
||||
ret
|
||||
|
@ -6387,8 +6369,7 @@ LoadEnemyMon: ; 3e8eb
|
|||
|
||||
; Get letter based on DVs
|
||||
ld hl, EnemyMonDVs
|
||||
ld a, PREDEF_GET_UNOWN_LETTER
|
||||
call Predef
|
||||
predef GetUnownLetter
|
||||
; Can't use any letters that haven't been unlocked
|
||||
; If combined with forced shiny battletype, causes an infinite loop
|
||||
call CheckUnownLetter
|
||||
|
@ -6469,8 +6450,7 @@ LoadEnemyMon: ; 3e8eb
|
|||
ld de, EnemyMonMaxHP
|
||||
ld b, $00
|
||||
ld hl, $d201 ; ?
|
||||
ld a, PREDEF_FILLSTATS
|
||||
call Predef
|
||||
predef Functione167
|
||||
|
||||
; If we're in a trainer battle,
|
||||
; get the rest of the parameters from the party struct
|
||||
|
@ -6588,8 +6568,7 @@ LoadEnemyMon: ; 3e8eb
|
|||
; Make sure the predef knows this isn't a partymon
|
||||
ld [MagikarpLength], a
|
||||
; Fill moves based on level
|
||||
ld a, PREDEF_FILLMOVES
|
||||
call Predef
|
||||
predef FillMoves
|
||||
|
||||
.PP
|
||||
; Trainer battle?
|
||||
|
@ -6600,8 +6579,7 @@ LoadEnemyMon: ; 3e8eb
|
|||
; Fill wild PP
|
||||
ld hl, EnemyMonMoves
|
||||
ld de, EnemyMonPP
|
||||
ld a, PREDEF_FILLPP
|
||||
call Predef
|
||||
predef FillPP
|
||||
jr .Finish
|
||||
|
||||
.TrainerPP
|
||||
|
@ -6654,8 +6632,7 @@ LoadEnemyMon: ; 3e8eb
|
|||
ld c, a
|
||||
ld b, 1 ; set
|
||||
ld hl, PokedexSeen
|
||||
ld a, PREDEF_FLAG
|
||||
call Predef
|
||||
predef FlagPredef
|
||||
|
||||
ld hl, EnemyMonStats
|
||||
ld de, EnemyStats
|
||||
|
@ -7294,8 +7271,7 @@ Function3ee17: ; 3ee17
|
|||
ld a, d
|
||||
ld [FXAnimIDHi], a
|
||||
call WaitBGMap
|
||||
ld a, $37
|
||||
jp Predef
|
||||
predef_jump PlayBattleAnim
|
||||
; 3ee27
|
||||
|
||||
Function3ee27: ; 3ee27
|
||||
|
@ -7340,8 +7316,7 @@ Function3ee3b: ; 3ee3b
|
|||
ld c, a
|
||||
ld b, $2
|
||||
ld d, $0
|
||||
ld a, $3
|
||||
call Predef
|
||||
predef FlagPredef
|
||||
ld a, c
|
||||
and a
|
||||
pop bc
|
||||
|
@ -7514,8 +7489,7 @@ Function3ee3b: ; 3ee3b
|
|||
.asm_3ef74
|
||||
xor a
|
||||
ld [MonType], a
|
||||
ld a, $1f
|
||||
call Predef
|
||||
predef Function5084a
|
||||
callab Function50e1b
|
||||
pop bc
|
||||
ld hl, PartyMon1Level - PartyMon1
|
||||
|
@ -7551,8 +7525,7 @@ Function3ee3b: ; 3ee3b
|
|||
add hl, bc
|
||||
push bc
|
||||
ld b, $1
|
||||
ld a, $c
|
||||
call Predef
|
||||
predef Functione167
|
||||
pop bc
|
||||
pop de
|
||||
ld hl, $0025
|
||||
|
@ -7628,16 +7601,14 @@ Function3ee3b: ; 3ee3b
|
|||
.asm_3f057
|
||||
xor a
|
||||
ld [MonType], a
|
||||
ld a, $1f
|
||||
call Predef
|
||||
predef Function5084a
|
||||
hlcoord 9, 0
|
||||
ld b, $a
|
||||
ld c, $9
|
||||
call TextBox
|
||||
hlcoord 11, 1
|
||||
ld bc, $0004
|
||||
ld a, $28
|
||||
call Predef
|
||||
predef Function50b7b
|
||||
ld c, $1e
|
||||
call DelayFrames
|
||||
call Functiona80
|
||||
|
@ -7657,8 +7628,7 @@ Function3ee3b: ; 3ee3b
|
|||
ld a, b
|
||||
ld [CurPartyLevel], a
|
||||
push bc
|
||||
ld a, $1a
|
||||
call Predef
|
||||
predef LearnLevelMoves
|
||||
pop bc
|
||||
ld a, b
|
||||
cp c
|
||||
|
@ -7669,8 +7639,7 @@ Function3ee3b: ; 3ee3b
|
|||
ld a, [CurPartyMon]
|
||||
ld c, a
|
||||
ld b, $1
|
||||
ld a, $3
|
||||
call Predef
|
||||
predef FlagPredef
|
||||
pop af
|
||||
ld [CurPartyLevel], a
|
||||
|
||||
|
@ -7787,8 +7756,7 @@ Function3f136: ; 3f136
|
|||
ld [DefaultFlypoint], a
|
||||
xor a
|
||||
ld [MonType], a
|
||||
ld a, $1f
|
||||
call Predef
|
||||
predef Function5084a
|
||||
ld a, [TempMonLevel]
|
||||
ld b, a
|
||||
ld e, a
|
||||
|
@ -8312,11 +8280,9 @@ Function3f447: ; 3f447
|
|||
ld a, [BattleMonSpecies]
|
||||
ld [CurPartySpecies], a
|
||||
ld hl, BattleMonDVs
|
||||
ld a, PREDEF_GET_UNOWN_LETTER
|
||||
call Predef
|
||||
predef GetUnownLetter
|
||||
ld de, $9310
|
||||
ld a, $3d
|
||||
call Predef
|
||||
predef Function5116c
|
||||
pop af
|
||||
ld [CurPartySpecies], a
|
||||
ret
|
||||
|
@ -8351,11 +8317,9 @@ Function3f486: ; 3f486
|
|||
ld [CurPartySpecies], a
|
||||
call GetBaseData
|
||||
ld hl, EnemyMonDVs
|
||||
ld a, PREDEF_GET_UNOWN_LETTER
|
||||
call Predef
|
||||
predef GetUnownLetter
|
||||
ld de, VTiles2
|
||||
ld a, $3e
|
||||
call Predef
|
||||
predef Function5108b
|
||||
pop af
|
||||
ld [CurPartySpecies], a
|
||||
ret
|
||||
|
@ -8502,8 +8466,7 @@ Function3f594: ; 3f594
|
|||
ld [$c6e6], a
|
||||
hlcoord 12, 0
|
||||
lb bc, 7, 7
|
||||
ld a, PREDEF_FILL_BOX
|
||||
call Predef
|
||||
predef FillBox
|
||||
ld a, $ff
|
||||
ld [CurOTMon], a
|
||||
ld a, TRAINER_BATTLE
|
||||
|
@ -8549,8 +8512,7 @@ Function3f607: ; 3f607
|
|||
ld bc, NUM_MOVES
|
||||
call CopyBytes
|
||||
ld hl, EnemyMonDVs
|
||||
ld a, PREDEF_GET_UNOWN_LETTER
|
||||
call Predef
|
||||
predef GetUnownLetter
|
||||
ld a, [CurPartySpecies]
|
||||
cp UNOWN
|
||||
jr nz, .asm_3f648
|
||||
|
@ -8562,15 +8524,13 @@ Function3f607: ; 3f607
|
|||
|
||||
.asm_3f648
|
||||
ld de, VTiles2
|
||||
ld a, $3e
|
||||
call Predef
|
||||
predef Function5108b
|
||||
xor a
|
||||
ld [TrainerClass], a
|
||||
ld [$ffad], a
|
||||
hlcoord 12, 0
|
||||
lb bc, 7, 7
|
||||
ld a, PREDEF_FILL_BOX
|
||||
call Predef
|
||||
predef FillBox
|
||||
ret
|
||||
; 3f662
|
||||
|
||||
|
@ -8650,8 +8610,7 @@ Function3f6a5: ; 3f6a5
|
|||
call Function3f71d
|
||||
xor a
|
||||
ld [$d1e9], a
|
||||
ld a, $1c
|
||||
call Predef
|
||||
predef Function421e6
|
||||
callba Function2ed44
|
||||
ret
|
||||
; 3f6d0
|
||||
|
@ -9325,8 +9284,7 @@ Function3fb6c: ; 3fb6c
|
|||
ld [$ffad], a
|
||||
hlcoord 2, 6
|
||||
ld bc, $0606
|
||||
ld a, $13
|
||||
call Predef
|
||||
predef FillBox
|
||||
xor a
|
||||
ld [hWY], a
|
||||
ld [rWY], a
|
||||
|
@ -9397,8 +9355,7 @@ GetBattleBackpic: ; 3fbff
|
|||
.Decompress
|
||||
ld de, $9310
|
||||
ld c, $31
|
||||
ld a, PREDEF_DECOMPRESS
|
||||
call Predef
|
||||
predef DecompressPredef
|
||||
ret
|
||||
; 3fc30
|
||||
|
||||
|
@ -9421,8 +9378,7 @@ Function3fc30: ; 3fc30
|
|||
ld [$ffad], a
|
||||
hlcoord 2, 6
|
||||
ld bc, $0606
|
||||
ld a, $13
|
||||
call Predef
|
||||
predef FillBox
|
||||
ret
|
||||
; 3fc5b
|
||||
|
||||
|
@ -9503,8 +9459,7 @@ BattleStartMessage: ; 3fc8b
|
|||
hlcoord 12, 0
|
||||
ld d, $0
|
||||
ld e, $1
|
||||
ld a, $47
|
||||
call Predef
|
||||
predef Functiond008e
|
||||
jr .asm_3fceb
|
||||
|
||||
.asm_3fce0
|
||||
|
|
|
@ -3227,8 +3227,7 @@ BattleCommand11: ; 351c0
|
|||
ld [$d1ef], a
|
||||
ld h, b
|
||||
ld l, c
|
||||
ld a, $b
|
||||
call Predef
|
||||
predef Functionc6e0
|
||||
call RefreshBattleHuds
|
||||
|
||||
call SwitchTurn
|
||||
|
@ -4607,8 +4606,7 @@ BattleCommand42: ; 35926
|
|||
ld a, $1
|
||||
ld [$d10a], a
|
||||
hlcoord 10, 9
|
||||
ld a, $b
|
||||
call Predef
|
||||
predef Functionc6e0
|
||||
ld hl, EnemyMonHP
|
||||
ld a, [hli]
|
||||
ld [$d1ed], a
|
||||
|
@ -4623,8 +4621,7 @@ BattleCommand42: ; 35926
|
|||
ld [$d10a], a
|
||||
call ResetDamage
|
||||
hlcoord 2, 2
|
||||
ld a, $b
|
||||
call Predef
|
||||
predef Functionc6e0
|
||||
callba Function178000
|
||||
|
||||
ld hl, SharedPainText
|
||||
|
@ -4767,8 +4764,7 @@ BattleCommand44: ; 359e6
|
|||
|
||||
ld a, [hl]
|
||||
ld [$d265], a
|
||||
ld a, $29
|
||||
call Predef
|
||||
predef GetTypeName
|
||||
ld hl, TransformedTypeText
|
||||
jp StdBattleTextBox
|
||||
|
||||
|
@ -5341,8 +5337,7 @@ Function35d1c: ; 35d1c
|
|||
hlcoord 2, 2
|
||||
xor a
|
||||
ld [$d10a], a
|
||||
ld a, $b
|
||||
call Predef
|
||||
predef Functionc6e0
|
||||
.asm_35d7b
|
||||
jp RefreshBattleHuds
|
||||
; 35d7e
|
||||
|
@ -5401,8 +5396,7 @@ Function35d7e: ; 35d7e
|
|||
hlcoord 10, 9
|
||||
ld a, $1
|
||||
ld [$d10a], a
|
||||
ld a, $b
|
||||
call Predef
|
||||
predef Functionc6e0
|
||||
.asm_35ddd
|
||||
jp RefreshBattleHuds
|
||||
; 35de0
|
||||
|
@ -5850,8 +5844,7 @@ Function36011: ; 36011
|
|||
xor a
|
||||
.asm_3607e
|
||||
ld [$d10a], a
|
||||
ld a, $b
|
||||
call Predef
|
||||
predef Functionc6e0
|
||||
call RefreshBattleHuds
|
||||
jp UpdateBattleMonInParty
|
||||
; 3608c
|
||||
|
@ -8001,8 +7994,7 @@ BattleCommand27: ; 36cb2
|
|||
xor a
|
||||
.asm_36d0c
|
||||
ld [$d10a], a
|
||||
ld a, $b
|
||||
call Predef
|
||||
predef Functionc6e0
|
||||
call RefreshBattleHuds
|
||||
ld hl, RecoilText
|
||||
jp StdBattleTextBox
|
||||
|
|
|
@ -21,35 +21,6 @@ MONS_PER_BOX EQU 20
|
|||
NUM_BOXES EQU 14
|
||||
|
||||
|
||||
; predefs
|
||||
PREDEF_LEARN_MOVE EQU $00
|
||||
PREDEF_FLAG EQU $03
|
||||
PREDEF_FILLPP EQU $05
|
||||
PREDEF_ADDPARTYMON EQU $06
|
||||
PREDEF_FILLSTATS EQU $0C
|
||||
PREDEF_PRINT_MOVE_DESCRIPTION EQU $11
|
||||
PREDEF_UPDATE_PLAYER_HUD EQU $12
|
||||
PREDEF_FILL_BOX EQU $13
|
||||
PREDEF_UPDATE_ENEMY_HUD EQU $15
|
||||
PREDEF_START_BATTLE EQU $16
|
||||
PREDEF_FILL_IN_EXP_BAR EQU $17
|
||||
PREDEF_FILLMOVES EQU $1B
|
||||
PREDEF_LIST_MOVES EQU $20
|
||||
PREDEF_GET_GENDER EQU $24
|
||||
PREDEF_STATS_SCREEN EQU $25
|
||||
PREDEF_DRAW_PLAYER_HP EQU $26
|
||||
PREDEF_DRAW_ENEMY_HP EQU $27
|
||||
PREDEF_GET_TYPE_NAME EQU $29
|
||||
PREDEF_PRINT_MOVE_TYPE EQU $2A
|
||||
PREDEF_PRINT_TYPE EQU $2B
|
||||
PREDEF_GET_UNOWN_LETTER EQU $2D
|
||||
PREDEF_LOAD_SGB_LAYOUT EQU $31
|
||||
PREDEF_CHECK_CONTEST_MON EQU $33
|
||||
PREDEF_BATTLE_TRANSITION EQU $34
|
||||
PREDEF_PARTYMON_ITEM_NAME EQU $3B
|
||||
PREDEF_DECOMPRESS EQU $40
|
||||
|
||||
|
||||
; flag manipulation
|
||||
RESET_FLAG EQU 0
|
||||
SET_FLAG EQU 1
|
||||
|
|
|
@ -1531,8 +1531,7 @@ Script_startbattle: ; 0x97436
|
|||
; script command 0x5f
|
||||
|
||||
call Function2879
|
||||
ld a, PREDEF_START_BATTLE
|
||||
call Predef
|
||||
predef StartBattle
|
||||
ld a, [$d0ee]
|
||||
and $3f
|
||||
ld [ScriptVar], a
|
||||
|
|
|
@ -1007,8 +1007,7 @@ Functiond066e: ; d066e
|
|||
push bc
|
||||
push hl
|
||||
ld de, VTiles2
|
||||
ld a, $3e
|
||||
call Predef
|
||||
predef Function5108b
|
||||
pop hl
|
||||
pop bc
|
||||
ld d, $0
|
||||
|
|
13
home.asm
13
home.asm
|
@ -753,15 +753,14 @@ GetSGBLayout:: ; 3340
|
|||
|
||||
ld a, [hCGB]
|
||||
and a
|
||||
jr nz, .dosgb
|
||||
jr nz, .sgb
|
||||
|
||||
ld a, [hSGB]
|
||||
and a
|
||||
ret z
|
||||
|
||||
.dosgb
|
||||
ld a, $31 ; LoadSGBLayout
|
||||
jp Predef
|
||||
.sgb
|
||||
predef_jump Function864c ; LoadSGBLayout
|
||||
; 334e
|
||||
|
||||
|
||||
|
@ -1700,14 +1699,12 @@ Function378b:: ; 378b
|
|||
jr c, .asm_37ad
|
||||
push hl
|
||||
ld de, VTiles2
|
||||
ld a, $3c
|
||||
call Predef
|
||||
predef Function51077
|
||||
pop hl
|
||||
xor a
|
||||
ld [$ffad], a
|
||||
ld bc, $0707
|
||||
ld a, $13
|
||||
call Predef
|
||||
predef FillBox
|
||||
xor a
|
||||
ld [$c2c6], a
|
||||
ret
|
||||
|
|
|
@ -167,8 +167,7 @@ Init:: ; 17d
|
|||
|
||||
call DelayFrame
|
||||
|
||||
ld a, $30
|
||||
call Predef
|
||||
predef Function9853
|
||||
|
||||
call SoundRestart
|
||||
xor a
|
||||
|
|
|
@ -31,8 +31,7 @@ CheckSeenMon:: ; 339b
|
|||
|
||||
PokedexFlagAction:: ; 33a1
|
||||
ld d, 0
|
||||
ld a, PREDEF_FLAG
|
||||
call Predef
|
||||
predef FlagPredef
|
||||
ld a, c
|
||||
and a
|
||||
ret
|
||||
|
|
|
@ -8,8 +8,7 @@ GetItemDescription: ; 0x1c8955
|
|||
pop hl
|
||||
ld a, [$d265]
|
||||
ld [$cf60], a
|
||||
ld a, $11
|
||||
call Predef
|
||||
predef PrintMoveDesc
|
||||
ret
|
||||
|
||||
.nomovedesc
|
||||
|
|
|
@ -399,8 +399,7 @@ ParkBall: ; e8a2
|
|||
ld [hBattleTurn], a
|
||||
ld [Buffer2], a
|
||||
ld [$cfca], a
|
||||
ld a, $37
|
||||
call Predef
|
||||
predef PlayBattleAnim
|
||||
|
||||
ld a, [$c64e]
|
||||
and a
|
||||
|
@ -525,8 +524,7 @@ ParkBall: ; e8a2
|
|||
|
||||
ld a, [EnemyMonSpecies]
|
||||
ld [$d265], a
|
||||
ld a, $43
|
||||
call Predef
|
||||
predef Functionfb877
|
||||
|
||||
.asm_eab7
|
||||
ld a, [BattleType]
|
||||
|
@ -546,8 +544,7 @@ ParkBall: ; e8a2
|
|||
ld [MonType], a
|
||||
call ClearSprites
|
||||
|
||||
ld a, $6
|
||||
call Predef
|
||||
predef Functiond88c
|
||||
|
||||
callba Function4db49
|
||||
|
||||
|
@ -604,8 +601,7 @@ ParkBall: ; e8a2
|
|||
.asm_eb3c
|
||||
call ClearSprites
|
||||
|
||||
ld a, $9
|
||||
call Predef
|
||||
predef Functionde6e
|
||||
|
||||
callba Function4db83
|
||||
|
||||
|
@ -1265,8 +1261,7 @@ Functionee8c: ; ee8c
|
|||
ld a, PartyMon1HPExp - 1 - PartyMon1
|
||||
call GetPartyParamLocation
|
||||
ld b, $1
|
||||
ld a, $c
|
||||
jp Predef
|
||||
predef_jump Functione167
|
||||
; ee9f
|
||||
|
||||
Functionee9f: ; ee9f
|
||||
|
@ -1405,8 +1400,7 @@ RareCandy: ; ef14
|
|||
|
||||
xor a
|
||||
ld [MonType], a
|
||||
ld a, $1f
|
||||
call Predef
|
||||
predef Function5084a
|
||||
|
||||
hlcoord 9, 0
|
||||
ld b, 10
|
||||
|
@ -1415,8 +1409,7 @@ RareCandy: ; ef14
|
|||
|
||||
hlcoord 11, 1
|
||||
ld bc, $0004
|
||||
ld a, $28
|
||||
call Predef
|
||||
predef Function50b7b
|
||||
|
||||
call Functiona80
|
||||
|
||||
|
@ -1424,8 +1417,7 @@ RareCandy: ; ef14
|
|||
ld [MonType], a
|
||||
ld a, [CurPartySpecies]
|
||||
ld [$d265], a
|
||||
ld a, $1a
|
||||
call Predef
|
||||
predef LearnLevelMoves
|
||||
|
||||
xor a
|
||||
ld [$d1e9], a
|
||||
|
@ -1654,8 +1646,7 @@ Functionf0d6: ; f0d6
|
|||
ld d, 0
|
||||
ld hl, $c6fc
|
||||
ld b, CHECK_FLAG
|
||||
ld a, PREDEF_FLAG
|
||||
call Predef
|
||||
predef FlagPredef
|
||||
ld a, c
|
||||
and a
|
||||
jr z, .asm_f104
|
||||
|
@ -1664,8 +1655,7 @@ Functionf0d6: ; f0d6
|
|||
ld c, a
|
||||
ld hl, $c664
|
||||
ld b, SET_FLAG
|
||||
ld a, PREDEF_FLAG
|
||||
call Predef
|
||||
predef FlagPredef
|
||||
|
||||
.asm_f104
|
||||
xor a
|
||||
|
@ -1834,8 +1824,7 @@ Functionf1db: ; f1db (3:71db)
|
|||
call AddNTimes
|
||||
ld a, $2
|
||||
ld [$d10a], a
|
||||
ld a, $b
|
||||
jp Predef
|
||||
predef_jump Functionc6e0
|
||||
|
||||
; known jump sources: ee11 (3:6e11), ee3f (3:6e3f), ef16 (3:6f16), efaf (3:6faf), efce (3:6fce), f0ab (3:70ab), f0ca (3:70ca), f12a (3:712a), f1ab (3:71ab), f5c7 (3:75c7)
|
||||
Functionf1f9: ; f1f9 (3:71f9)
|
||||
|
@ -2971,8 +2960,7 @@ Functionf7a0: ; f7a0
|
|||
ld [$c689], a
|
||||
ld [hBattleTurn], a
|
||||
ld [$cfca], a
|
||||
ld a, $37
|
||||
call Predef
|
||||
predef PlayBattleAnim
|
||||
ld hl, BlockedTheBallText
|
||||
call PrintText
|
||||
ld hl, DontBeAThiefText
|
||||
|
@ -3119,8 +3107,7 @@ Functionf84c: ; f84c
|
|||
call GetPartyParamLocation
|
||||
push hl
|
||||
ld de, Buffer1
|
||||
ld a, PREDEF_FILLPP
|
||||
call Predef
|
||||
predef FillPP
|
||||
pop hl
|
||||
ld bc, PartyMon1PP - PartyMon1Moves
|
||||
add hl, bc
|
||||
|
|
22
macros.asm
22
macros.asm
|
@ -196,3 +196,25 @@ x = x + \1 * $40000
|
|||
endr
|
||||
ENDM
|
||||
|
||||
|
||||
add_predef: MACRO
|
||||
\1Predef::
|
||||
dw \1
|
||||
db BANK(\1)
|
||||
ENDM
|
||||
|
||||
predef_id: MACRO
|
||||
; Some functions load the predef id
|
||||
; without immediately calling Predef.
|
||||
ld a, (\1Predef - PredefPointers) / 3
|
||||
ENDM
|
||||
|
||||
predef: MACRO
|
||||
predef_id \1
|
||||
call Predef
|
||||
ENDM
|
||||
|
||||
predef_jump: MACRO
|
||||
predef_id \1
|
||||
jp Predef
|
||||
ENDM
|
||||
|
|
Loading…
Reference in New Issue