summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile9
-rw-r--r--battle/effect_commands.asm18
-rw-r--r--constants/item_constants.asm621
-rw-r--r--engine/scripting.asm6
-rw-r--r--gfx/pics/animation.asm127
-rw-r--r--macros.asm13
-rw-r--r--macros/enum.asm31
-rw-r--r--macros/event.asm512
-rw-r--r--macros/move_effect.asm894
-rw-r--r--main.asm2
10 files changed, 970 insertions, 1263 deletions
diff --git a/Makefile b/Makefile
index be38d9e08..2fdd14760 100644
--- a/Makefile
+++ b/Makefile
@@ -62,9 +62,6 @@ compare: pokecrystal.gbc pokecrystal11.gbc
%.asm: ;
$(all_obj): $$*.asm $$($$*_dep)
- @$(gfx) 2bpp $(2bppq); $(eval 2bppq :=)
- @$(gfx) 1bpp $(1bppq); $(eval 1bppq :=)
- @$(gfx) lz $(lzq); $(eval lzq :=)
rgbasm -o $@ $<
pokecrystal11.gbc: $(crystal11_obj)
@@ -82,9 +79,9 @@ pngs:
find . -iname "*.lz" -exec touch {} +
find . -iname "*.[12]bpp" -exec touch {} +
-%.2bpp: %.png ; $(eval 2bppq += $<) @rm -f $@
-%.1bpp: %.png ; $(eval 1bppq += $<) @rm -f $@
-%.lz: % ; $(eval lzq += $<) @rm -f $@
+%.2bpp: %.png ; @$(gfx) 2bpp $<
+%.1bpp: %.png ; @$(gfx) 1bpp $<
+%.lz: % ; @$(gfx) lz $<
%.pal: ;
diff --git a/battle/effect_commands.asm b/battle/effect_commands.asm
index f23ea0900..96331f9eb 100644
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -90,8 +90,8 @@ DoMove: ; 3402c
ld [BattleScriptBufferLoc + 1], a
pop af
-; $fe is used to terminate branches without ending the read cycle.
- cp $fe
+; endturn_command (-2) is used to terminate branches without ending the read cycle.
+ cp endturn_command
ret nc
; The rest of the commands (01-af) are read from BattleCommandPointers.
@@ -3918,7 +3918,7 @@ BattleCommanda1: ; 35461
Function355b0: ; 355b0
- ld b, $12 ; buildopponentrage
+ ld b, buildopponentrage_command
jp SkipToBattleCommand
; 355b5
@@ -6977,7 +6977,7 @@ BattleCommand21: ; 36671
ld a, BIDE
ld [hl], a
- ld b, $22 ; unleashenergy
+ ld b, unleashenergy_command
jp SkipToBattleCommand
.asm_366dc
@@ -7051,7 +7051,7 @@ BattleCommand3e: ; 3671a
inc de
ld [de], a
.asm_3674c
- ld b, $3d ; rampage
+ ld b, rampage_command
jp SkipToBattleCommand
; 36751
@@ -7707,7 +7707,7 @@ BattleCommand3a: ; 36b3a
res SUBSTATUS_CHARGED, [hl]
res SUBSTATUS_UNDERGROUND, [hl]
res SUBSTATUS_FLYING, [hl]
- ld b, $39 ; charge
+ ld b, charge_command
jp SkipToBattleCommand
; 36b4d
@@ -7787,7 +7787,7 @@ BattleCommand39: ; 36b4d
ld a, BATTLE_VARS_MOVE_EFFECT
call GetBattleVar
cp EFFECT_SKULL_BASH
- ld b, $fe ; endturn
+ ld b, endturn_command
jp z, SkipToBattleCommand
jp EndMoveEffect
@@ -10294,7 +10294,7 @@ BattleCommand9e: ; 37d02
ld a, [Weather]
cp WEATHER_SUN
ret nz
- ld b, $39 ; charge
+ ld b, charge_command
jp SkipToBattleCommand
; 37d0d
@@ -10323,7 +10323,7 @@ BattleCommand9b: ; 37d0d
ld [CurDamage], a
ld a, [de]
ld [CurDamage + 1], a
- ld b, $9c ; futuresight
+ ld b, futuresight_command
jp SkipToBattleCommand
; 37d34
diff --git a/constants/item_constants.asm b/constants/item_constants.asm
index fea4632e3..67e20dad6 100644
--- a/constants/item_constants.asm
+++ b/constants/item_constants.asm
@@ -1,254 +1,255 @@
-NO_ITEM EQU $00
-MASTER_BALL EQU $01
-ULTRA_BALL EQU $02
-BRIGHTPOWDER EQU $03
-GREAT_BALL EQU $04
-POKE_BALL EQU $05
-TOWN_MAP EQU $06
-BICYCLE EQU $07
-MOON_STONE EQU $08
-ANTIDOTE EQU $09
-BURN_HEAL EQU $0A
-ICE_HEAL EQU $0B
-AWAKENING EQU $0C
-PARLYZ_HEAL EQU $0D
-FULL_RESTORE EQU $0E
-MAX_POTION EQU $0F
-HYPER_POTION EQU $10
-SUPER_POTION EQU $11
-POTION EQU $12
-ESCAPE_ROPE EQU $13
-REPEL EQU $14
-MAX_ELIXER EQU $15
-FIRE_STONE EQU $16
-THUNDERSTONE EQU $17
-WATER_STONE EQU $18
-ITEM_19 EQU $19
-HP_UP EQU $1A
-PROTEIN EQU $1B
-IRON EQU $1C
-CARBOS EQU $1D
-LUCKY_PUNCH EQU $1E
-CALCIUM EQU $1F
-RARE_CANDY EQU $20
-X_ACCURACY EQU $21
-LEAF_STONE EQU $22
-METAL_POWDER EQU $23
-NUGGET EQU $24
-POKE_DOLL EQU $25
-FULL_HEAL EQU $26
-REVIVE EQU $27
-MAX_REVIVE EQU $28
-GUARD_SPEC EQU $29
-SUPER_REPEL EQU $2A
-MAX_REPEL EQU $2B
-DIRE_HIT EQU $2C
-ITEM_2D EQU $2D
-FRESH_WATER EQU $2E
-SODA_POP EQU $2F
-LEMONADE EQU $30
-X_ATTACK EQU $31
-ITEM_32 EQU $32
-X_DEFEND EQU $33
-X_SPEED EQU $34
-X_SPECIAL EQU $35
-COIN_CASE EQU $36
-ITEMFINDER EQU $37
-POKE_FLUTE EQU $38
-EXP_SHARE EQU $39
-OLD_ROD EQU $3A
-GOOD_ROD EQU $3B
-SILVER_LEAF EQU $3C
-SUPER_ROD EQU $3D
-PP_UP EQU $3E
-ETHER EQU $3F
-MAX_ETHER EQU $40
-ELIXER EQU $41
-RED_SCALE EQU $42
-SECRETPOTION EQU $43
-S_S_TICKET EQU $44
-MYSTERY_EGG EQU $45
-CLEAR_BELL EQU $46
-SILVER_WING EQU $47
-MOOMOO_MILK EQU $48
-QUICK_CLAW EQU $49
-PSNCUREBERRY EQU $4A
-GOLD_LEAF EQU $4B
-SOFT_SAND EQU $4C
-SHARP_BEAK EQU $4D
-PRZCUREBERRY EQU $4E
-BURNT_BERRY EQU $4F
-ICE_BERRY EQU $50
-POISON_BARB EQU $51
-KINGS_ROCK EQU $52
-BITTER_BERRY EQU $53
-MINT_BERRY EQU $54
-RED_APRICORN EQU $55
-TINYMUSHROOM EQU $56
-BIG_MUSHROOM EQU $57
-SILVERPOWDER EQU $58
-BLU_APRICORN EQU $59
-ITEM_5A EQU $5A
-AMULET_COIN EQU $5B
-YLW_APRICORN EQU $5C
-GRN_APRICORN EQU $5D
-CLEANSE_TAG EQU $5E
-MYSTIC_WATER EQU $5F
-TWISTEDSPOON EQU $60
-WHT_APRICORN EQU $61
-BLACKBELT EQU $62
-BLK_APRICORN EQU $63
-ITEM_64 EQU $64
-PNK_APRICORN EQU $65
-BLACKGLASSES EQU $66
-SLOWPOKETAIL EQU $67
-PINK_BOW EQU $68
-STICK EQU $69
-SMOKE_BALL EQU $6A
-NEVERMELTICE EQU $6B
-MAGNET EQU $6C
-MIRACLEBERRY EQU $6D
-PEARL EQU $6E
-BIG_PEARL EQU $6F
-EVERSTONE EQU $70
-SPELL_TAG EQU $71
-RAGECANDYBAR EQU $72
-GS_BALL EQU $73
-BLUE_CARD EQU $74
-MIRACLE_SEED EQU $75
-THICK_CLUB EQU $76
-FOCUS_BAND EQU $77
-ITEM_78 EQU $78
-ENERGYPOWDER EQU $79
-ENERGY_ROOT EQU $7A
-HEAL_POWDER EQU $7B
-REVIVAL_HERB EQU $7C
-HARD_STONE EQU $7D
-LUCKY_EGG EQU $7E
-CARD_KEY EQU $7F
-MACHINE_PART EQU $80
-EGG_TICKET EQU $81
-LOST_ITEM EQU $82
-STARDUST EQU $83
-STAR_PIECE EQU $84
-BASEMENT_KEY EQU $85
-PASS EQU $86
-ITEM_87 EQU $87
-ITEM_88 EQU $88
-ITEM_89 EQU $89
-CHARCOAL EQU $8A
-BERRY_JUICE EQU $8B
-SCOPE_LENS EQU $8C
-ITEM_8D EQU $8D
-ITEM_8E EQU $8E
-METAL_COAT EQU $8F
-DRAGON_FANG EQU $90
-ITEM_91 EQU $91
-LEFTOVERS EQU $92
-ITEM_93 EQU $93
-ITEM_94 EQU $94
-ITEM_95 EQU $95
-MYSTERYBERRY EQU $96
-DRAGON_SCALE EQU $97
-BERSERK_GENE EQU $98
-ITEM_99 EQU $99
-ITEM_9A EQU $9A
-ITEM_9B EQU $9B
-SACRED_ASH EQU $9C
-HEAVY_BALL EQU $9D
-FLOWER_MAIL EQU $9E
-LEVEL_BALL EQU $9F
-LURE_BALL EQU $A0
-FAST_BALL EQU $A1
-ITEM_A2 EQU $A2
-LIGHT_BALL EQU $A3
-FRIEND_BALL EQU $A4
-MOON_BALL EQU $A5
-LOVE_BALL EQU $A6
-NORMAL_BOX EQU $A7
-GORGEOUS_BOX EQU $A8
-SUN_STONE EQU $A9
-POLKADOT_BOW EQU $AA
-ITEM_AB EQU $AB
-UP_GRADE EQU $AC
-BERRY EQU $AD
-GOLD_BERRY EQU $AE
-SQUIRTBOTTLE EQU $AF
-ITEM_B0 EQU $B0
-PARK_BALL EQU $B1
-RAINBOW_WING EQU $B2
-ITEM_B3 EQU $B3
-BRICK_PIECE EQU $B4
-SURF_MAIL EQU $B5
-LITEBLUEMAIL EQU $B6
-PORTRAITMAIL EQU $B7
-LOVELY_MAIL EQU $B8
-EON_MAIL EQU $B9
-MORPH_MAIL EQU $BA
-BLUESKY_MAIL EQU $BB
-MUSIC_MAIL EQU $BC
-MIRAGE_MAIL EQU $BD
-ITEM_BE EQU $BE
-TM_01 EQU $BF
-TM_02 EQU $C0
-TM_03 EQU $C1
-TM_04 EQU $C2
-ITEM_C3 EQU $C3
-TM_05 EQU $C4
-TM_06 EQU $C5
-TM_07 EQU $C6
-TM_08 EQU $C7
-TM_09 EQU $C8
-TM_10 EQU $C9
-TM_11 EQU $CA
-TM_12 EQU $CB
-TM_13 EQU $CC
-TM_14 EQU $CD
-TM_15 EQU $CE
-TM_16 EQU $CF
-TM_17 EQU $D0
-TM_18 EQU $D1
-TM_19 EQU $D2
-TM_20 EQU $D3
-TM_21 EQU $D4
-TM_22 EQU $D5
-TM_23 EQU $D6
-TM_24 EQU $D7
-TM_25 EQU $D8
-TM_26 EQU $D9
-TM_27 EQU $DA
-TM_28 EQU $DB
-ITEM_DC EQU $DC
-TM_29 EQU $DD
-TM_30 EQU $DE
-TM_31 EQU $DF
-TM_32 EQU $E0
-TM_33 EQU $E1
-TM_34 EQU $E2
-TM_35 EQU $E3
-TM_36 EQU $E4
-TM_37 EQU $E5
-TM_38 EQU $E6
-TM_39 EQU $E7
-TM_40 EQU $E8
-TM_41 EQU $E9
-TM_42 EQU $EA
-TM_43 EQU $EB
-TM_44 EQU $EC
-TM_45 EQU $ED
-TM_46 EQU $EE
-TM_47 EQU $EF
-TM_48 EQU $F0
-TM_49 EQU $F1
-TM_50 EQU $F2
-HM_01 EQU $F3
-HM_02 EQU $F4
-HM_03 EQU $F5
-HM_04 EQU $F6
-HM_05 EQU $F7
-HM_06 EQU $F8
-HM_07 EQU $F9
-HM_08 EQU $FA
+ const_def
+ const NO_ITEM ; $00
+ const MASTER_BALL ; $01
+ const ULTRA_BALL ; $02
+ const BRIGHTPOWDER ; $03
+ const GREAT_BALL ; $04
+ const POKE_BALL ; $05
+ const TOWN_MAP ; $06
+ const BICYCLE ; $07
+ const MOON_STONE ; $08
+ const ANTIDOTE ; $09
+ const BURN_HEAL ; $0A
+ const ICE_HEAL ; $0B
+ const AWAKENING ; $0C
+ const PARLYZ_HEAL ; $0D
+ const FULL_RESTORE ; $0E
+ const MAX_POTION ; $0F
+ const HYPER_POTION ; $10
+ const SUPER_POTION ; $11
+ const POTION ; $12
+ const ESCAPE_ROPE ; $13
+ const REPEL ; $14
+ const MAX_ELIXER ; $15
+ const FIRE_STONE ; $16
+ const THUNDERSTONE ; $17
+ const WATER_STONE ; $18
+ const ITEM_19 ; $19
+ const HP_UP ; $1A
+ const PROTEIN ; $1B
+ const IRON ; $1C
+ const CARBOS ; $1D
+ const LUCKY_PUNCH ; $1E
+ const CALCIUM ; $1F
+ const RARE_CANDY ; $20
+ const X_ACCURACY ; $21
+ const LEAF_STONE ; $22
+ const METAL_POWDER ; $23
+ const NUGGET ; $24
+ const POKE_DOLL ; $25
+ const FULL_HEAL ; $26
+ const REVIVE ; $27
+ const MAX_REVIVE ; $28
+ const GUARD_SPEC ; $29
+ const SUPER_REPEL ; $2A
+ const MAX_REPEL ; $2B
+ const DIRE_HIT ; $2C
+ const ITEM_2D ; $2D
+ const FRESH_WATER ; $2E
+ const SODA_POP ; $2F
+ const LEMONADE ; $30
+ const X_ATTACK ; $31
+ const ITEM_32 ; $32
+ const X_DEFEND ; $33
+ const X_SPEED ; $34
+ const X_SPECIAL ; $35
+ const COIN_CASE ; $36
+ const ITEMFINDER ; $37
+ const POKE_FLUTE ; $38
+ const EXP_SHARE ; $39
+ const OLD_ROD ; $3A
+ const GOOD_ROD ; $3B
+ const SILVER_LEAF ; $3C
+ const SUPER_ROD ; $3D
+ const PP_UP ; $3E
+ const ETHER ; $3F
+ const MAX_ETHER ; $40
+ const ELIXER ; $41
+ const RED_SCALE ; $42
+ const SECRETPOTION ; $43
+ const S_S_TICKET ; $44
+ const MYSTERY_EGG ; $45
+ const CLEAR_BELL ; $46
+ const SILVER_WING ; $47
+ const MOOMOO_MILK ; $48
+ const QUICK_CLAW ; $49
+ const PSNCUREBERRY ; $4A
+ const GOLD_LEAF ; $4B
+ const SOFT_SAND ; $4C
+ const SHARP_BEAK ; $4D
+ const PRZCUREBERRY ; $4E
+ const BURNT_BERRY ; $4F
+ const ICE_BERRY ; $50
+ const POISON_BARB ; $51
+ const KINGS_ROCK ; $52
+ const BITTER_BERRY ; $53
+ const MINT_BERRY ; $54
+ const RED_APRICORN ; $55
+ const TINYMUSHROOM ; $56
+ const BIG_MUSHROOM ; $57
+ const SILVERPOWDER ; $58
+ const BLU_APRICORN ; $59
+ const ITEM_5A ; $5A
+ const AMULET_COIN ; $5B
+ const YLW_APRICORN ; $5C
+ const GRN_APRICORN ; $5D
+ const CLEANSE_TAG ; $5E
+ const MYSTIC_WATER ; $5F
+ const TWISTEDSPOON ; $60
+ const WHT_APRICORN ; $61
+ const BLACKBELT ; $62
+ const BLK_APRICORN ; $63
+ const ITEM_64 ; $64
+ const PNK_APRICORN ; $65
+ const BLACKGLASSES ; $66
+ const SLOWPOKETAIL ; $67
+ const PINK_BOW ; $68
+ const STICK ; $69
+ const SMOKE_BALL ; $6A
+ const NEVERMELTICE ; $6B
+ const MAGNET ; $6C
+ const MIRACLEBERRY ; $6D
+ const PEARL ; $6E
+ const BIG_PEARL ; $6F
+ const EVERSTONE ; $70
+ const SPELL_TAG ; $71
+ const RAGECANDYBAR ; $72
+ const GS_BALL ; $73
+ const BLUE_CARD ; $74
+ const MIRACLE_SEED ; $75
+ const THICK_CLUB ; $76
+ const FOCUS_BAND ; $77
+ const ITEM_78 ; $78
+ const ENERGYPOWDER ; $79
+ const ENERGY_ROOT ; $7A
+ const HEAL_POWDER ; $7B
+ const REVIVAL_HERB ; $7C
+ const HARD_STONE ; $7D
+ const LUCKY_EGG ; $7E
+ const CARD_KEY ; $7F
+ const MACHINE_PART ; $80
+ const EGG_TICKET ; $81
+ const LOST_ITEM ; $82
+ const STARDUST ; $83
+ const STAR_PIECE ; $84
+ const BASEMENT_KEY ; $85
+ const PASS ; $86
+ const ITEM_87 ; $87
+ const ITEM_88 ; $88
+ const ITEM_89 ; $89
+ const CHARCOAL ; $8A
+ const BERRY_JUICE ; $8B
+ const SCOPE_LENS ; $8C
+ const ITEM_8D ; $8D
+ const ITEM_8E ; $8E
+ const METAL_COAT ; $8F
+ const DRAGON_FANG ; $90
+ const ITEM_91 ; $91
+ const LEFTOVERS ; $92
+ const ITEM_93 ; $93
+ const ITEM_94 ; $94
+ const ITEM_95 ; $95
+ const MYSTERYBERRY ; $96
+ const DRAGON_SCALE ; $97
+ const BERSERK_GENE ; $98
+ const ITEM_99 ; $99
+ const ITEM_9A ; $9A
+ const ITEM_9B ; $9B
+ const SACRED_ASH ; $9C
+ const HEAVY_BALL ; $9D
+ const FLOWER_MAIL ; $9E
+ const LEVEL_BALL ; $9F
+ const LURE_BALL ; $A0
+ const FAST_BALL ; $A1
+ const ITEM_A2 ; $A2
+ const LIGHT_BALL ; $A3
+ const FRIEND_BALL ; $A4
+ const MOON_BALL ; $A5
+ const LOVE_BALL ; $A6
+ const NORMAL_BOX ; $A7
+ const GORGEOUS_BOX ; $A8
+ const SUN_STONE ; $A9
+ const POLKADOT_BOW ; $AA
+ const ITEM_AB ; $AB
+ const UP_GRADE ; $AC
+ const BERRY ; $AD
+ const GOLD_BERRY ; $AE
+ const SQUIRTBOTTLE ; $AF
+ const ITEM_B0 ; $B0
+ const PARK_BALL ; $B1
+ const RAINBOW_WING ; $B2
+ const ITEM_B3 ; $B3
+ const BRICK_PIECE ; $B4
+ const SURF_MAIL ; $B5
+ const LITEBLUEMAIL ; $B6
+ const PORTRAITMAIL ; $B7
+ const LOVELY_MAIL ; $B8
+ const EON_MAIL ; $B9
+ const MORPH_MAIL ; $BA
+ const BLUESKY_MAIL ; $BB
+ const MUSIC_MAIL ; $BC
+ const MIRAGE_MAIL ; $BD
+ const ITEM_BE ; $BE
+ const TM_01 ; $BF
+ const TM_02 ; $C0
+ const TM_03 ; $C1
+ const TM_04 ; $C2
+ const ITEM_C3 ; $C3
+ const TM_05 ; $C4
+ const TM_06 ; $C5
+ const TM_07 ; $C6
+ const TM_08 ; $C7
+ const TM_09 ; $C8
+ const TM_10 ; $C9
+ const TM_11 ; $CA
+ const TM_12 ; $CB
+ const TM_13 ; $CC
+ const TM_14 ; $CD
+ const TM_15 ; $CE
+ const TM_16 ; $CF
+ const TM_17 ; $D0
+ const TM_18 ; $D1
+ const TM_19 ; $D2
+ const TM_20 ; $D3
+ const TM_21 ; $D4
+ const TM_22 ; $D5
+ const TM_23 ; $D6
+ const TM_24 ; $D7
+ const TM_25 ; $D8
+ const TM_26 ; $D9
+ const TM_27 ; $DA
+ const TM_28 ; $DB
+ const ITEM_DC ; $DC
+ const TM_29 ; $DD
+ const TM_30 ; $DE
+ const TM_31 ; $DF
+ const TM_32 ; $E0
+ const TM_33 ; $E1
+ const TM_34 ; $E2
+ const TM_35 ; $E3
+ const TM_36 ; $E4
+ const TM_37 ; $E5
+ const TM_38 ; $E6
+ const TM_39 ; $E7
+ const TM_40 ; $E8
+ const TM_41 ; $E9
+ const TM_42 ; $EA
+ const TM_43 ; $EB
+ const TM_44 ; $EC
+ const TM_45 ; $ED
+ const TM_46 ; $EE
+ const TM_47 ; $EF
+ const TM_48 ; $F0
+ const TM_49 ; $F1
+ const TM_50 ; $F2
+ const HM_01 ; $F3
+ const HM_02 ; $F4
+ const HM_03 ; $F5
+ const HM_04 ; $F6
+ const HM_05 ; $F7
+ const HM_06 ; $F8
+ const HM_07 ; $F9
+ const HM_08 ; $FA
NUM_TMS EQU 50
@@ -271,61 +272,79 @@ TM_HM EQU 4
CANT_SELECT EQU 1 << 6
CANT_TOSS EQU 1 << 7
+
; held item effects
-HELD_BERRY EQU $01
-HELD_LEFTOVERS EQU $03
-HELD_RESTORE_PP EQU $06
-HELD_CLEANSE_TAG EQU $08
+ const_def
-HELD_HEAL_POISON EQU $0a
-HELD_HEAL_FREEZE EQU $0b
-HELD_HEAL_BURN EQU $0c
-HELD_HEAL_SLEEP EQU $0d
-HELD_HEAL_PARALYZE EQU $0e
-HELD_HEAL_STATUS EQU $0f
-HELD_HEAL_CONFUSION EQU $10
+ const HELD_NONE
+ const HELD_BERRY
+ const HELD_2
+ const HELD_LEFTOVERS
+ const HELD_4
+ const HELD_5
+ const HELD_RESTORE_PP
+ const HELD_7
+ const HELD_CLEANSE_TAG
-HELD_PREVENT_POISON EQU $14
-HELD_PREVENT_BURN EQU $15
-HELD_PREVENT_FREEZE EQU $16
-HELD_PREVENT_SLEEP EQU $17
-HELD_PREVENT_PARALYZE EQU $18
-HELD_PREVENT_CONFUSE EQU $19
+const_value = 10
+ const HELD_HEAL_POISON
+ const HELD_HEAL_FREEZE
+ const HELD_HEAL_BURN
+ const HELD_HEAL_SLEEP
+ const HELD_HEAL_PARALYZE
+ const HELD_HEAL_STATUS
+ const HELD_HEAL_CONFUSION
-HELD_ATTACK_UP EQU $1f
-HELD_DEFENSE_UP EQU $20
-HELD_SPEED_UP EQU $21
-HELD_SP_ATTACK_UP EQU $22
-HELD_SP_DEFENSE_UP EQU $23
-HELD_ACCURACY_UP EQU $24
-HELD_EVASION_UP EQU $25
+const_value = 20
+ const HELD_PREVENT_POISON
+ const HELD_PREVENT_BURN
+ const HELD_PREVENT_FREEZE
+ const HELD_PREVENT_SLEEP
+ const HELD_PREVENT_PARALYZE
+ const HELD_PREVENT_CONFUSE
-HELD_METAL_POWDER EQU $2a
+const_value = 30
+ const HELD_30
+ const HELD_ATTACK_UP
+ const HELD_DEFENSE_UP
+ const HELD_SPEED_UP
+ const HELD_SP_ATTACK_UP
+ const HELD_SP_DEFENSE_UP
+ const HELD_ACCURACY_UP
+ const HELD_EVASION_UP
-HELD_NORMAL_BOOST EQU $32
-HELD_FIGHTING_BOOST EQU $33
-HELD_FLYING_BOOST EQU $34
-HELD_POISON_BOOST EQU $35
-HELD_GROUND_BOOST EQU $36
-HELD_ROCK_BOOST EQU $37
-HELD_BUG_BOOST EQU $38
-HELD_GHOST_BOOST EQU $39
-HELD_FIRE_BOOST EQU $3a
-HELD_WATER_BOOST EQU $3b
-HELD_GRASS_BOOST EQU $3c
-HELD_ELECTRIC_BOOST EQU $3d
-HELD_PSYCHIC_BOOST EQU $3e
-HELD_ICE_BOOST EQU $3f
-HELD_DRAGON_BOOST EQU $40
-HELD_DARK_BOOST EQU $41
-HELD_STEEL_BOOST EQU $42
+const_value = 40
+ const HELD_40
+ const HELD_41
+ const HELD_METAL_POWDER
-HELD_CATCH_CHANCE EQU $46
+const_value = 50
+ const HELD_NORMAL_BOOST
+ const HELD_FIGHTING_BOOST
+ const HELD_FLYING_BOOST
+ const HELD_POISON_BOOST
+ const HELD_GROUND_BOOST
+ const HELD_ROCK_BOOST
+ const HELD_BUG_BOOST
+ const HELD_GHOST_BOOST
+ const HELD_FIRE_BOOST
+ const HELD_WATER_BOOST
+ const HELD_GRASS_BOOST
+ const HELD_ELECTRIC_BOOST
+ const HELD_PSYCHIC_BOOST
+ const HELD_ICE_BOOST
+ const HELD_DRAGON_BOOST
+ const HELD_DARK_BOOST
+ const HELD_STEEL_BOOST
-HELD_ESCAPE EQU $48
-HELD_CRITICAL_UP EQU $49
-HELD_QUICK_CLAW EQU $4a
-HELD_TRADE_EVOLVE EQU $4b
-HELD_AMULET_COIN EQU $4c
-HELD_BRIGHTPOWDER EQU $4d
-HELD_FOCUS_BAND EQU $4f
+const_value = 70
+ const HELD_CATCH_CHANCE
+ const HELD_71
+ const HELD_ESCAPE
+ const HELD_CRITICAL_UP
+ const HELD_QUICK_CLAW
+ const HELD_TRADE_EVOLVE
+ const HELD_AMULET_COIN
+ const HELD_BRIGHTPOWDER
+ const HELD_4E
+ const HELD_FOCUS_BAND
diff --git a/engine/scripting.asm b/engine/scripting.asm
index 0fed45904..6999d624d 100644
--- a/engine/scripting.asm
+++ b/engine/scripting.asm
@@ -1465,9 +1465,9 @@ EarthquakeMovementEnd
Script_loadpikachudata: ; 0x973f0
; script command 0x5a
- ld a, $19
+ ld a, PIKACHU
ld [wd22e], a
- ld a, $5
+ ld a, 5
ld [CurPartyLevel], a
ret
; 0x973fb
@@ -2214,7 +2214,7 @@ Script_trainerclassname: ; 0x9772b
; id (SingleByteParam)
; memory (SingleByteParam)
- ld a, $7
+ ld a, TRAINER_NAME
ld [wcf61], a
jr Unknown_9771c ; 0x97730 $ea
; 0x97732
diff --git a/gfx/pics/animation.asm b/gfx/pics/animation.asm
index 775eeb075..8e646da93 100644
--- a/gfx/pics/animation.asm
+++ b/gfx/pics/animation.asm
@@ -54,26 +54,42 @@ Functiond003a: ; d003a
; d0042
-Unknown_d0042: ; d0042
- dw Unknown_d0054
- dw Unknown_d0058
- dw Unknown_d005c
- dw Unknown_d0064
- dw Unknown_d006e
- dw Unknown_d0076
- dw Unknown_d0080
- dw Unknown_d0088
- dw Unknown_d008b
-
-Unknown_d0054: db 11, 5, 7, 0
-Unknown_d0058: db 11, 4, 7, 0
-Unknown_d005c: db 10, 4, 7, 2, 3, 6, 7, 0
-Unknown_d0064: db 6, 8, 6, 7, 2, 3, 9, 4, 7, 0
-Unknown_d006e: db 6, 7, 2, 3,10, 4, 7, 0
-Unknown_d0076: db 6, 7,10, 4, 7, 2, 3, 6, 7, 0
-Unknown_d0080: db 10, 4, 7, 2, 3, 6, 7, 0
-Unknown_d0088: db 4, 7, 0
-Unknown_d008b: db 6, 7, 0
+POKEANIM: MACRO
+ rept _NARG
+
+; Workaround for a bug where macro args can't come after the start of a symbol
+if !def(\1_POKEANIM)
+\1_POKEANIM equs "PokeAnim_\1_"
+endc
+
+ db (\1_POKEANIM - PokeAnim_SetupCommands) / 2
+ shift
+ endr
+
+ db (PokeAnim_Finish_ - PokeAnim_SetupCommands) / 2
+ENDM
+
+
+PokeAnims: ; d0042
+ dw .Slow
+ dw .Normal
+ dw .Menu
+ dw .Trade
+ dw .Evolve
+ dw .Hatch
+ dw .Unused ; same as .Menu
+ dw .Egg1
+ dw .Egg2
+
+.Slow: POKEANIM Cry3, Setup2, Play
+.Normal: POKEANIM Cry3, Setup, Play
+.Menu: POKEANIM Cry2, Setup, Play, SetWait, Wait, Extra, Play
+.Trade: POKEANIM Extra, Play2, Extra, Play, SetWait, Wait, Cry, Setup, Play
+.Evolve: POKEANIM Extra, Play, SetWait, Wait, Cry2, Setup, Play
+.Hatch: POKEANIM Extra, Play, Cry2, Setup, Play, SetWait, Wait, Extra, Play
+.Unused: POKEANIM Cry2, Setup, Play, SetWait, Wait, Extra, Play
+.Egg1: POKEANIM Setup, Play
+.Egg2: POKEANIM Extra, Play
Functiond008e: ; d008e
@@ -93,7 +109,7 @@ Functiond00a3: ; d00a3
push hl
ld c, e
ld b, 0
- ld hl, Unknown_d0042
+ ld hl, PokeAnims
add hl, bc
add hl, bc
ld a, [hli]
@@ -118,7 +134,7 @@ Functiond00b4: ; d00b4
ld l, a
add hl, bc
ld a, [hl]
- ld hl, Jumptable_d00da
+ ld hl, PokeAnim_SetupCommands
rst JumpTable
ld a, [w2_d168]
ld c, a
@@ -131,29 +147,32 @@ Functiond00b4: ; d00b4
ret
; d00da
-Jumptable_d00da: ; d00da
- dw Functiond0171
- dw Functiond0166
- dw Functiond00f2
- dw Functiond00fe
- dw Functiond010b
- dw Functiond011d
- dw Functiond012f
- dw Functiond0141
- dw Functiond0155
- dw Functiond017a
- dw Functiond0188
- dw Functiond0196
+PokeAnim_SetupCommands: ; d00da
+setup_command: macro
+\1_: dw \1
+endm
+ setup_command PokeAnim_Finish
+ setup_command PokeAnim_Nop
+ setup_command PokeAnim_SetWait
+ setup_command PokeAnim_Wait
+ setup_command PokeAnim_Setup
+ setup_command PokeAnim_Setup2
+ setup_command PokeAnim_Extra
+ setup_command PokeAnim_Play
+ setup_command PokeAnim_Play2
+ setup_command PokeAnim_Cry
+ setup_command PokeAnim_Cry2
+ setup_command PokeAnim_Cry3
; d00f2
-Functiond00f2: ; d00f2
+PokeAnim_SetWait: ; d00f2
ld a, $12
ld [w2_d181], a
ld a, [w2_d168]
inc a
ld [w2_d168], a
-Functiond00fe: ; d00fe
+PokeAnim_Wait: ; d00fe
ld hl, w2_d181
dec [hl]
ret nz
@@ -163,7 +182,7 @@ Functiond00fe: ; d00fe
ret
; d010b
-Functiond010b: ; d010b
+PokeAnim_Setup: ; d010b
ld c, $0
ld b, $0
call Functiond0228
@@ -174,7 +193,7 @@ Functiond010b: ; d010b
ret
; d011d
-Functiond011d: ; d011d
+PokeAnim_Setup2: ; d011d
ld c, $0
ld b, $4
call Functiond0228
@@ -185,7 +204,7 @@ Functiond011d: ; d011d
ret
; d012f
-Functiond012f: ; d012f
+PokeAnim_Extra: ; d012f
ld c, $1
ld b, $0
call Functiond0228
@@ -196,7 +215,7 @@ Functiond012f: ; d012f
ret
; d0141
-Functiond0141: ; d0141
+PokeAnim_Play: ; d0141
call Functiond0250
ld a, [w2_d17e]
bit 7, a
@@ -208,7 +227,7 @@ Functiond0141: ; d0141
ret
; d0155
-Functiond0155: ; d0155
+PokeAnim_Play2: ; d0155
call Functiond0250
ld a, [w2_d17e]
bit 7, a
@@ -219,7 +238,7 @@ Functiond0155: ; d0155
ret
; d0166
-Functiond0166: ; d0166
+PokeAnim_Nop: ; d0166
call Functiond01a9
ld a, [w2_d168]
inc a
@@ -227,14 +246,14 @@ Functiond0166: ; d0166
ret
; d0171
-Functiond0171: ; d0171
+PokeAnim_Finish: ; d0171
call Functiond01a9
ld hl, w2_d168
set 7, [hl]
ret
; d017a
-Functiond017a: ; d017a
+PokeAnim_Cry: ; d017a
ld a, [w2_d16b]
call _PlayCry
ld a, [w2_d168]
@@ -243,7 +262,7 @@ Functiond017a: ; d017a
ret
; d0188
-Functiond0188: ; d0188
+PokeAnim_Cry2: ; d0188
ld a, [w2_d16b]
call PlayCry2
ld a, [w2_d168]
@@ -252,7 +271,7 @@ Functiond0188: ; d0188
ret
; d0196
-Functiond0196: ; d0196
+PokeAnim_Cry3: ; d0196
ld a, $f
ld [CryTracks], a
ld a, [w2_d16b]
@@ -346,7 +365,7 @@ Functiond0228: ; d0228
call ByteFill
pop bc
ld a, b
- ld [w2_d172 + 1], a
+ ld [w2_d173], a
ld a, c
ld [w2_d172], a
call Functiond055c
@@ -378,11 +397,11 @@ Functiond0261: ; d0261
call Functiond02f8
ld a, [w2_d182]
cp $ff
- jr z, Functiond02a8
+ jr z, PokeAnim_End
cp $fe
- jr z, Functiond028e
+ jr z, PokeAnim_SetRepeat
cp $fd
- jr z, Functiond0296
+ jr z, PokeAnim_DoRepeat
call Functiond02c8
ld a, [w2_d183]
call Functiond02ae
@@ -398,13 +417,13 @@ Functiond0282: ; d0282
ret
; d028e
-Functiond028e: ; d028e
+PokeAnim_SetRepeat: ; d028e
ld a, [w2_d183]
ld [w2_d17f], a
jr Functiond0253
; d0296
-Functiond0296: ; d0296
+PokeAnim_DoRepeat: ; d0296
ld a, [w2_d17f]
and a
ret z
@@ -416,7 +435,7 @@ Functiond0296: ; d0296
jr Functiond0253
; d02a8
-Functiond02a8: ; d02a8
+PokeAnim_End: ; d02a8
ld hl, w2_d17e
set 7, [hl]
ret
diff --git a/macros.asm b/macros.asm
index 79f6df03f..739df1bd4 100644
--- a/macros.asm
+++ b/macros.asm
@@ -1,3 +1,5 @@
+INCLUDE "macros/enum.asm"
+
INCLUDE "macros/event.asm"
INCLUDE "macros/sound.asm"
INCLUDE "macros/text.asm"
@@ -113,17 +115,6 @@ endanim: MACRO
ENDM
-; Constant enumeration
-
-const_def: MACRO
-const_value SET 0
-ENDM
-
-const: MACRO
-\1 EQU const_value
-const_value SET const_value + 1
-ENDM
-
sine_wave: MACRO
; \1: amplitude
diff --git a/macros/enum.asm b/macros/enum.asm
new file mode 100644
index 000000000..0a72d49d8
--- /dev/null
+++ b/macros/enum.asm
@@ -0,0 +1,31 @@
+; Enumerate variables
+
+enum_start: macro
+if _NARG >= 1
+__enum__ = \1
+else
+__enum__ = 0
+endc
+if _NARG >= 2
+__enumdir__ = \2
+else
+__enumdir__ = +1
+endc
+endm
+
+enum: macro
+\1 = __enum__
+__enum__ = __enum__ + __enumdir__
+endm
+
+
+; Enumerate constants
+
+const_def: MACRO
+const_value = 0
+ENDM
+
+const: MACRO
+\1 EQU const_value
+const_value = const_value + 1
+ENDM
diff --git a/macros/event.asm b/macros/event.asm
index 238f18f85..fe41050c9 100644
--- a/macros/event.asm
+++ b/macros/event.asm
@@ -1,88 +1,106 @@
+ enum_start
+
+ enum scall_command
scall: macro
- db $00
+ db scall_command
dw \1 ; pointer
endm
+ enum farscall_command
farscall: macro
- db $01
+ db farscall_command
db BANK(\1)
dw \1
endm
+ enum ptcall_command
ptcall: macro
- db $02
+ db ptcall_command
dw \1 ; pointer
endm
+ enum jump_command
jump: macro
- db $03
+ db jump_command
dw \1 ; pointer
endm
+ enum farjump_command
farjump: macro
- db $04
+ db farjump_command
db BANK(\1)
dw \1
endm
+ enum ptjump_command
ptjump: macro
- db $05
+ db ptjump_command
dw \1 ; pointer
endm
+ enum if_equal_command
if_equal: macro
- db $06
+ db if_equal_command
db \1 ; byte
dw \2 ; pointer
endm
+ enum if_not_equal_command
if_not_equal: macro
- db $07
+ db if_not_equal_command
db \1 ; byte
dw \2 ; pointer
endm
+ enum iffalse_command
iffalse: macro
- db $08
+ db iffalse_command
dw \1 ; pointer
endm
+ enum iftrue_command
iftrue: macro
- db $09
+ db iftrue_command
dw \1 ; pointer
endm
+ enum if_greater_than_command
if_greater_than: macro
- db $0a
+ db if_greater_than_command
db \1 ; byte
dw \2 ; pointer
endm
+ enum if_less_than_command
if_less_than: macro
- db $0b
+ db if_less_than_command
db \1 ; byte
dw \2 ; pointer
endm
+ enum jumpstd_command
jumpstd: macro
- db $0c
+ db jumpstd_command
dw \1 ; predefined_script
endm
+ enum callstd_command
callstd: macro
- db $0d
+ db callstd_command
dw \1 ; predefined_script
endm
+ enum callasm_command
callasm: macro
- db $0e
+ db callasm_command
db BANK(\1)
dw \1
endm
+ enum special_command
special: macro
- db $0f
+ db special_command
dw (\1Special - SpecialsPointers) / 3
endm
@@ -93,161 +111,191 @@ add_special: MACRO
ENDM
+ enum ptcallasm_command
ptcallasm: macro
- db $10
+ db ptcallasm_command
dw \1 ; asm
endm
+ enum checkmaptriggers_command
checkmaptriggers: macro
- db $11
+ db checkmaptriggers_command
db \1 ; map_group
db \2 ; map_id
endm
+ enum domaptrigger_command
domaptrigger: macro
- db $12
+ db domaptrigger_command
db \1 ; map_group
db \2 ; map_id
db \3 ; trigger_id
endm
+ enum checktriggers_command
checktriggers: macro
- db $13
+ db checktriggers_command
endm
+ enum dotrigger_command
dotrigger: macro
- db $14
+ db dotrigger_command
db \1 ; trigger_id
endm
+ enum writebyte_command
writebyte: macro
- db $15
+ db writebyte_command
db \1 ; value
endm
+ enum addvar_command
addvar: macro
- db $16
+ db addvar_command
db \1 ; value
endm
+ enum random_command
random: macro
- db $17
+ db random_command
db \1 ; input
endm
+ enum checkver_command
checkver: macro
- db $18
+ db checkver_command
endm
+ enum copybytetovar_command
copybytetovar: macro
- db $19
+ db copybytetovar_command
dw \1 ; address
endm
+ enum copyvartobyte_command
copyvartobyte: macro
- db $1a
+ db copyvartobyte_command
dw \1 ; address
endm
+ enum loadvar_command
loadvar: macro
- db $1b
+ db loadvar_command
dw \1 ; address
db \2 ; value
endm
+ enum checkcode_command
checkcode: macro
- db $1c
+ db checkcode_command
db \1 ; variable_id
endm
+ enum writevarcode_command
writevarcode: macro
- db $1d
+ db writevarcode_command
db \1 ; variable_id
endm
+ enum writecode_command
writecode: macro
- db $1e
+ db writecode_command
db \1 ; variable_id
db \2 ; value
endm
+ enum giveitem_command
giveitem: macro
- db $1f
+ db giveitem_command
db \1 ; item
db \2 ; quantity
endm
+ enum takeitem_command
takeitem: macro
- db $20
+ db takeitem_command
db \1 ; item
db \2 ; quantity
endm
+ enum checkitem_command
checkitem: macro
- db $21
+ db checkitem_command
db \1 ; item
endm
+ enum givemoney_command
givemoney: macro
- db $22
+ db givemoney_command
db \1 ; account
dt \2 ; money
endm
+ enum takemoney_command
takemoney: macro
- db $23
+ db takemoney_command
db \1 ; account
dt \2 ; money
endm
+ enum checkmoney_command
checkmoney: macro
- db $24
+ db checkmoney_command
db \1 ; account
dt \2 ; money
endm
+ enum givecoins_command
givecoins: macro
- db $25
+ db givecoins_command
dw \1 ; coins
endm
+ enum takecoins_command
takecoins: macro
- db $26
+ db takecoins_command
dw \1 ; coins
endm
+ enum checkcoins_command
checkcoins: macro
- db $27
+ db checkcoins_command
dw \1 ; coins
endm
+ enum addcellnum_command
addcellnum: macro
- db $28
+ db addcellnum_command
db \1 ; person
endm
+ enum delcellnum_command
delcellnum: macro
- db $29
+ db delcellnum_command
db \1 ; person
endm
+ enum checkcellnum_command
checkcellnum: macro
- db $2a
+ db checkcellnum_command
db \1 ; person
endm
+ enum checktime_command
checktime: macro
- db $2b
+ db checktime_command
db \1 ; time
endm
+ enum checkpoke_command
checkpoke: macro
- db $2c
+ db checkpoke_command
db \1 ; pkmn
endm
+ enum givepoke_command
givepoke: macro
- db $2d
+ db givepoke_command
db \1 ; pokemon
db \2 ; level
db \3 ; item
@@ -258,591 +306,709 @@ givepoke: macro
endc
endm
+ enum giveegg_command
giveegg: macro
- db $2e
+ db giveegg_command
db \1 ; pkmn
db \2 ; level
endm
+ enum givepokeitem_command
givepokeitem: macro
- db $2f
+ db givepokeitem_command
dw \1 ; pointer
endm
+ enum checkpokeitem_command
checkpokeitem: macro
- db $30
+ db checkpokeitem_command
dw \1 ; pointer
endm
+ enum checkevent_command
checkevent: macro
- db $31
+ db checkevent_command
dw \1 ; event_flag
endm
+ enum clearevent_command
clearevent: macro
- db $32
+ db clearevent_command
dw \1 ; event_flag
endm
+ enum setevent_command
setevent: macro
- db $33
+ db setevent_command
dw \1 ; event_flag
endm
+ enum checkflag_command
checkflag: macro
- db $34
+ db checkflag_command
dw \1 ; engine_flag
endm
+ enum clearflag_command
clearflag: macro
- db $35
+ db clearflag_command
dw \1 ; engine_flag
endm
+ enum setflag_command
setflag: macro
- db $36
+ db setflag_command
dw \1 ; engine_flag
endm
+ enum wildon_command
wildon: macro
- db $37
+ db wildon_command
endm
+ enum wildoff_command
wildoff: macro
- db $38
+ db wildoff_command
endm
+ enum xycompare_command
xycompare: macro
- db $39
+ db xycompare_command
dw \1 ; pointer
endm
+ enum warpmod_command
warpmod: macro
- db $3a
+ db warpmod_command
db \1 ; warp_id
db \2 ; map_group
db \3 ; map_id
endm
+ enum blackoutmod_command
blackoutmod: macro
- db $3b
+ db blackoutmod_command
db \1 ; map_group
db \2 ; map_id
endm
+ enum warp_command
warp: macro
- db $3c
+ db warp_command
db \1 ; map_group
db \2 ; map_id
db \3 ; x
db \4 ; y
endm
+ enum readmoney_command
readmoney: macro
- db $3d
+ db readmoney_command
db \1 ; account
db \2 ; memory
endm
+ enum readcoins_command
readcoins: macro
- db $3e
+ db readcoins_command
db \1 ; memory
endm
+ enum RAM2MEM_command
RAM2MEM: macro
- db $3f
+ db RAM2MEM_command
db \1 ; memory
endm
+ enum pokenamemem_command
pokenamemem: macro
- db $40
+ db pokenamemem_command
db \1 ; pokemon
db \2 ; memory
endm
+ enum itemtotext_command
itemtotext: macro
- db $41
+ db itemtotext_command
db \1 ; item
db \2 ; memory
endm
+ enum mapnametotext_command
mapnametotext: macro
- db $42
+ db mapnametotext_command
db \1 ; memory
endm
+ enum trainertotext_command
trainertotext: macro
- db $43
+ db trainertotext_command
db \1 ; trainer_id
db \2 ; trainer_group
db \3 ; memory
endm
+ enum stringtotext_command
stringtotext: macro
- db $44
+ db stringtotext_command
dw \1 ; text_pointer
db \2 ; memory
endm
+ enum itemnotify_command
itemnotify: macro
- db $45
+ db itemnotify_command
endm
+ enum pocketisfull_command
pocketisfull: macro
- db $46
+ db pocketisfull_command
endm
+ enum loadfont_command
loadfont: macro
- db $47
+ db loadfont_command
endm
+ enum refreshscreen_command
refreshscreen: macro
- db $48
+ db refreshscreen_command
db \1 ; dummy
endm
+ enum loadmovesprites_command
loadmovesprites: macro
- db $49
+ db loadmovesprites_command
endm
+ enum loadbytec1ce_command
loadbytec1ce: macro
- db $4a
+ db loadbytec1ce_command
db \1 ; byte
endm
+ enum farwritetext_command
farwritetext: macro
- db $4b
+ db farwritetext_command
db BANK(\1)
dw \1
endm
+ enum writetext_command
writetext: macro
- db $4c
+ db writetext_command
dw \1 ; text_pointer
endm
+ enum repeattext_command
repeattext: macro
- db $4d
+ db repeattext_command
db \1 ; byte
db \2 ; byte
endm
+ enum yesorno_command
yesorno: macro
- db $4e
+ db yesorno_command
endm
+ enum loadmenudata_command
loadmenudata: macro
- db $4f
+ db loadmenudata_command
dw \1 ; data
endm
+ enum writebackup_command
writebackup: macro
- db $50
+ db writebackup_command
endm
+ enum jumptextfaceplayer_command
jumptextfaceplayer: macro
- db $51
+ db jumptextfaceplayer_command
dw \1 ; text_pointer
endm
+ enum farjumptext_command
farjumptext: macro
- db $52
+ db farjumptext_command
db BANK(\1)
dw \1
endm
+ enum jumptext_command
jumptext: macro
- db $53
+ db jumptext_command
dw \1 ; text_pointer
endm
+ enum closetext_command
closetext: macro
- db $54
+ db closetext_command
endm
+ enum keeptextopen_command
keeptextopen: macro
- db $55
+ db keeptextopen_command
endm
+ enum pokepic_command
pokepic: macro
- db $56
+ db pokepic_command
db \1 ; pokemon
endm
+ enum pokepicyesorno_command
pokepicyesorno: macro
- db $57
+ db pokepicyesorno_command
endm
+ enum interpretmenu_command
interpretmenu: macro
- db $58
+ db interpretmenu_command
endm
+ enum interpretmenu2_command
interpretmenu2: macro
- db $59
+ db interpretmenu2_command
endm
+ enum loadpikachudata_command
loadpikachudata: macro
- db $5a
+ db loadpikachudata_command
endm
+ enum battlecheck_command
battlecheck: macro
- db $5b
+ db battlecheck_command
endm
+ enum loadtrainerdata_command
loadtrainerdata: macro
- db $5c
+ db loadtrainerdata_command
endm
+ enum loadpokedata_command
loadpokedata: macro
- db $5d
+ db loadpokedata_command
db \1 ; pokemon
db \2 ; level
endm
+ enum loadtrainer_command
loadtrainer: macro
- db $5e
+ db loadtrainer_command
db \1 ; trainer_group
db \2 ; trainer_id
endm
+ enum startbattle_command
startbattle: macro
- db $5f
+ db startbattle_command
endm
+ enum returnafterbattle_command
returnafterbattle: macro
- db $60
+ db returnafterbattle_command
endm
+ enum catchtutorial_command
catchtutorial: macro
- db $61
+ db catchtutorial_command
db \1 ; byte
endm
+ enum trainertext_command
trainertext: macro
- db $62
+ db trainertext_command
db \1 ; which_text
endm
+ enum trainerstatus_command
trainerstatus: macro
- db $63
+ db trainerstatus_command
db \1 ; action
endm
+ enum winlosstext_command
winlosstext: macro
- db $64
+ db winlosstext_command
dw \1 ; win_text_pointer
dw \2 ; loss_text_pointer
endm
+ enum scripttalkafter_command
scripttalkafter: macro
- db $65
+ db scripttalkafter_command
endm
+ enum talkaftercancel_command
talkaftercancel: macro
- db $66
+ db talkaftercancel_command
endm
+ enum talkaftercheck_command
talkaftercheck: macro
- db $67
+ db talkaftercheck_command
endm
+ enum setlasttalked_command
setlasttalked: macro
- db $68
+ db setlasttalked_command
db \1 ; person
endm
+ enum applymovement_command
applymovement: macro
- db $69
+ db applymovement_command
db \1 ; person
dw \2 ; data
endm
+ enum applymovement2_command
applymovement2: macro
- db $6a
+ db applymovement2_command
dw \1 ; data
endm
+ enum faceplayer_command
faceplayer: macro
- db $6b
+ db faceplayer_command
endm
+ enum faceperson_command
faceperson: macro
- db $6c
+ db faceperson_command
db \1 ; person1
db \2 ; person2
endm
+ enum variablesprite_command
variablesprite: macro
- db $6d
+ db variablesprite_command
db \1 ; byte
db \2 ; sprite
endm
+ enum disappear_command
disappear: macro
- db $6e
+ db disappear_command
db \1 ; person
endm
+ enum appear_command
appear: macro
- db $6f
+ db appear_command
db \1 ; person
endm
+ enum follow_command
follow: macro
- db $70
+ db follow_command
db \1 ; person2
db \2 ; person1
endm
+ enum stopfollow_command
stopfollow: macro
- db $71
+ db stopfollow_command
endm
+ enum moveperson_command
moveperson: macro
- db $72
+ db moveperson_command
db \1 ; person
db \2 ; x
db \3 ; y
endm
+ enum writepersonxy_command
writepersonxy: macro
- db $73
+ db writepersonxy_command
db \1 ; person
endm
+ enum loademote_command
loademote: macro
- db $74
+ db loademote_command
db \1 ; bubble
endm
+ enum showemote_command
showemote: macro
- db $75
+ db showemote_command
db \1 ; bubble
db \2 ; person
db \3 ; time
endm
+ enum spriteface_command
spriteface: macro
- db $76
+ db spriteface_command
db \1 ; person
db \2 ; facing
endm
+ enum follownotexact_command
follownotexact: macro
- db $77
+ db follownotexact_command
db \1 ; person2
db \2 ; person1
endm
+ enum earthquake_command
earthquake: macro
- db $78
+ db earthquake_command
db \1 ; param
endm
+ enum changemap_command
changemap: macro
- db $79
+ db changemap_command
dw \1 ; map_data_pointer
endm
+ enum changeblock_command
changeblock: macro
- db $7a
+ db changeblock_command
db \1 ; x
db \2 ; y
db \3 ; block
endm
+ enum reloadmap_command
reloadmap: macro
- db $7b
+ db reloadmap_command
endm
+ enum reloadmappart_command
reloadmappart: macro
- db $7c
+ db reloadmappart_command
endm
+ enum writecmdqueue_command
writecmdqueue: macro
- db $7d
+ db writecmdqueue_command
dw \1 ; queue_pointer
endm
+ enum delcmdqueue_command
delcmdqueue: macro
- db $7e
+ db delcmdqueue_command
db \1 ; byte
endm
+ enum playmusic_command
playmusic: macro
- db $7f
+ db playmusic_command
dw \1 ; music_pointer
endm
+ enum playrammusic_command
playrammusic: macro
- db $80
+ db playrammusic_command
endm
+ enum musicfadeout_command
musicfadeout: macro
- db $81
+ db musicfadeout_command
dw \1 ; music
db \2 ; fadetime
endm
+ enum playmapmusic_command
playmapmusic: macro
- db $82
+ db playmapmusic_command
endm
+ enum reloadmapmusic_command
reloadmapmusic: macro
- db $83
+ db reloadmapmusic_command
endm
+ enum cry_command
cry: macro
- db $84
+ db cry_command
dw \1 ; cry_id
endm
+ enum playsound_command
playsound: macro
- db $85
+ db playsound_command
dw \1 ; sound_pointer
endm
+ enum waitbutton_command
waitbutton: macro
- db $86
+ db waitbutton_command
endm
+ enum warpsound_command
warpsound: macro
- db $87
+ db warpsound_command
endm
+ enum specialsound_command
specialsound: macro
- db $88
+ db specialsound_command
endm
+ enum passtoengine_command
passtoengine: macro
- db $89
+ db passtoengine_command
db \1 ; data_pointer
endm
+ enum newloadmap_command
newloadmap: macro
- db $8a
+ db newloadmap_command
db \1 ; which_method
endm
+ enum pause_command
pause: macro
- db $8b
+ db pause_command
db \1 ; length
endm
+ enum deactivatefacing_command
deactivatefacing: macro
- db $8c
+ db deactivatefacing_command
db \1 ; time
endm
+ enum priorityjump_command
priorityjump: macro
- db $8d
+ db priorityjump_command
dw \1 ; pointer
endm
+ enum warpcheck_command
warpcheck: macro
- db $8e
+ db warpcheck_command
endm
+ enum ptpriorityjump_command
ptpriorityjump: macro
- db $8f
+ db ptpriorityjump_command
dw \1 ; pointer
endm
+ enum return_command
return: macro
- db $90
+ db return_command
endm
+ enum end_command
end: macro
- db $91
+ db end_command
endm
+ enum reloadandreturn_command
reloadandreturn: macro
- db $92
+ db reloadandreturn_command
db \1 ; which_method
endm
+ enum resetfuncs_command
resetfuncs: macro
- db $93
+ db resetfuncs_command
endm
+ enum pokemart_command
pokemart: macro
- db $94
+ db pokemart_command
db \1 ; dialog_id
dw \2 ; mart_id
endm
+ enum elevator_command
elevator: macro
- db $95
+ db elevator_command
dw \1 ; floor_list_pointer
endm
+ enum trade_command
trade: macro
- db $96
+ db trade_command
db \1 ; trade_id
endm
+ enum askforphonenumber_command
askforphonenumber: macro
- db $97
+ db askforphonenumber_command
db \1 ; number
endm
+ enum phonecall_command
phonecall: macro
- db $98
+ db phonecall_command
dw \1 ; caller_name
endm
+ enum hangup_command
hangup: macro
- db $99
+ db hangup_command
endm
+ enum describedecoration_command
describedecoration: macro
- db $9a
+ db describedecoration_command
db \1 ; byte
endm
+ enum fruittree_command
fruittree: macro
- db $9b
+ db fruittree_command
db \1 ; tree_id
endm
+ enum specialphonecall_command
specialphonecall: macro
- db $9c
+ db specialphonecall_command
dw \1 ; call_id
endm
+ enum checkphonecall_command
checkphonecall: macro
- db $9d
+ db checkphonecall_command
endm
+ enum verbosegiveitem_command
verbosegiveitem: macro
- db $9e
+ db verbosegiveitem_command
db \1 ; item
db \2 ; quantity
endm
+ enum verbosegiveitem2_command
verbosegiveitem2: macro
- db $9f
+ db verbosegiveitem2_command
db \1 ; item
db \2 ; var
endm
+ enum loadwilddata_command
loadwilddata: macro
- db $a0
+ db loadwilddata_command
db \1 ; flag
db \2 ; map_group
db \3 ; map_id
endm
+ enum halloffame_command
halloffame: macro
- db $a1
+ db halloffame_command
endm
+ enum credits_command
credits: macro
- db $a2
+ db credits_command
endm
+ enum warpfacing_command
warpfacing: macro
- db $a3
+ db warpfacing_command
db \1 ; facing
db \2 ; map_group
db \3 ; map_id
@@ -850,35 +1016,41 @@ warpfacing: macro
db \5 ; y
endm
+ enum storetext_command
storetext: macro
- db $a4
+ db storetext_command
db \1 ; memory
endm
+ enum displaylocation_command
displaylocation: macro
- db $a5
+ db displaylocation_command
db \1 ; id
db \2 ; memory
endm
+ enum trainerclassname_command
trainerclassname: macro
- db $a6
+ db trainerclassname_command
db \1 ; id
db \2 ; memory
endm
+ enum name_command
name: macro
- db $a7
+ db name_command
db \1 ; type
db \2 ; id
db \3 ; mempry
endm
+ enum wait_command
wait: macro
- db $a8
+ db wait_command
db \1 ; duration
endm
+ enum unknown0xa9_command
unknown0xa9: macro
- db $a9
+ db unknown0xa9_command
endm
diff --git a/macros/move_effect.asm b/macros/move_effect.asm
index 66e419db2..6cca15b2d 100644
--- a/macros/move_effect.asm
+++ b/macros/move_effect.asm
@@ -1,708 +1,186 @@
-checkturn: macro
- db $01
- endm
-
-checkobedience: macro
- db $02
- endm
-
-usedmovetext: macro
- db $03
- endm
-
-doturn: macro
- db $04
- endm
-
-critical: macro
- db $05
- endm
-
-damagestats: macro
- db $06
- endm
-
-stab: macro
- db $07
- endm
-
-damagevariation: macro
- db $08
- endm
-
-checkhit: macro
- db $09
- endm
-
-effect0x0a: macro
- db $0a
- endm
-
-effect0x0b: macro
- db $0b
- endm
-
-effect0x0c: macro
- db $0c
- endm
-
-resulttext: macro
- db $0d
- endm
-
-checkfaint: macro
- db $0e
- endm
-
-criticaltext: macro
- db $0f
- endm
-
-supereffectivetext: macro
- db $10
- endm
-
-checkdestinybond: macro
- db $11
- endm
-
-buildopponentrage: macro
- db $12
- endm
-
-poisontarget: macro
- db $13
- endm
-
-sleeptarget: macro
- db $14
- endm
-
-draintarget: macro
- db $15
- endm
-
-eatdream: macro
- db $16
- endm
-
-burntarget: macro
- db $17
- endm
-
-freezetarget: macro
- db $18
- endm
-
-paralyzetarget: macro
- db $19
- endm
-
-selfdestruct: macro
- db $1a
- endm
-
-mirrormove: macro
- db $1b
- endm
-
-statup: macro
- db $1c
- endm
-
-statdown: macro
- db $1d
- endm
-
-payday: macro
- db $1e
- endm
-
-conversion: macro
- db $1f
- endm
-
-resetstats: macro
- db $20
- endm
-
-storeenergy: macro
- db $21
- endm
-
-unleashenergy: macro
- db $22
- endm
-
-forceswitch: macro
- db $23
- endm
-
-endloop: macro
- db $24
- endm
-
-flinchtarget: macro
- db $25
- endm
-
-ohko: macro
- db $26
- endm
-
-recoil: macro
- db $27
- endm
-
-mist: macro
- db $28
- endm
-
-focusenergy: macro
- db $29
- endm
-
-confuse: macro
- db $2a
- endm
-
-confusetarget: macro
- db $2b
- endm
-
-heal: macro
- db $2c
- endm
-
-transform: macro
- db $2d
- endm
-
-screen: macro
- db $2e
- endm
-
-poison: macro
- db $2f
- endm
-
-paralyze: macro
- db $30
- endm
-
-substitute: macro
- db $31
- endm
-
-rechargenextturn: macro
- db $32
- endm
-
-mimic: macro
- db $33
- endm
-
-metronome: macro
- db $34
- endm
-
-leechseed: macro
- db $35
- endm
-
-splash: macro
- db $36
- endm
-
-disable: macro
- db $37
- endm
-
-cleartext: macro
- db $38
- endm
-
-charge: macro
- db $39
- endm
-
-checkcharge: macro
- db $3a
- endm
-
-traptarget: macro
- db $3b
- endm
-
-effect0x3c: macro
- db $3c
- endm
-
-rampage: macro
- db $3d
- endm
-
-checkrampage: macro
- db $3e
- endm
-
-constantdamage: macro
- db $3f
- endm
-
-counter: macro
- db $40
- endm
-
-encore: macro
- db $41
- endm
-
-painsplit: macro
- db $42
- endm
-
-snore: macro
- db $43
- endm
-
-conversion2: macro
- db $44
- endm
-
-lockon: macro
- db $45
- endm
-
-sketch: macro
- db $46
- endm
-
-defrostopponent: macro
- db $47
- endm
-
-sleeptalk: macro
- db $48
- endm
-
-destinybond: macro
- db $49
- endm
-
-spite: macro
- db $4a
- endm
-
-falseswipe: macro
- db $4b
- endm
-
-healbell: macro
- db $4c
- endm
-
-kingsrock: macro
- db $4d
- endm
-
-triplekick: macro
- db $4e
- endm
-
-kickcounter: macro
- db $4f
- endm
-
-thief: macro
- db $50
- endm
-
-arenatrap: macro
- db $51
- endm
-
-nightmare: macro
- db $52
- endm
-
-defrost: macro
- db $53
- endm
-
-curse: macro
- db $54
- endm
-
-protect: macro
- db $55
- endm
-
-spikes: macro
- db $56
- endm
-
-foresight: macro
- db $57
- endm
-
-perishsong: macro
- db $58
- endm
-
-startsandstorm: macro
- db $59
- endm
-
-endure: macro
- db $5a
- endm
-
-checkcurl: macro
- db $5b
- endm
-
-rolloutpower: macro
- db $5c
- endm
-
-effect0x5d: macro
- db $5d
- endm
-
-furycutter: macro
- db $5e
- endm
-
-attract: macro
- db $5f
- endm
-
-happinesspower: macro
- db $60
- endm
-
-present: macro
- db $61
- endm
-
-damagecalc: macro
- db $62
- endm
-
-frustrationpower: macro
- db $63
- endm
-
-safeguard: macro
- db $64
- endm
-
-checksafeguard: macro
- db $65
- endm
-
-getmagnitude: macro
- db $66
- endm
-
-batonpass: macro
- db $67
- endm
-
-pursuit: macro
- db $68
- endm
-
-clearhazards: macro
- db $69
- endm
-
-healmorn: macro
- db $6a
- endm
-
-healday: macro
- db $6b
- endm
-
-healnite: macro
- db $6c
- endm
-
-hiddenpower: macro
- db $6d
- endm
-
-startrain: macro
- db $6e
- endm
-
-startsun: macro
- db $6f
- endm
-
-attackup: macro
- db $70
- endm
-
-defenseup: macro
- db $71
- endm
-
-speedup: macro
- db $72
- endm
-
-specialattackup: macro
- db $73
- endm
-
-specialdefenseup: macro
- db $74
- endm
-
-accuracyup: macro
- db $75
- endm
-
-evasionup: macro
- db $76
- endm
-
-attackup2: macro
- db $77
- endm
-
-defenseup2: macro
- db $78
- endm
-
-speedup2: macro
- db $79
- endm
-
-specialattackup2: macro
- db $7a
- endm
-
-specialdefenseup2: macro
- db $7b
- endm
-
-accuracyup2: macro
- db $7c
- endm
-
-evasionup2: macro
- db $7d
- endm
-
-attackdown: macro
- db $7e
- endm
-
-defensedown: macro
- db $7f
- endm
-
-speeddown: macro
- db $80
- endm
-
-specialattackdown: macro
- db $81
- endm
-
-specialdefensedown: macro
- db $82
- endm
-
-accuracydown: macro
- db $83
- endm
-
-evasiondown: macro
- db $84
- endm
-
-attackdown2: macro
- db $85
- endm
-
-defensedown2: macro
- db $86
- endm
-
-speeddown2: macro
- db $87
- endm
-
-specialattackdown2: macro
- db $88
- endm
-
-specialdefensedown2: macro
- db $89
- endm
-
-accuracydown2: macro
- db $8a
- endm
-
-evasiondown2: macro
- db $8b
- endm
-
-statmessageuser: macro
- db $8c
- endm
-
-statmessagetarget: macro
- db $8d
- endm
-
-statupfailtext: macro
- db $8e
- endm
-
-statdownfailtext: macro
- db $8f
- endm
-
-effectchance: macro
- db $90
- endm
-
-effect0x91: macro
- db $91
- endm
-
-effect0x92: macro
- db $92
- endm
-
-switchturn: macro
- db $93
- endm
-
-fakeout: macro
- db $94
- endm
-
-bellydrum: macro
- db $95
- endm
-
-psychup: macro
- db $96
- endm
-
-rage: macro
- db $97
- endm
-
-doubleflyingdamage: macro
- db $98
- endm
-
-doubleundergrounddamage: macro
- db $99
- endm
-
-mirrorcoat: macro
- db $9a
- endm
-
-checkfuturesight: macro
- db $9b
- endm
-
-futuresight: macro
- db $9c
- endm
-
-doubleminimizedamage: macro
- db $9d
- endm
-
-skipsuncharge: macro
- db $9e
- endm
-
-thunderaccuracy: macro
- db $9f
- endm
-
-teleport: macro
- db $a0
- endm
-
-beatup: macro
- db $a1
- endm
-
-ragedamage: macro
- db $a2
- endm
-
-effect0xa3: macro
- db $a3
- endm
-
-allstatsup: macro
- db $a4
- endm
-
-effect0xa5: macro
- db $a5
- endm
-
-effect0xa6: macro
- db $a6
- endm
-
-effect0xa7: macro
- db $a7
- endm
-
-effect0xa8: macro
- db $a8
- endm
-
-clearmissdamage: macro
- db $a9
- endm
-
-movedelay: macro
- db $aa
- endm
-
-hittarget: macro
- db $ab
- endm
-
-tristatuschance: macro
- db $ac
- endm
-
-supereffectivelooptext: macro
- db $ad
- endm
-
-startloop: macro
- db $ae
- endm
-
-curl: macro
- db $af
- endm
-
-endturn: macro
- db $fe
- endm
-
-endmove: macro
- db $ff
- endm
-
+command: macro
+ enum \1_command
+\1 equs "db \1_command"
+endm
+
+ enum_start 1
+
+ command checkturn
+ command checkobedience
+ command usedmovetext
+ command doturn
+ command critical
+ command damagestats
+ command stab
+ command damagevariation
+ command checkhit
+ command effect0x0a
+ command effect0x0b
+ command effect0x0c
+ command resulttext
+ command checkfaint
+ command criticaltext
+ command supereffectivetext
+ command checkdestinybond
+ command buildopponentrage
+ command poisontarget
+ command sleeptarget
+ command draintarget
+ command eatdream
+ command burntarget
+ command freezetarget
+ command paralyzetarget
+ command selfdestruct
+ command mirrormove
+ command statup
+ command statdown
+ command payday
+ command conversion
+ command resetstats
+ command storeenergy
+ command unleashenergy
+ command forceswitch
+ command endloop
+ command flinchtarget
+ command ohko
+ command recoil
+ command mist
+ command focusenergy
+ command confuse
+ command confusetarget
+ command heal
+ command transform
+ command screen
+ command poison
+ command paralyze
+ command substitute
+ command rechargenextturn
+ command mimic
+ command metronome
+ command leechseed
+ command splash
+ command disable
+ command cleartext
+ command charge
+ command checkcharge
+ command traptarget
+ command effect0x3c
+ command rampage
+ command checkrampage
+ command constantdamage
+ command counter
+ command encore
+ command painsplit
+ command snore
+ command conversion2
+ command lockon
+ command sketch
+ command defrostopponent
+ command sleeptalk
+ command destinybond
+ command spite
+ command falseswipe
+ command healbell
+ command kingsrock
+ command triplekick
+ command kickcounter
+ command thief
+ command arenatrap
+ command nightmare
+ command defrost
+ command curse
+ command protect
+ command spikes
+ command foresight
+ command perishsong
+ command startsandstorm
+ command endure
+ command checkcurl
+ command rolloutpower
+ command effect0x5d
+ command furycutter
+ command attract
+ command happinesspower
+ command present
+ command damagecalc
+ command frustrationpower
+ command safeguard
+ command checksafeguard
+ command getmagnitude
+ command batonpass
+ command pursuit
+ command clearhazards
+ command healmorn
+ command healday
+ command healnite
+ command hiddenpower
+ command startrain
+ command startsun
+ command attackup
+ command defenseup
+ command speedup
+ command specialattackup
+ command specialdefenseup
+ command accuracyup
+ command evasionup
+ command attackup2
+ command defenseup2
+ command speedup2
+ command specialattackup2
+ command specialdefenseup2
+ command accuracyup2
+ command evasionup2
+ command attackdown
+ command defensedown
+ command speeddown
+ command specialattackdown
+ command specialdefensedown
+ command accuracydown
+ command evasiondown
+ command attackdown2
+ command defensedown2
+ command speeddown2
+ command specialattackdown2
+ command specialdefensedown2
+ command accuracydown2
+ command evasiondown2
+ command statmessageuser
+ command statmessagetarget
+ command statupfailtext
+ command statdownfailtext
+ command effectchance
+ command effect0x91
+ command effect0x92
+ command switchturn
+ command fakeout
+ command bellydrum
+ command psychup
+ command rage
+ command doubleflyingdamage
+ command doubleundergrounddamage
+ command mirrorcoat
+ command checkfuturesight
+ command futuresight
+ command doubleminimizedamage
+ command skipsuncharge
+ command thunderaccuracy
+ command teleport
+ command beatup
+ command ragedamage
+ command effect0xa3
+ command allstatsup
+ command effect0xa5
+ command effect0xa6
+ command effect0xa7
+ command effect0xa8
+ command clearmissdamage
+ command movedelay
+ command hittarget
+ command tristatuschance
+ command supereffectivelooptext
+ command startloop
+ command curl
+
+ enum_start -1, -1
+ command endmove
+ command endturn
diff --git a/main.asm b/main.asm
index 4468e3c60..76b6f7c00 100644
--- a/main.asm
+++ b/main.asm
@@ -15456,7 +15456,7 @@ Function1365b:: ; 1365b
call IsInArray
jr nc, .asm_1367f
- ld a, $c ; jumpstd
+ ld a, jumpstd_command
ld [wd03f], a
inc hl
ld a, [hli]