shithub: pokecrystal

Download patch

ref: 62c621d5ad47cc827d6a5b0579e4875222685f75
parent: d2f6b6febe31fe2c111243d97de029dd55e4a839
author: yenatch <[email protected]>
date: Wed Mar 27 12:19:51 EDT 2013

no more incbins in bank d

--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -184,7 +184,7 @@
 	call CantMove
 	call $399c
 	ld hl, $5f48
-	call $7e73
+	call CallBankF
 	ld a, $1
 	ld [$ffd4], a
 	ld hl, PlayerSubStatus1
@@ -389,7 +389,7 @@
 .asm_3420f
 	res 5, [hl]
 	res 6, [hl]
-	jp $7ece
+	jp Function0x37ece
 ; 34216
 
 
@@ -444,7 +444,7 @@
 	call CantMove
 	call $39b0
 	ld hl, $6036
-	call $7e73
+	call CallBankF
 	ld a, $1
 	ld [$ffd4], a
 	ld hl, EnemySubStatus1
@@ -576,7 +576,7 @@
 	ld c, $1
 	call Function0x35d1c
 
-	call $5004
+	call BattleCommand0c
 
 	call CantMove
 	jp Function0x34385
@@ -698,7 +698,7 @@
 	call z, PlayFXAnimID
 
 	ld hl, $5f48
-	call $7e73
+	call CallBankF
 
 	ld a, $1
 	ld [$ffd4], a
@@ -706,7 +706,7 @@
 	ld c, $1
 	call Function0x35d7e
 
-	jp $5004
+	jp BattleCommand0c
 ; 343db
 
 
@@ -1172,13 +1172,13 @@
 	ret
 
 .asm_345e3
-	call $7e80
+	call BattleCommandaa
 ; get move effect
 	ld a, BATTLE_VARS_MOVE_EFFECT
 	call CleanGetBattleVarPair
 ; continuous?
 	ld hl, .continuousmoves
-	ld de, $0001 ; don't skip
+	ld de, 1
 	call IsInArray
 
 ; 'has no pp left for [move]'
@@ -1648,11 +1648,11 @@
 	push hl
 	dec a
 	ld hl, $5afd
-	call $7ea1
+	call GetMoveAttr
 	and a
 	jr z, .asm_3489b ; 0x3486e $2b
 	inc hl
-	call $7ebb
+	call GetMoveByte
 	ld hl, EnemyMonType1
 	call $47d3
 	ld a, [$d265]
@@ -1734,12 +1734,12 @@
 	inc de
 	dec a
 	ld hl, $5afd
-	call $7ea1
+	call GetMoveAttr
 	and a
 	jr z, .loop
 
 	inc hl
-	call $7ebb
+	call GetMoveByte
 	ld hl, BattleMonType1
 	call $47d3
 	ld a, [$d265]
@@ -1989,12 +1989,12 @@
 	ld a, [LastEnemyCounterMove]
 	dec a
 	ld hl, $5afd
-	call $7ea1
+	call GetMoveAttr
 	and a
 	jr z, .asm_34a77
 
 	inc hl
-	call $7ebb
+	call GetMoveByte
 	ld hl, $d23d
 	call $47d3
 	ld a, [$d265]
@@ -2069,12 +2069,12 @@
 
 	dec a
 	ld hl, $5afd
-	call $7ea1
+	call GetMoveAttr
 	and a
 	jr z, .asm_34ae9
 
 	inc hl
-	call $7ebb
+	call GetMoveByte
 	ld hl, BattleMonType1
 	call $47d3
 	ld a, [$d265]
@@ -2162,12 +2162,12 @@
 
 	dec a
 	ld hl, $5afd
-	call $7ea1
+	call GetMoveAttr
 	and a
 	jr z, .asm_34b4a
 
 	inc hl
-	call $7ebb
+	call GetMoveByte
 	jr .asm_34b5d
 
 .asm_34b4a
@@ -2702,7 +2702,7 @@
 	ret nz
 
 .asm_34f21
-	call $7ed5
+	call Function0x37ed5
 	jr c, .asm_34f36
 
 	xor a
@@ -2715,7 +2715,7 @@
 
 .asm_34f36
 	call $65c3
-	jp $7e80
+	jp BattleCommandaa
 
 .Rampage
 	ld a, BATTLE_VARS_MOVE_EFFECT
@@ -2749,7 +2749,7 @@
 BattleCommand0b: ; 34f60
 	ld a, [AttackMissed]
 	and a
-	jp nz, $7e80
+	jp nz, BattleCommandaa
 
 	ld a, [hBattleTurn]
 	and a
@@ -2793,7 +2793,7 @@
 
 .asm_34fad
 ; clear sprite
-	jp $7ec7
+	jp Function0x37ec7
 .asm_34fb0
 	ld a, [$c689]
 	and $1
@@ -2817,7 +2817,7 @@
 BattleCommand92: ; 34fd1
 	ld a, [AttackMissed]
 	and a
-	jp nz, $7e80
+	jp nz, BattleCommandaa
 
 	xor a
 	jr BattleCommand91_92
@@ -2827,7 +2827,7 @@
 BattleCommand91: ; 34fdb
 	ld a, [AttackMissed]
 	and a
-	jp nz, $7e80
+	jp nz, BattleCommandaa
 
 	ld a, [hBattleTurn]
 	and a
@@ -2868,7 +2868,7 @@
 	bit 4, a
 	ret z
 
-	call $7ed5
+	call Function0x37ed5
 	jp c, BattleCommanda6
 
 	xor a
@@ -2916,7 +2916,7 @@
 	call GetBattleVarPair
 	res 5, [hl]
 	res 6, [hl]
-	call $7ece
+	call Function0x37ece
 	jp EndMoveEffect
 ; 3505e
 
@@ -3058,7 +3058,7 @@
 	call FarBattleTextBox
 	ld a, $1
 	ld [$c689], a
-	call $7e36
+	call Function0x37e36
 	ld c, $1
 	ld a, [hBattleTurn]
 	and a
@@ -4451,7 +4451,7 @@
 	ld de, EnemyMoveStruct
 	call GetMoveData
 .asm_3591a
-	call $7e01
+	call Function0x37e01
 	ld hl, $5109
 	jp FarBattleTextBox
 .asm_35923
@@ -4467,7 +4467,7 @@
 	jp nz, .asm_359cd
 	call CheckSubstituteOpp
 	jp nz, .asm_359cd
-	call $7e01
+	call Function0x37e01
 	ld hl, $c63f
 	ld de, EnemyMonMaxHPLo
 	call .asm_3597d
@@ -4589,12 +4589,12 @@
 	push hl
 	dec a
 	ld hl, $5afe
-	call $7ea1
+	call GetMoveAttr
 	ld d, a
 	pop hl
 	cp $13
 	jr z, .asm_35a50 ; 35a0b $43
-	call $7e01
+	call Function0x37e01
 
 	call SwitchTurn
 .asm_35a13
@@ -4648,11 +4648,11 @@
 	ld a, BATTLE_VARS_SUBSTATUS5_OPP
 	call GetBattleVarPair
 	set 5, [hl]
-	call $7e01
+	call Function0x37e01
 	ld hl, $5136
 	jp FarBattleTextBox
 .asm_35a6e
-	call $7e77
+	call Function0x37e77
 	jp PrintDidntAffect
 ; 35a74
 
@@ -4664,7 +4664,7 @@
 	ld a, [InLinkBattle]
 	and a
 	jr z, .asm_35a83 ; 35a7b $6
-	call $7e77
+	call Function0x37e77
 	jp PrintNothingHappened
 .asm_35a83
 	call CheckSubstituteOpp
@@ -4712,7 +4712,7 @@
 	push hl
 	dec a
 	ld hl, $5b00
-	call $7ea1
+	call GetMoveAttr
 	pop hl
 	ld bc, $0006
 	add hl, bc
@@ -4749,11 +4749,11 @@
 	ld [hl], a
 .asm_35b04
 	call $34f8
-	call $7e01
+	call Function0x37e01
 	ld hl, $5143
 	jp FarBattleTextBox
 .asm_35b10
-	call $7e77
+	call Function0x37e77
 	jp PrintDidntAffect
 ; 35b16
 
@@ -4764,7 +4764,7 @@
 ; If the opponent isn't frozen, raise Attack one stage.
 ; If the opponent is frozen, thaw them and raise Accuracy two stages.
 
-	call $7e01
+	call Function0x37e01
 
 	ld a, BATTLE_VARS_STATUS_OPP
 	call GetBattleVarPair
@@ -4848,11 +4848,11 @@
 	pop af
 	ld [$c689], a
 .asm_35b9a
-	call $7e36
+	call Function0x37e36
 	call UpdateMoveData
 	jp ResetTurn
 .asm_35ba3
-	call $7e77
+	call Function0x37e77
 	jp $7349
 
 .asm_35ba9
@@ -4941,7 +4941,7 @@
 	ld a, BATTLE_VARS_SUBSTATUS5
 	call GetBattleVarPair
 	set 6, [hl]
-	call $7e01
+	call Function0x37e01
 	ld hl, $5156
 	jp FarBattleTextBox
 ; 35c0f
@@ -5023,7 +5023,7 @@
 	ld [hl], e
 .asm_35c82
 	push de
-	call $7e01
+	call Function0x37e01
 	pop de
 	ld a, d
 	ld [$d265], a
@@ -5103,7 +5103,7 @@
 	add hl, bc
 	dec d
 	jr nz, .asm_35ce9 ; 35cec $fb
-	call $7e01
+	call Function0x37e01
 	ld hl, $51a0
 	call FarBattleTextBox
 	ld a, [hBattleTurn]
@@ -5294,7 +5294,7 @@
 	ld a, $2
 	call CleanGetBattleVarPair
 	and $60
-	call z, $7ec7
+	call z, Function0x37ec7
 	call SwitchTurn
 
 	ld a, BATTLE_VARS_MOVE_EFFECT
@@ -5370,7 +5370,7 @@
 	jr nz, .asm_35ec6 ; 35e90 $34
 	call CheckSubstituteOpp
 	jr nz, .asm_35ec6 ; 35e95 $2f
-	call $7e01
+	call Function0x37e01
 	ld b, $7
 	ld a, [$cfc0]
 	and a
@@ -5395,7 +5395,7 @@
 	ret
 .asm_35ec6
 	push hl
-	call $7e77
+	call Function0x37e77
 	pop hl
 	jp FarBattleTextBox
 ; 35ece
@@ -5457,7 +5457,7 @@
 	ret nz
 	call Function0x35ff5
 	ld de, $0106
-	call $7e54
+	call Function0x37e54
 	call $39c9
 	ld hl, $51d5
 	call FarBattleTextBox
@@ -5539,7 +5539,7 @@
 	ret
 .asm_35fb8
 	push hl
-	call $7e77
+	call Function0x37e77
 	pop hl
 	jp FarBattleTextBox
 ; 35fc0
@@ -5546,7 +5546,7 @@
 
 
 Function0x35fc0: ; 35fc0
-	call $7e01
+	call Function0x37e01
 	call Function0x35ff5
 	jp $39c9
 ; 35fc9
@@ -5720,9 +5720,9 @@
 	set 4, [hl]
 	call $398e
 	ld hl, $6c76
-	call $7e73
+	call CallBankF
 	ld de, $0105
-	call $7e54
+	call Function0x37e54
 	call $39c9
 	ld hl, $523c
 	call FarBattleTextBox
@@ -5792,7 +5792,7 @@
 	set 5, [hl]
 	call $398e
 	ld de, $0108
-	call $7e54
+	call Function0x37e54
 	call $39c9
 	ld hl, $525d
 	call FarBattleTextBox
@@ -5841,13 +5841,13 @@
 	set 6, [hl]
 	call $398e
 	ld hl, $6c39
-	call $7e73
+	call CallBankF
 	ld de, $0109
-	call $7e54
+	call Function0x37e54
 	call $39c9
 	call PrintParalyze
 	ld hl, $5de9
-	jp $7e73
+	jp CallBankF
 ; 361ac
 
 
@@ -6027,13 +6027,13 @@
 	ret nz
 	ld a, $1
 	ld [bc], a
-	call $7ed5
+	call Function0x37ed5
 	ret nc
 	xor a
 	ld [$ffd4], a
-	call $7e73
+	call CallBankF
 	call WaitBGMap
-	jp $7e80
+	jp BattleCommandaa
 ; 362ad
 
 
@@ -6337,7 +6337,7 @@
 	and a
 	ret z
 	push af
-	call $7e80
+	call BattleCommandaa
 	pop af
 	dec a
 	jp z, $7349
@@ -6357,7 +6357,7 @@
 	and a
 	ret z
 	push af
-	call $7e80
+	call BattleCommandaa
 	pop af
 	dec a
 	jp z, $7349
@@ -6567,7 +6567,7 @@
 .asm_365ba
 	xor a
 	ld [$ffd4], a
-	call $7e73
+	call CallBankF
 	jp $31f6
 ; 365c3
 
@@ -6581,7 +6581,7 @@
 .asm_365ce
 	xor a
 	ld [$ffd4], a
-	call $7e73
+	call CallBankF
 	jp $31f6
 ; 365d7
 
@@ -6595,15 +6595,15 @@
 	call Function0x3661d
 
 	ld hl, $6d45
-	call $7e73
+	call CallBankF
 
 	call SwitchTurn
 
 	ld hl, $6c39
-	call $7e73
+	call CallBankF
 
 	ld hl, $6c76
-	call $7e73
+	call CallBankF
 
 	jp SwitchTurn
 ; 365fd
@@ -6620,10 +6620,10 @@
 	call SwitchTurn
 
 	ld hl, $6c39
-	call $7e73
+	call CallBankF
 
 	ld hl, $6c76
-	call $7e73
+	call CallBankF
 
 	jp SwitchTurn
 ; 3661d
@@ -6791,7 +6791,7 @@
 	ld [bc], a
 	ld a, $1
 	ld [$c689], a
-	call $7e01
+	call Function0x37e01
 	jp EndMoveEffect
 ; 3671a
 
@@ -6901,7 +6901,7 @@
 	jr nc, .asm_367df ; 367b7 $26
 
 .asm_367b9
-	call $7e77
+	call Function0x37e77
 	jp $734e
 
 .asm_367bf
@@ -6933,7 +6933,7 @@
 	ld [$c689], a
 	call Function0x36804
 	call BattleCommand0a
-	call $7e36
+	call Function0x37e36
 	ld c, $14
 	call DelayFrames
 	call Function0x36804
@@ -7008,7 +7008,7 @@
 	call $39b0
 	ld a, $1
 	ld [$c689], a
-	call $7e01
+	call Function0x37e01
 	ld c, $14
 	call DelayFrames
 	ld hl, $c4a1
@@ -7045,7 +7045,7 @@
 	ld hl, $5544
 	call FarBattleTextBox
 	ld hl, $5c23
-	jp $7e73
+	jp CallBankF
 .asm_368ca
 	jp $6969
 
@@ -7101,7 +7101,7 @@
 	call $399c
 	ld a, $1
 	ld [$c689], a
-	call $7e01
+	call Function0x37e01
 	ld c, $14
 	call DelayFrames
 	ld hl, $c535
@@ -7135,15 +7135,15 @@
 	ld a, d
 	ld [CurPartyMon], a
 	ld hl, $5b32
-	call $7e73
+	call CallBankF
 	ld hl, $5544
 	call FarBattleTextBox
 	ld hl, $5c23
-	jp $7e73
+	jp CallBankF
 .asm_36969
-	call $4eee
-	call $7e80
-	call $5004
+	call BattleCommand0a
+	call BattleCommandaa
+	call BattleCommand0c
 	jp $734e
 .asm_36975
 	push af
@@ -7150,7 +7150,7 @@
 	call $6804
 	ld a, $1
 	ld [$c689], a
-	call $7e01
+	call Function0x37e01
 	ld c, $14
 	call DelayFrames
 	pop af
@@ -7478,7 +7478,7 @@
 	call CleanGetBattleVarPair
 	and $7
 	jr z, .asm_36b65 ; 36b57 $c
-	call $7e80
+	call BattleCommandaa
 	call BattleCommand0c
 	call $734e
 	jp EndMoveEffect
@@ -7495,7 +7495,7 @@
 	ld [$cfca], a
 	inc a
 	ld [$c689], a
-	call $7e36
+	call Function0x37e36
 	ld a, BATTLE_VARS_MOVE_ANIM
 	call CleanGetBattleVarPair
 	cp $13
@@ -7505,7 +7505,7 @@
 	call BattleCommand0c
 	jr .asm_36b99 ; 36b94 $3
 .asm_36b96
-	call $7ec0
+	call Function0x37ec0
 .asm_36b99
 	ld a, BATTLE_VARS_SUBSTATUS3
 	call GetBattleVarPair
@@ -7681,11 +7681,11 @@
 	bit 1, [hl]
 	jr nz, .asm_36c92 ; 36c85 $b
 	set 1, [hl]
-	call $7e01
+	call Function0x37e01
 	ld hl, MistText
 	jp FarBattleTextBox
 .asm_36c92
-	call $7e77
+	call Function0x37e77
 	jp $734e
 ; 36c98
 
@@ -7698,11 +7698,11 @@
 	bit 2, [hl]
 	jr nz, .asm_36cac ; 36c9f $b
 	set 2, [hl]
-	call $7e01
+	call Function0x37e01
 	ld hl, GettingPumpedText
 	jp FarBattleTextBox
 .asm_36cac
-	call $7e77
+	call Function0x37e77
 	jp $734e
 ; 36cb2
 
@@ -7804,7 +7804,7 @@
 	ld a, [hl]
 	ld [$d265], a
 	call $3468
-	call $7e77
+	call Function0x37e77
 	ld hl, ProtectedByText
 	jp FarBattleTextBox
 
@@ -7813,7 +7813,7 @@
 	call GetBattleVarPair
 	bit 7, [hl]
 	jr z, .asm_36d65
-	call $7e77
+	call Function0x37e77
 	ld hl, AlreadyConfusedText
 	jp FarBattleTextBox
 
@@ -7849,10 +7849,10 @@
 	jr z, .asm_36d99
 	cp $76
 	jr z, .asm_36d99
-	call $7e01
+	call Function0x37e01
 .asm_36d99
 	ld de, $0103
-	call $7e54
+	call Function0x37e54
 	ld hl, BecameConfusedText
 	call FarBattleTextBox
 	call GetOpponentItem
@@ -7863,7 +7863,7 @@
 	ret nz
 .asm_36db0
 	ld hl, $5e51
-	jp $7e73
+	jp CallBankF
 ; 36db6
 
 Function0x36db6: ; 36db6
@@ -7896,7 +7896,7 @@
 	ld a, [hl]
 	ld [$d265], a
 	call $3468
-	call $7e77
+	call Function0x37e77
 	ld hl, ProtectedByText
 	jp FarBattleTextBox
 .asm_36def
@@ -7927,7 +7927,7 @@
 	jr nz, .asm_36e52 ; 36e1f $31
 	ld c, $1e
 	call DelayFrames
-	call $7e01
+	call Function0x37e01
 	ld a, $1
 	ld [$ffd4], a
 	ld a, BATTLE_VARS_STATUS_OPP
@@ -7935,19 +7935,19 @@
 	set 6, [hl]
 	call $398e
 	ld hl, $6c39
-	call $7e73
+	call CallBankF
 	call $39d4
 	call PrintParalyze
 	ld hl, $5de9
-	jp $7e73
+	jp CallBankF
 .asm_36e49
-	call $7e77
+	call Function0x37e77
 	ld hl, AlreadyParalyzedText
 	jp FarBattleTextBox
 .asm_36e52
 	jp PrintDidntAffect2
 .asm_36e55
-	call $7e77
+	call Function0x37e77
 	jp PrintDoesntAffect
 ; 36e5b
 
@@ -7991,7 +7991,7 @@
 BattleCommand31: ; 36e7c
 ; substitute
 
-	call $7e80
+	call BattleCommandaa
 	ld hl, BattleMonMaxHP
 	ld de, $c6df
 	ld a, [hBattleTurn]
@@ -8041,7 +8041,7 @@
 	xor a
 	ld [hl], a
 	ld [de], a
-	call $7ed5
+	call Function0x37ed5
 	jr c, .asm_36ee8 ; 36ed5 $11
 	xor a
 	ld [$cfca], a
@@ -8137,7 +8137,7 @@
 ; mimic
 
 	call Function0x372d8
-	call $7e80
+	call BattleCommandaa
 	ld a, [AttackMissed]
 	and a
 	jr nz, .asm_36f9a ; 36f50 $48
@@ -8177,7 +8177,7 @@
 	add hl, bc
 	ld [hl], $5
 	call $34f8
-	call $7e01
+	call Function0x37e01
 	ld hl, LearnedMoveText
 	jp FarBattleTextBox
 .asm_36f9a
@@ -8210,14 +8210,14 @@
 	bit 7, [hl]
 	jr nz, .asm_36fd8 ; 36fc5 $11
 	set 7, [hl]
-	call $7e01
+	call Function0x37e01
 	ld hl, WasSeededText
 	jp FarBattleTextBox
 .asm_36fd2
-	call $7e77
+	call Function0x37e77
 	jp PrintDoesntAffect
 .asm_36fd8
-	call $7e77
+	call Function0x37e77
 	ld hl, EvadedText
 	jp FarBattleTextBox
 ; 36fe1
@@ -8224,7 +8224,7 @@
 
 
 BattleCommand36: ; 36fe1
-	call $7e01
+	call Function0x37e01
 	ld a, $41
 	ld hl, $60e5
 	rst FarCall
@@ -8282,7 +8282,7 @@
 	swap c
 	add c
 	ld [de], a
-	call $7e01
+	call Function0x37e01
 	ld hl, DisabledMove
 	ld a, [hBattleTurn]
 	and a
@@ -8354,7 +8354,7 @@
 	push bc
 	dec a
 	ld hl, $5afe
-	call $7ea1
+	call GetMoveAttr
 	ld [de], a
 	inc de
 	pop bc
@@ -8390,7 +8390,7 @@
 	inc hl
 	jr .asm_370bd ; 370d1 $ea
 .asm_370d3
-	call $7e77
+	call Function0x37e77
 	jp $734e
 .asm_370d9
 	call FarBattleRNG
@@ -8420,7 +8420,7 @@
 	ld a, $14
 	ld hl, $4964
 	rst FarCall
-	call $7e01
+	call Function0x37e01
 	ld hl, TransformedTypeText
 	jp FarBattleTextBox
 ; 3710e
@@ -8446,7 +8446,7 @@
 	pop af
 	ld [hBattleTurn], a
 
-	call $7e01
+	call Function0x37e01
 
 	ld hl, EliminatedStatsText
 	jp FarBattleTextBox
@@ -8490,7 +8490,7 @@
 	push hl
 	push de
 	push af
-	call $7e80
+	call BattleCommandaa
 	ld a, BATTLE_VARS_SUBSTATUS5
 	call GetBattleVarPair
 	res 0, [hl]
@@ -8518,16 +8518,16 @@
 .asm_37199
 	jr z, .asm_371a3 ; 37199 $8
 	ld hl, $4c9f
-	call $7e73
+	call CallBankF
 	jr .asm_371a9 ; 371a1 $6
 .asm_371a3
 	ld hl, $4cac
-	call $7e73
+	call CallBankF
 .asm_371a9
-	call $7e01
+	call Function0x37e01
 	call SwitchTurn
 	ld hl, $4cef
-	call $7e73
+	call CallBankF
 	call SwitchTurn
 	call $3995
 	call $39c9
@@ -8535,7 +8535,7 @@
 	jp FarBattleTextBox
 
 .asm_371c4
-	call $7e77
+	call Function0x37e77
 	ld hl, HPIsFullText
 	jp FarBattleTextBox
 ; 371cd
@@ -8649,7 +8649,7 @@
 	ld de, PlayerStatLevels
 	ld bc, $0008
 	call BattleSideCopy
-	call $7ed5
+	call Function0x37ed5
 	jr c, .asm_372a8 ; 37293 $13
 	ld a, [hBattleTurn]
 	and a
@@ -8659,10 +8659,10 @@
 .asm_372a0
 	and a
 	jr nz, .asm_372a8 ; 372a1 $5
-	call $7e36
+	call Function0x37e36
 	jr .asm_372ae ; 372a6 $6
 .asm_372a8
-	call $7e80
+	call BattleCommandaa
 	call BattleCommanda6
 .asm_372ae
 	xor a
@@ -8696,7 +8696,7 @@
 
 
 Function0x372d2: ; 372d2
-	call $7e77
+	call Function0x37e77
 	jp $734e
 ; 372d8
 
@@ -8764,10 +8764,10 @@
 	ld [bc], a
 	ld hl, $54c7
 .asm_37331
-	call $7e01
+	call Function0x37e01
 	jp FarBattleTextBox
 .asm_37337
-	call $7e77
+	call Function0x37e77
 	jp $734e
 ; 3733d
 
@@ -8798,7 +8798,7 @@
 
 
 Function0x37354: ; 37354
-	call $7e77
+	call Function0x37e77
 	ld hl, ButItFailedText ; 'but it failed!'
 	ld de, ItFailedText    ; 'it failed!'
 	jp Function0x35157
@@ -8813,7 +8813,7 @@
 
 
 PrintDidntAffect2: ; 37366
-	call $7e77
+	call Function0x37e77
 	ld hl, DidntAffect1Text ; 'it didn't affect'
 	ld de, DidntAffect2Text ; 'it didn't affect'
 	jp Function0x35157
@@ -8853,7 +8853,7 @@
 	ld a, $1
 	ld [$c689], a
 	call BattleCommand0a
-	call $7e36
+	call Function0x37e36
 	ld a, BATTLE_VARS_SUBSTATUS4
 	call GetBattleVarPair
 	res 7, [hl]
@@ -8860,7 +8860,7 @@
 	ld a, BATTLE_VARS_SUBSTATUS5_OPP
 	call GetBattleVarPair
 	res 6, [hl]
-	call $7ed5
+	call Function0x37ed5
 	ret nc
 	ld a, $f
 	ld hl, $5f58
@@ -8886,7 +8886,7 @@
 	call CheckUserMove
 	jr nz, .asm_373ea ; 373dc $c
 .asm_373de
-	call $7e77
+	call Function0x37e77
 	ld hl, MirrorMoveFailedText
 	call FarBattleTextBox
 	jp EndMoveEffect
@@ -8912,7 +8912,7 @@
 	pop af
 	ld [$c689], a
 .asm_37412
-	call $7e80
+	call BattleCommandaa
 	jp ResetTurn
 ; 37418
 
@@ -8931,7 +8931,7 @@
 	ld [$c689], a
 
 .asm_3742b
-	call $7e36
+	call Function0x37e36
 
 .GetMove
 	call FarBattleRNG
@@ -9119,11 +9119,11 @@
 	bit 7, [hl]
 	jr nz, .asm_37530 ; 37523 $b
 	set 7, [hl]
-	call $7e01
+	call Function0x37e01
 	ld hl, CantEscapeNowText
 	jp FarBattleTextBox
 .asm_37530
-	call $7e77
+	call Function0x37e77
 	jp $734e
 ; 37536
 
@@ -9144,11 +9144,11 @@
 	bit 0, [hl]
 	jr nz, .asm_3755d ; 37550 $b
 	set 0, [hl]
-	call $7e01
+	call Function0x37e01
 	ld hl, StartedNightmareText
 	jp FarBattleTextBox
 .asm_3755d
-	call $7e77
+	call Function0x37e77
 	jp $734e
 ; 37563
 
@@ -9206,7 +9206,7 @@
 .asm_375af
 	ld a, $1
 	ld [$c689], a
-	call $7e01
+	call Function0x37e01
 	ld a, $2
 	call Function0x36532
 	call SwitchTurn
@@ -9228,21 +9228,21 @@
 	bit 1, [hl]
 	jr nz, .asm_37604 ; 375e8 $1a
 	set 1, [hl]
-	call $7e01
+	call Function0x37e01
 	ld hl, $4c9f
-	call $7e73
+	call CallBankF
 	ld hl, $4c3f
-	call $7e73
+	call CallBankF
 	call $3995
 	ld hl, PutACurseText
 	jp FarBattleTextBox
 .asm_37604
-	call $7e77
+	call Function0x37e77
 	jp $734e
 .asm_3760a
 	ld b, $8
 	call $648f
-	call $7e77
+	call Function0x37e77
 	ld hl, WontRiseAnymoreText
 	jp FarBattleTextBox
 ; 37618
@@ -9256,7 +9256,7 @@
 	ld a, BATTLE_VARS_SUBSTATUS1
 	call GetBattleVarPair
 	set 2, [hl]
-	call $7e01
+	call Function0x37e01
 	ld hl, ProtectedItselfText
 	jp FarBattleTextBox
 ; 3762c
@@ -9312,7 +9312,7 @@
 .asm_37665
 	xor a
 	ld [de], a
-	call $7e77
+	call Function0x37e77
 	call $734e
 	scf
 	ret
@@ -9328,7 +9328,7 @@
 	ld a, BATTLE_VARS_SUBSTATUS1
 	call GetBattleVarPair
 	set 5, [hl] ; endure
-	call $7e01
+	call Function0x37e01
 	ld hl, BracedItselfText
 	jp FarBattleTextBox
 ; 37683
@@ -9346,7 +9346,7 @@
 	bit 0, [hl]
 	jr nz, .asm_3769d ; 37690 $b
 	set 0, [hl]
-	call $7e01
+	call Function0x37e01
 	ld hl, SpikesText
 	jp FarBattleTextBox
 .asm_3769d
@@ -9367,7 +9367,7 @@
 	bit 3, [hl]
 	jr nz, .asm_376bf ; 376b2 $b
 	set 3, [hl]
-	call $7e01
+	call Function0x37e01
 	ld hl, IdentifiedText
 	jp FarBattleTextBox
 .asm_376bf
@@ -9400,11 +9400,11 @@
 	ld a, $4
 	ld [$c67f], a
 .asm_376e9
-	call $7e01
+	call Function0x37e01
 	ld hl, StartPerishText
 	jp FarBattleTextBox
 .asm_376f2
-	call $7e77
+	call Function0x37e77
 	jp $734e
 ; 376f8
 
@@ -9419,11 +9419,11 @@
 	ld [Weather], a
 	ld a, 5
 	ld [WeatherCount], a
-	call $7e01
+	call Function0x37e01
 	ld hl, SandstormBrewedText
 	jp FarBattleTextBox
 .asm_37712
-	call $7e77
+	call Function0x37e77
 	jp $734e
 ; 37718
 
@@ -9586,7 +9586,7 @@
 	jr nz, .asm_377f2
 
 	set 7, [hl]
-	call $7e01
+	call Function0x37e01
 
 ; 'fell in love!'
 	ld hl, FellInLoveText
@@ -9703,10 +9703,10 @@
 .asm_37889
 	ld a, [$d265]
 	and a
-	jp z, $7e77
+	jp z, Function0x37e77
 	ld a, [AttackMissed]
 	and a
-	jp nz, $7e77
+	jp nz, Function0x37e77
 	push bc
 	call FarBattleRNG
 	ld b, a
@@ -9724,7 +9724,7 @@
 .asm_378ad
 	ld a, c
 	ld [$c689], a
-	call $7de9
+	call Function0x37de9
 	ld d, [hl]
 	pop bc
 	ret
@@ -9732,7 +9732,7 @@
 	pop bc
 	ld a, $3
 	ld [$c689], a
-	call $7e01
+	call Function0x37e01
 	call SwitchTurn
 	ld hl, $5246
 	ld a, [hBattleTurn]
@@ -9744,10 +9744,10 @@
 	rst FarCall
 	jr c, .asm_378f3 ; 378d1 $20
 	ld hl, $4c8e
-	call $7e73
+	call CallBankF
 	call SwitchTurn
 	ld hl, $4cef
-	call $7e73
+	call CallBankF
 	call SwitchTurn
 	ld hl, RegainedHealthText
 	call FarBattleTextBox
@@ -9756,9 +9756,9 @@
 	jr .asm_37904 ; 378f1 $11
 .asm_378f3
 	call SwitchTurn
-	call $7ed5
+	call Function0x37ed5
 	jr nc, .asm_37904 ; 378f9 $9
-	call $7e77
+	call Function0x37e77
 	ld hl, RefusedGiftText
 	call FarBattleTextBox
 .asm_37904
@@ -9818,11 +9818,11 @@
 	set 2, [hl]
 	ld a, $5
 	ld [de], a
-	call $7e01
+	call Function0x37e01
 	ld hl, CoveredByVeilText
 	jp FarBattleTextBox
 .asm_3795c
-	call $7e77
+	call Function0x37e77
 	jp $734e
 ; 37962
 
@@ -9854,7 +9854,7 @@
 	ret z
 	ld a, $1
 	ld [AttackMissed], a
-	call $7e80
+	call BattleCommandaa
 	ld hl, SafeguardProtectText
 	call FarBattleTextBox
 	jp EndMoveEffect
@@ -9881,7 +9881,7 @@
 	inc hl
 	ld a, [hl]
 	ld [$d265], a
-	call $7e80
+	call BattleCommandaa
 	ld hl, MagnitudeText
 	call FarBattleTextBox
 	pop de
@@ -9911,7 +9911,7 @@
 	jp z, $7aab
 
 	call $399c
-	call $7e01
+	call Function0x37e01
 
 	ld c, 50
 	call DelayFrames
@@ -9951,7 +9951,7 @@
 	jp c, EndMoveEffect
 
 	ld hl, $6459
-	call $7e73
+	call CallBankF
 	call $7ab1
 
 	ret
@@ -9965,7 +9965,7 @@
 	jp z, $7aab
 
 	call $39b0
-	call $7e01
+	call Function0x37e01
 	call $7a82
 
 	ld a, $f
@@ -9977,19 +9977,19 @@
 	ld [$c718], a
 
 	ld hl, $5517
-	call $7e73
+	call CallBankF
 
 	ld hl, $557a
-	call $7e73
+	call CallBankF
 
 	ld a, 1
 	ld [$d265], a
 
 	ld hl, $6cab
-	call $7e73
+	call CallBankF
 
 	ld hl, $5c23
-	call $7e73
+	call CallBankF
 
 	jr Function0x37ab1
 
@@ -10003,7 +10003,7 @@
 	call $1d6e
 
 	ld hl, $68e4
-	call $7e73
+	call CallBankF
 
 	call $1c17
 
@@ -10019,7 +10019,7 @@
 
 	call $1d6e
 	ld hl, $68e4
-	call $7e73
+	call CallBankF
 	ld a, [OTPartyCount]
 	add $4
 	ld b, a
@@ -10036,7 +10036,7 @@
 	ld [$d430], a
 .asm_37aa8
 	jp $1c17
-	call $7e77
+	call Function0x37e77
 	jp $734e
 
 
@@ -10250,7 +10250,7 @@
 	ld a, BANK(GetMaxHP)
 	rst FarCall
 
-	call $7e01
+	call Function0x37e01
 	call SwitchTurn
 
 	ld hl, $4cef
@@ -10265,7 +10265,7 @@
 	jp FarBattleTextBox
 
 .Full
-	call $7e77
+	call Function0x37e77
 
 ; 'hp is full!'
 	ld hl, HPIsFullText
@@ -10300,7 +10300,7 @@
 	ld [Weather], a
 	ld a, 5
 	ld [WeatherCount], a
-	call $7e01
+	call Function0x37e01
 	ld hl, DownpourText
 	jp FarBattleTextBox
 ; 37c07
@@ -10312,7 +10312,7 @@
 	ld [Weather], a
 	ld a, 5
 	ld [WeatherCount], a
-	call $7e01
+	call Function0x37e01
 	ld hl, SunGotBrightText
 	jp FarBattleTextBox
 ; 37c1a
@@ -10332,7 +10332,7 @@
 	rst FarCall
 	jr nc, .asm_37c4f ; 37c2f $1e
 	push bc
-	call $7e01
+	call Function0x37e01
 	pop bc
 	ld hl, $4c3f
 	ld a, $f
@@ -10348,7 +10348,7 @@
 	ld hl, BellyDrumText
 	jp FarBattleTextBox
 .asm_37c4f
-	call $7e77
+	call Function0x37e77
 	jp $734e
 ; 37c55
 
@@ -10375,7 +10375,7 @@
 	dec b
 	jr nz, .asm_37c67 ; 37c6d $f8
 	pop hl
-	call $7e77
+	call Function0x37e77
 	jp $734e
 .asm_37c76
 	pop hl
@@ -10394,7 +10394,7 @@
 .asm_37c89
 	call Function0x365fd
 .asm_37c8c
-	call $7e01
+	call Function0x37e01
 	ld hl, CopiedStatsText
 	jp FarBattleTextBox
 ; 37c95
@@ -10543,7 +10543,7 @@
 	ld a, $4
 	ld [hl], a
 	call BattleCommand0a
-	call $7e80
+	call BattleCommandaa
 	ld hl, ForesawAttackText
 	call FarBattleTextBox
 	call BattleCommand0c
@@ -10566,7 +10566,7 @@
 .asm_37d87
 	pop bc
 	call ResetDamage
-	call $7e77
+	call Function0x37e77
 	call $734e
 	jp EndMoveEffect
 ; 37d94
@@ -10647,9 +10647,135 @@
 ; 37de9
 
 
-INCBIN "baserom.gbc", $37de9, $37e80 - $37de9
+Function0x37de9: ; 37de9
+	push hl
+	push de
+	push bc
+	ld a, [$c689]
+	push af
+	call BattleCommand0a
+	pop af
+	ld [$c689], a
+	call Function0x37e19
+	call BattleCommand0c
+	pop bc
+	pop de
+	pop hl
+	ret
+; 37e01
 
 
+Function0x37e01: ; 37e01
+	push hl
+	push de
+	push bc
+	ld a, [$c689]
+	push af
+	call BattleCommand0a
+	pop af
+	ld [$c689], a
+	call Function0x37e36
+	call BattleCommand0c
+	pop bc
+	pop de
+	pop hl
+	ret
+; 37e19
+
+
+Function0x37e19: ; 37e19
+	xor a
+	ld [FXAnimIDHi], a
+
+	ld a, BATTLE_VARS_MOVE_ANIM
+	call CleanGetBattleVarPair
+	and a
+	ret z
+
+	ld [FXAnimIDLo], a
+
+	ld a, [hBattleTurn]
+	and a
+	ld a, 1
+	jr z, .asm_37e30
+	ld a, 4
+
+.asm_37e30
+	ld [$cfca], a
+
+	jp Function0x37e47
+; 37e36
+
+
+Function0x37e36: ; 37e36
+	xor a
+	ld [$cfca], a
+	ld [FXAnimIDHi], a
+
+	ld a, BATTLE_VARS_MOVE_ANIM
+	call CleanGetBattleVarPair
+	and a
+	ret z
+
+	ld [FXAnimIDLo], a
+
+	; fallthrough
+; 37e47
+
+
+Function0x37e47: ; 37e47
+	push hl
+	push de
+	push bc
+	ld hl, $40d6
+	ld a, $33
+	rst FarCall ; callab SafePlayBattleAnimation
+	pop bc
+	pop de
+	pop hl
+	ret
+; 37e54
+
+
+Function0x37e54: ; 37e54
+	ld a, e
+	ld [FXAnimIDLo], a
+	ld a, d
+	ld [FXAnimIDHi], a
+	xor a
+	ld [$cfca], a
+
+	push hl
+	push de
+	push bc
+	call SwitchTurn
+
+	ld hl, $40d6
+	ld a, $33
+	rst FarCall ; callab SafePlayBattleAnimation
+
+	call SwitchTurn
+	pop bc
+	pop de
+	pop hl
+	ret
+; 37e73
+
+
+CallBankF: ; 37e73
+	ld a, $f
+	rst FarCall
+	ret
+; 37e77
+
+
+Function0x37e77: ; 37e77
+	call BattleCommand0a
+	call BattleCommandaa
+	jp BattleCommand0c
+; 37e80
+
+
 BattleCommandaa: ; 37e80
 ; wait
 ; Wait 40 frames.
@@ -10688,11 +10814,19 @@
 ; 37ea1
 
 
-INCBIN "baserom.gbc", $37ea1, $37ead - $37ea1
+GetMoveAttr: ; 37ea1
+; Assuming hl = Moves + x, return attribute x of move a.
+	push bc
+	ld bc, Move1 - Move0
+	call AddNTimes
+	call GetMoveByte
+	pop bc
+	ret
+; 37ead
 
 
 GetMoveData: ; 37ead
-; Get move struct a.
+; Copy move struct a to de.
 	ld hl, Moves
 	ld bc, Move1 - Move0
 	call AddNTimes
@@ -10700,7 +10834,50 @@
 	jp FarCopyBytes
 ; 37ebb
 
-INCBIN "baserom.gbc", $37ebb, $37ee2 - $37ebb
+
+GetMoveByte: ; 37ebb
+	ld a, BANK(Moves)
+	jp GetFarByte
+; 37ec0
+
+
+Function0x37ec0: ; 37ec0
+	ld a, $3e
+	ld hl, $7d54
+	rst $8
+	ret
+; 37ec7
+
+
+Function0x37ec7: ; 37ec7
+	ld a, $3e
+	ld hl, $7d71
+	rst $8
+	ret
+; 37ece
+
+
+Function0x37ece: ; 37ece
+	ld a, $3e
+	ld hl, $7d69
+	rst $8
+	ret
+; 37ed5
+
+
+Function0x37ed5: ; 37ed5
+; Related to mobile link battles.
+	push hl
+	push de
+	push bc
+	ld a, $13
+	ld hl, $6a44
+	rst $8
+	pop bc
+	pop de
+	pop hl
+	ret
+; 37ee2