summaryrefslogtreecommitdiff
path: root/asm/macros
diff options
context:
space:
mode:
authorJaceCearK1 <JaceCearK1@users.noreply.github.com>2017-07-01 21:04:18 +0200
committerGitHub <noreply@github.com>2017-07-01 21:04:18 +0200
commit0dd804a99e5455a0eac8ff6ed87d9de16c7380b7 (patch)
tree7b3567978b63ee6548a7b945e075ea8ba37bef51 /asm/macros
parentf1344efd2aff92292f58f7323bd9297a38fe9b02 (diff)
parent8d82578d3a101b06f9d2ced31738021007c4e533 (diff)
Merge pull request #1 from pret/master
Update fork to match main fork.
Diffstat (limited to 'asm/macros')
-rw-r--r--asm/macros/asm.inc5
-rw-r--r--asm/macros/battle_ai_script.inc62
-rw-r--r--asm/macros/battle_anim.inc24
3 files changed, 63 insertions, 28 deletions
diff --git a/asm/macros/asm.inc b/asm/macros/asm.inc
index 4ac003fab..26b2707ca 100644
--- a/asm/macros/asm.inc
+++ b/asm/macros/asm.inc
@@ -1,3 +1,6 @@
+ .ifndef GUARD_ASM_MACROS_ASM_INC
+ .set GUARD_ASM_MACROS_ASM_INC, 1
+
.macro inc x
.set \x, \x + 1
.endm
@@ -10,3 +13,5 @@
.equiv \constant, __enum__
inc __enum__
.endm
+
+ .endif @ GUARD_ASM_MACROS_ASM_INC
diff --git a/asm/macros/battle_ai_script.inc b/asm/macros/battle_ai_script.inc
index 38a44ddfb..679e30340 100644
--- a/asm/macros/battle_ai_script.inc
+++ b/asm/macros/battle_ai_script.inc
@@ -1,21 +1,24 @@
- .macro if_random percent, address
+ .macro if_random_less_than percent, address
.byte 0x00
.byte \percent
.4byte \address
.endm
- .macro if_not_random percent, address
+ @ unused
+ .macro if_random_greater_than percent, address
.byte 0x01
.byte \percent
.4byte \address
.endm
- .macro if_random_1 address
+ @ unused
+ .macro if_random_equal address
.byte 0x02
.4byte \address
.endm
- .macro if_not_random_1 address
+ @ unused
+ .macro if_random_not_equal address
.byte 0x03
.4byte \address
.endm
@@ -212,7 +215,8 @@
.byte \byte
.endm
- .macro ai_23
+ @ unused
+ .macro get_move_power
.byte 0x23
.endm
@@ -225,14 +229,17 @@
.byte \target
.endm
- .macro if_type type, address
+ .macro if_arg_equal type, address
.byte 0x26
.byte \type
.4byte \address
.endm
- .macro ai_27
+ @ unused
+ .macro if_arg_not_equal type, address
.byte 0x27
+ .byte \type
+ .4byte \address
.endm
.macro if_would_go_first target, address
@@ -247,10 +254,12 @@
.4byte \address
.endm
+ @ nullsub
.macro ai_2a
.byte 0x2a
.endm
+ @ nullsub
.macro ai_2b
.byte 0x2b
.endm
@@ -260,7 +269,8 @@
.byte \target
.endm
- .macro ai_2d
+ @ unused
+ .macro get_considered_move
.byte 0x2d
.endm
@@ -273,7 +283,8 @@
.byte \target
.endm
- .macro ai_30
+ @ unused
+ .macro get_highest_possible_damage
.byte 0x30
.endm
@@ -283,10 +294,12 @@
.4byte \address
.endm
+ @ nullsub
.macro ai_32
.byte 0x32
.endm
+ @ nullsub
.macro ai_33
.byte 0x33
.endm
@@ -364,12 +377,20 @@
.4byte \address
.endm
- .macro if_has_move
+ @ unused
+ .macro if_has_move, target, move, address
.byte 0x3f
+ .byte \target
+ .2byte \move
+ .4byte \address
.endm
- .macro if_dont_have_move
+ @ unused
+ .macro if_dont_have_move, target, move, address
.byte 0x40
+ .byte \target
+ .2byte \move
+ .4byte \address
.endm
.macro if_move_effect target, effect, address
@@ -393,8 +414,9 @@
.4byte \address
.endm
- .macro if_encored address
+ .macro if_encored target, address
.byte 0x44
+ .byte \target
.4byte \address
.endm
@@ -402,7 +424,7 @@
.byte 0x45
.endm
- .macro if_random_2 address
+ .macro if_random_100 address
.byte 0x46
.4byte \address
.endm
@@ -440,15 +462,15 @@
.byte \target
.endm
- .macro get_move_type
+ .macro get_move_type_from_result
.byte 0x4e
.endm
- .macro get_move_power
+ .macro get_move_power_from_result
.byte 0x4f
.endm
- .macro get_move_effect
+ .macro get_move_effect_from_result
.byte 0x50
.endm
@@ -457,30 +479,37 @@
.byte \target
.endm
+ @ nullsub
.macro ai_52
.byte 0x52
.endm
+ @ nullsub
.macro ai_53
.byte 0x53
.endm
+ @ nullsub
.macro ai_54
.byte 0x54
.endm
+ @ nullsub
.macro ai_55
.byte 0x55
.endm
+ @ nullsub
.macro ai_56
.byte 0x56
.endm
+ @ nullsub
.macro ai_57
.byte 0x57
.endm
+ @ unused
.macro call address
.byte 0x58
.4byte \address
@@ -513,6 +542,7 @@
if_level_cond 2, \address
.endm
+ @ unused
.macro if_taunted address
.byte 0x5c
.4byte \address
diff --git a/asm/macros/battle_anim.inc b/asm/macros/battle_anim.inc
index fc2777326..4ff845032 100644
--- a/asm/macros/battle_anim.inc
+++ b/asm/macros/battle_anim.inc
@@ -8,24 +8,24 @@
.2byte \id
.endm
- .macro sprite template, priority, argc=0, argv:vararg
+ .macro sprite template, priority, argv:vararg
.byte 0x02
.4byte \template
.byte \priority
- .byte \argc
- .if \argc > 0
+ .byte (.Lsprite_\@_2 - .Lsprite_\@_1) / 2
+.Lsprite_\@_1:
.2byte \argv
- .endif
+.Lsprite_\@_2:
.endm
- .macro createtask addr, priority, argc=0, argv:vararg
+ .macro createtask addr, priority, argv:vararg
.byte 0x03
.4byte \addr
.byte \priority
- .byte \argc
- .if \argc > 0
+ .byte (.Lcreatetask_\@_2 - .Lcreatetask_\@_1) / 2
+.Lcreatetask_\@_1:
.2byte \argv
- .endif
+.Lcreatetask_\@_2:
.endm
.macro pause delay
@@ -167,13 +167,13 @@
.2byte \bldcnt
.endm
- .macro createtask_1F addr, argc=0, argv:vararg
+ .macro createtask_1F addr, argv:vararg
.byte 0x1F
.4byte \addr
- .byte \argc
- .if \argc > 0
+ .byte (.Lcreatetask_1F_\@_2 - .Lcreatetask_1F_\@_1) / 2
+.Lcreatetask_1F_\@_1:
.2byte \argv
- .endif
+.Lcreatetask_1F_\@_2:
.endm
.macro waitsound