shithub: pokecrystal

Download patch

ref: e48a401290e794854880f06fc230a369f37e6b9b
parent: 8745915dbd38e9647e0b27d20cb73da0fdde353f
author: Remy Oukaour <remy.oukaour@gmail.com>
date: Wed Dec 13 19:36:24 EST 2017

Reorganize macros

--- a/battle/moves/moves.asm
+++ b/battle/moves/moves.asm
@@ -1,4 +1,3 @@
-Moves: ; 41afb
 ; Characteristics of each move.
 
 move: MACRO
@@ -11,6 +10,8 @@
 	db \7 percent ; effect chance
 ENDM
 
+Moves: ; 41afb
+; entries correspond to constants/move_constants.asm
 	move POUND,        EFFECT_NORMAL_HIT,         40, NORMAL,   100, 35,   0
 	move KARATE_CHOP,  EFFECT_NORMAL_HIT,         50, FIGHTING, 100, 25,   0
 	move DOUBLESLAP,   EFFECT_MULTI_HIT,          15, NORMAL,    85, 10,   0
--- a/battle/objects/data.asm
+++ b/battle/objects/data.asm
@@ -1,4 +1,6 @@
-BattleAnimObjects: ; ccb56
+ABSOLUTE_X EQU $00
+RELATIVE_X EQU $01
+
 battleanimobj: MACRO
 	db \1 ; flags
 	; bit 7: priority
@@ -14,572 +16,194 @@
 	db \6 ; tile offset
 endm
 
-ABSOLUTE_X EQU $00
-RELATIVE_X EQU $01
-
-
-; ANIM_OBJ_00
-	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_00, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01
-
-; ANIM_OBJ_01
-	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_01, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01
-
-; ANIM_OBJ_02
-	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_02, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01
-
-; ANIM_OBJ_03
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_00, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01
-
-; ANIM_OBJ_04
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_01, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01
-
-; ANIM_OBJ_05
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_02, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01
-
-; ANIM_OBJ_06
-	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_03, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01
-
-; ANIM_OBJ_07
-	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_04, BATTLEANIMFUNC_1B, PAL_BATTLE_OB_GRAY, $01
-
-; ANIM_OBJ_08
-	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_05, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01
-
-; ANIM_OBJ_09
-	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_06, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01
-
-; ANIM_OBJ_0A
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_07, BATTLEANIMFUNC_09, PAL_BATTLE_OB_GRAY, $01
-
-; ANIM_OBJ_0B
-	battleanimobj RELATIVE_X, $aa, BATTLEANIMFRAMESET_10, BATTLEANIMFUNC_10, PAL_BATTLE_OB_RED, $03
-
-; ANIM_OBJ_0C
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_0E, BATTLEANIMFUNC_04, PAL_BATTLE_OB_RED, $03
-
-; ANIM_OBJ_0D
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_0F, BATTLEANIMFUNC_03, PAL_BATTLE_OB_RED, $03
-
-; ANIM_OBJ_0E
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_10, BATTLEANIMFUNC_08, PAL_BATTLE_OB_RED, $03
-
-; ANIM_OBJ_0F
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_0F, BATTLEANIMFUNC_0A, PAL_BATTLE_OB_RED, $03
-
-; ANIM_OBJ_BURNED
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_11, BATTLEANIMFUNC_03, PAL_BATTLE_OB_RED, $03
-
-; ANIM_OBJ_BLIZZARD
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_12, BATTLEANIMFUNC_08, PAL_BATTLE_OB_BLUE, $0a
-
-; ANIM_OBJ_12
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_13, BATTLEANIMFUNC_00, PAL_BATTLE_OB_BLUE, $0a
-
-; ANIM_OBJ_ICE_BEAM
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_14, BATTLEANIMFUNC_01, PAL_BATTLE_OB_BLUE, $0a
-
-; ANIM_OBJ_RAZOR_LEAF
-	battleanimobj RELATIVE_X | X_FLIP, $78, BATTLEANIMFRAMESET_16, BATTLEANIMFUNC_RAZOR_LEAF, PAL_BATTLE_OB_GREEN, $06
-
-; ANIM_OBJ_POKE_BALL
-	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_09, BATTLEANIMFUNC_12, PAL_BATTLE_OB_RED, $0b
-
-; ANIM_OBJ_POKE_BALL_BLOCKED
-	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_09, BATTLEANIMFUNC_13, PAL_BATTLE_OB_RED, $0b
-
-; ANIM_OBJ_17
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_18, BATTLEANIMFUNC_00, PAL_BATTLE_OB_RED, $08
-
-; ANIM_OBJ_18
-	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_18, BATTLEANIMFUNC_00, PAL_BATTLE_OB_RED, $08
-
-; ANIM_OBJ_19
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_1D, BATTLEANIMFUNC_06, PAL_BATTLE_OB_GRAY, $0c
-
-; ANIM_OBJ_1A
-	battleanimobj RELATIVE_X, $b4, BATTLEANIMFRAMESET_1F, BATTLEANIMFUNC_38, PAL_BATTLE_OB_GRAY, $0c
-
-; ANIM_OBJ_1B
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_08, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $07
-
-; ANIM_OBJ_BALL_POOF
-	battleanimobj RELATIVE_X, $a0, BATTLEANIMFRAMESET_08, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $07
-
-; ANIM_OBJ_1D
-	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_19, BATTLEANIMFUNC_07, PAL_BATTLE_OB_BROWN, $09
-
-; ANIM_OBJ_1E
-	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_1A, BATTLEANIMFUNC_07, PAL_BATTLE_OB_BROWN, $09
-
-; ANIM_OBJ_1F
-	battleanimobj RELATIVE_X, $b0, BATTLEANIMFRAMESET_1B, BATTLEANIMFUNC_36, PAL_BATTLE_OB_BROWN, $09
-
-; ANIM_OBJ_20
-	battleanimobj RELATIVE_X, $b0, BATTLEANIMFRAMESET_84, BATTLEANIMFUNC_36, PAL_BATTLE_OB_BLUE, $21
-
-; ANIM_OBJ_BUBBLE
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_21, BATTLEANIMFUNC_0C, PAL_BATTLE_OB_BLUE, $0d
-
-; ANIM_OBJ_22
-	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_23, BATTLEANIMFUNC_0D, PAL_BATTLE_OB_BLUE, $0d
-
-; ANIM_OBJ_23
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_0E, PAL_BATTLE_OB_GRAY, $0e
-
-; ANIM_OBJ_24
-	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $80, BATTLEANIMFRAMESET_27, BATTLEANIMFUNC_0F, PAL_BATTLE_OB_BLUE, $04
-
-; ANIM_OBJ_25
-	battleanimobj RELATIVE_X, $b4, BATTLEANIMFRAMESET_2A, BATTLEANIMFUNC_00, PAL_BATTLE_OB_BLUE, $04
-
-; ANIM_OBJ_26
-	battleanimobj RELATIVE_X, $40, BATTLEANIMFRAMESET_2B, BATTLEANIMFUNC_11, PAL_BATTLE_OB_GREEN, $0f
-
-; ANIM_OBJ_27
-	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $98, BATTLEANIMFRAMESET_2C, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $10
-
-; ANIM_OBJ_28
-	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $98, BATTLEANIMFRAMESET_2D, BATTLEANIMFUNC_09, PAL_BATTLE_OB_YELLOW, $10
-
-; ANIM_OBJ_ICE_BUILDUP
-	battleanimobj RELATIVE_X, $b8, BATTLEANIMFRAMESET_2E, BATTLEANIMFUNC_00, PAL_BATTLE_OB_BLUE, $0a
-
-; ANIM_OBJ_FROZEN
-	battleanimobj RELATIVE_X, $b8, BATTLEANIMFRAMESET_2F, BATTLEANIMFUNC_00, PAL_BATTLE_OB_BLUE, $0a
-
-; ANIM_OBJ_MASTER_BALL_SPARKLE
-	battleanimobj RELATIVE_X, $b8, BATTLEANIMFRAMESET_30, BATTLEANIMFUNC_14, PAL_BATTLE_OB_BROWN, $11
-
-; ANIM_OBJ_2C
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_21, BATTLEANIMFUNC_14, PAL_BATTLE_OB_YELLOW, $0d
-
-; ANIM_OBJ_2D
-	battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLEANIMFRAMESET_31, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $05
-
-; ANIM_OBJ_2E
-	battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLEANIMFRAMESET_32, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $05
-
-; ANIM_OBJ_2F
-	battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLEANIMFRAMESET_33, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $05
-
-; ANIM_OBJ_30
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_34, BATTLEANIMFUNC_15, PAL_BATTLE_OB_YELLOW, $05
-
-; ANIM_OBJ_31
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_36, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $05
-
-; ANIM_OBJ_LIGHTNING_BOLT
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_37, BATTLEANIMFUNC_03, PAL_BATTLE_OB_GRAY, $08
-
-; ANIM_OBJ_33
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_38, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $05
-
-; ANIM_OBJ_34
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_39, BATTLEANIMFUNC_03, PAL_BATTLE_OB_GRAY, $08
-
-; ANIM_OBJ_35
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_3A, BATTLEANIMFUNC_16, PAL_BATTLE_OB_GRAY, $02
-
-; ANIM_OBJ_36
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_3C, BATTLEANIMFUNC_17, PAL_BATTLE_OB_GRAY, $02
-
-; ANIM_OBJ_37
-	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_3E, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $02
-
-; ANIM_OBJ_38
-	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_3F, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $02
-
-; ANIM_OBJ_39
-	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_40, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $02
-
-; ANIM_OBJ_3A
-	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_41, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $02
-
-; ANIM_OBJ_3B
-	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_42, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $02
-
-; ANIM_OBJ_3C
-	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_43, BATTLEANIMFUNC_18, PAL_BATTLE_OB_GREEN, $12
-
-; ANIM_OBJ_3D
-	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_44, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GREEN, $12
-
-; ANIM_OBJ_GUST
-	battleanimobj RELATIVE_X | X_FLIP, $b8, BATTLEANIMFRAMESET_45, BATTLEANIMFUNC_19, PAL_BATTLE_OB_GRAY, $13
-
-; ANIM_OBJ_3F
-	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_46, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $14
-
-; ANIM_OBJ_40
-	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_47, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $14
-
-; ANIM_OBJ_41
-	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_48, BATTLEANIMFUNC_1A, PAL_BATTLE_OB_GRAY, $14
-
-; ANIM_OBJ_42
-	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_49, BATTLEANIMFUNC_1A, PAL_BATTLE_OB_GRAY, $14
-
-; ANIM_OBJ_43
-	battleanimobj RELATIVE_X | X_FLIP, $98, BATTLEANIMFRAMESET_4A, BATTLEANIMFUNC_01, PAL_BATTLE_OB_GRAY, $14
-
-; ANIM_OBJ_44
-	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_4B, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $11
-
-; ANIM_OBJ_ABSORB
-	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_4C, BATTLEANIMFUNC_1C, PAL_BATTLE_OB_GREEN, $12
-
-; ANIM_OBJ_46
-	battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLEANIMFRAMESET_4D, BATTLEANIMFUNC_1D, PAL_BATTLE_OB_GRAY, $15
-
-; ANIM_OBJ_47
-	battleanimobj RELATIVE_X, $b0, BATTLEANIMFRAMESET_51, BATTLEANIMFUNC_1E, PAL_BATTLE_OB_YELLOW, $11
-
-; ANIM_OBJ_48
-	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_52, BATTLEANIMFUNC_1F, PAL_BATTLE_OB_GREEN, $16
-
-; ANIM_OBJ_49
-	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_54, BATTLEANIMFUNC_1F, PAL_BATTLE_OB_GREEN, $16
-
-; ANIM_OBJ_LEECH_SEED
-	battleanimobj RELATIVE_X | X_FLIP, $68, BATTLEANIMFRAMESET_56, BATTLEANIMFUNC_LEECH_SEED, PAL_BATTLE_OB_GREEN, $06
-
-; ANIM_OBJ_4B
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_59, BATTLEANIMFUNC_21, PAL_BATTLE_OB_GRAY, $0e
-
-; ANIM_OBJ_4C
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_5C, BATTLEANIMFUNC_02, PAL_BATTLE_OB_GRAY, $17
-
-; ANIM_OBJ_4D
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_5D, BATTLEANIMFUNC_22, PAL_BATTLE_OB_YELLOW, $11
-
-; ANIM_OBJ_4E
-	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $88, BATTLEANIMFRAMESET_5F, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $10
-
-; ANIM_OBJ_4F
-	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $88, BATTLEANIMFRAMESET_2D, BATTLEANIMFUNC_09, PAL_BATTLE_OB_YELLOW, $10
-
-; ANIM_OBJ_50
-	battleanimobj RELATIVE_X | X_FLIP, $88, BATTLEANIMFRAMESET_60, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $18
-
-; ANIM_OBJ_51
-	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_60, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $18
-
-; ANIM_OBJ_CHICK
-	battleanimobj RELATIVE_X | X_FLIP, $50, BATTLEANIMFRAMESET_61, BATTLEANIMFUNC_23, PAL_BATTLE_OB_YELLOW, $19
-
-; ANIM_OBJ_53
-	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_63, BATTLEANIMFUNC_24, PAL_BATTLE_OB_GRAY, $19
-
-; ANIM_OBJ_54
-	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_66, BATTLEANIMFUNC_25, PAL_BATTLE_OB_GRAY, $19
-
-; ANIM_OBJ_SKULL
-	battleanimobj RELATIVE_X, $50, BATTLEANIMFRAMESET_1C, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $0c
-
-; ANIM_OBJ_56
-	battleanimobj RELATIVE_X | X_FLIP, $a8, BATTLEANIMFRAMESET_67, BATTLEANIMFUNC_26, PAL_BATTLE_OB_BROWN, $1a
-
-; ANIM_OBJ_57
-	battleanimobj RELATIVE_X | X_FLIP, $a8, BATTLEANIMFRAMESET_68, BATTLEANIMFUNC_00, PAL_BATTLE_OB_BROWN, $1a
-
-; ANIM_OBJ_58
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_69, BATTLEANIMFUNC_01, PAL_BATTLE_OB_GRAY, $1a
-
-; ANIM_OBJ_PARALYZED
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_6D, BATTLEANIMFUNC_28, PAL_BATTLE_OB_YELLOW, $19
-
-; ANIM_OBJ_5A
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_6A, BATTLEANIMFUNC_27, PAL_BATTLE_OB_GRAY, $1b
-
-; ANIM_OBJ_HAZE
-	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_6F, BATTLEANIMFUNC_SPRIAL_DESCENT, PAL_BATTLE_OB_GRAY, $1c
-
-; ANIM_OBJ_MIST
-	battleanimobj RELATIVE_X | X_FLIP, $48, BATTLEANIMFRAMESET_70, BATTLEANIMFUNC_SPRIAL_DESCENT, PAL_BATTLE_OB_GRAY, $1c
-
-; ANIM_OBJ_SMOG
-	battleanimobj RELATIVE_X | X_FLIP, $48, BATTLEANIMFRAMESET_6F, BATTLEANIMFUNC_SPRIAL_DESCENT, PAL_BATTLE_OB_GRAY, $1c
-
-; ANIM_OBJ_POISON_GAS
-	battleanimobj RELATIVE_X | X_FLIP, $78, BATTLEANIMFRAMESET_6F, BATTLEANIMFUNC_POISON_GAS, PAL_BATTLE_OB_GRAY, $1c
-
-; ANIM_OBJ_HORN
-	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $90, BATTLEANIMFRAMESET_71, BATTLEANIMFUNC_HORN, PAL_BATTLE_OB_GRAY, $1d
-
-; ANIM_OBJ_60
-	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $90, BATTLEANIMFRAMESET_72, BATTLEANIMFUNC_2C, PAL_BATTLE_OB_GRAY, $1d
-
-; ANIM_OBJ_61
-	battleanimobj RELATIVE_X, $48, BATTLEANIMFRAMESET_73, BATTLEANIMFUNC_2D, PAL_BATTLE_OB_RED, $1e
-
-; ANIM_OBJ_62
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_06, PAL_BATTLE_OB_GRAY, $15
-
-; ANIM_OBJ_63
-	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_75, BATTLEANIMFUNC_2E, PAL_BATTLE_OB_BROWN, $19
-
-; ANIM_OBJ_64
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_4A, BATTLEANIMFUNC_02, PAL_BATTLE_OB_GRAY, $14
-
-; ANIM_OBJ_65
-	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_30, BATTLEANIMFUNC_2F, PAL_BATTLE_OB_GRAY, $11
-
-; ANIM_OBJ_66
-	battleanimobj RELATIVE_X, $78, BATTLEANIMFRAMESET_76, BATTLEANIMFUNC_POISON_GAS, PAL_BATTLE_OB_RED, $23
-
-; ANIM_OBJ_67
-	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_77, BATTLEANIMFUNC_30, PAL_BATTLE_OB_GRAY, $1f
-
-; ANIM_OBJ_68
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_77, BATTLEANIMFUNC_02, PAL_BATTLE_OB_GRAY, $1f
-
-; ANIM_OBJ_69
-	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_77, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $1f
-
-; ANIM_OBJ_6A
-	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_78, BATTLEANIMFUNC_08, PAL_BATTLE_OB_YELLOW, $23
-
-; ANIM_OBJ_6B
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_79, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $1f
-
-; ANIM_OBJ_6C
-	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_7A, BATTLEANIMFUNC_31, PAL_BATTLE_OB_YELLOW, $11
-
-; ANIM_OBJ_6D
-	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_7A, BATTLEANIMFUNC_31, PAL_BATTLE_OB_YELLOW, $11
-
-; ANIM_OBJ_SKY_ATTACK_FEAROW
-	battleanimobj RELATIVE_X | X_FLIP, $88, BATTLEANIMFRAMESET_7B, BATTLEANIMFUNC_32, PAL_BATTLE_OB_GRAY, $20
-
-; ANIM_OBJ_LICK
-	battleanimobj RELATIVE_X | X_FLIP, $98, BATTLEANIMFRAMESET_7C, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $04
-
-; ANIM_OBJ_WITHDRAW
-	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_7D, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $18
-
-; ANIM_OBJ_71
-	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_21, BATTLEANIMFUNC_2F, PAL_BATTLE_OB_BLUE, $0d
-
-; ANIM_OBJ_72
-	battleanimobj RELATIVE_X, $b0, BATTLEANIMFRAMESET_7E, BATTLEANIMFUNC_33, PAL_BATTLE_OB_YELLOW, $12
-
-; ANIM_OBJ_73
-	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_7F, BATTLEANIMFUNC_2F, PAL_BATTLE_OB_GRAY, $08
-
-; ANIM_OBJ_74
-	battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLEANIMFRAMESET_6F, BATTLEANIMFUNC_34, PAL_BATTLE_OB_GRAY, $1c
-
-; ANIM_OBJ_75
-	battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_35, PAL_BATTLE_OB_GRAY, $15
-
-; ANIM_OBJ_76
-	battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLEANIMFRAMESET_80, BATTLEANIMFUNC_33, PAL_BATTLE_OB_GRAY, $14
-
-; ANIM_OBJ_77
-	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_81, BATTLEANIMFUNC_37, PAL_BATTLE_OB_GRAY, $11
-
-; ANIM_OBJ_78
-	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_85, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $22
-
-; ANIM_OBJ_79
-	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_86, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $22
-
-; ANIM_OBJ_7A
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_87, BATTLEANIMFUNC_39, PAL_BATTLE_OB_GRAY, $1f
-
-; ANIM_OBJ_7B
-	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_30, BATTLEANIMFUNC_3A, PAL_BATTLE_OB_YELLOW, $11
-
-; ANIM_OBJ_7C
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_34, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $05
-
-; ANIM_OBJ_7D
-	battleanimobj RELATIVE_X | X_FLIP | BEHIND_BG, $88, BATTLEANIMFRAMESET_88, BATTLEANIMFUNC_3B, PAL_BATTLE_OB_BLUE, $13
-
-; ANIM_OBJ_HEART
-	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_76, BATTLEANIMFUNC_25, PAL_BATTLE_OB_RED, $23
-
-; ANIM_OBJ_7F
-	battleanimobj RELATIVE_X, $98, BATTLEANIMFRAMESET_10, BATTLEANIMFUNC_34, PAL_BATTLE_OB_RED, $03
-
-; ANIM_OBJ_80
-	battleanimobj RELATIVE_X, $a8, BATTLEANIMFRAMESET_0F, BATTLEANIMFUNC_3C, PAL_BATTLE_OB_RED, $03
-
-; ANIM_OBJ_COTTON_SPORE
-	battleanimobj RELATIVE_X | X_FLIP, $68, BATTLEANIMFRAMESET_89, BATTLEANIMFUNC_SPRIAL_DESCENT, PAL_BATTLE_OB_GRAY, $1f
-
-; ANIM_OBJ_82
-	battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLEANIMFRAMESET_8A, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $1f
-
-; ANIM_OBJ_83
-	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_8C, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $1f
-
-; ANIM_OBJ_84
-	battleanimobj RELATIVE_X | X_FLIP, $50, BATTLEANIMFRAMESET_8D, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $1f
-
-; ANIM_OBJ_85
-	battleanimobj RELATIVE_X, $40, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_40, PAL_BATTLE_OB_GRAY, $0e
-
-; ANIM_OBJ_86
-	battleanimobj RELATIVE_X | X_FLIP, $a8, BATTLEANIMFRAMESET_8E, BATTLEANIMFUNC_41, PAL_BATTLE_OB_RED, $1f
-
-; ANIM_OBJ_87
-	battleanimobj RELATIVE_X | X_FLIP, $88, BATTLEANIMFRAMESET_8F, BATTLEANIMFUNC_3E, PAL_BATTLE_OB_GRAY, $1f
-
-; ANIM_OBJ_88
-	battleanimobj RELATIVE_X | X_FLIP, $88, BATTLEANIMFRAMESET_93, BATTLEANIMFUNC_3E, PAL_BATTLE_OB_GRAY, $1f
-
-; ANIM_OBJ_89
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_97, BATTLEANIMFUNC_3D, PAL_BATTLE_OB_GRAY, $1f
-
-; ANIM_OBJ_8A
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_78, BATTLEANIMFUNC_3D, PAL_BATTLE_OB_YELLOW, $23
-
-; ANIM_OBJ_8B
-	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_99, BATTLEANIMFUNC_2E, PAL_BATTLE_OB_GRAY, $19
-
-; ANIM_OBJ_8C
-	battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_02, PAL_BATTLE_OB_GRAY, $15
-
-; ANIM_OBJ_8D
-	battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLEANIMFRAMESET_99, BATTLEANIMFUNC_35, PAL_BATTLE_OB_RED, $19
-
-; ANIM_OBJ_SPIKES
-	battleanimobj RELATIVE_X | X_FLIP, $70, BATTLEANIMFRAMESET_8B, BATTLEANIMFUNC_3F, PAL_BATTLE_OB_GRAY, $1f
-
-; ANIM_OBJ_8F
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_15, BATTLEANIMFUNC_08, PAL_BATTLE_OB_GRAY, $0a
-
-; ANIM_OBJ_90
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_11, BATTLEANIMFUNC_02, PAL_BATTLE_OB_RED, $03
-
-; ANIM_OBJ_91
-	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_7F, BATTLEANIMFUNC_42, PAL_BATTLE_OB_GRAY, $08
-
-; ANIM_OBJ_92
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_9A, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $1b
-
-; ANIM_OBJ_93
-	battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLEANIMFRAMESET_9B, BATTLEANIMFUNC_35, PAL_BATTLE_OB_RED, $23
-
-; ANIM_OBJ_94
-	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_9C, BATTLEANIMFUNC_23, PAL_BATTLE_OB_GRAY, $25
-
-; ANIM_OBJ_95
-	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_9D, BATTLEANIMFUNC_25, PAL_BATTLE_OB_GRAY, $25
-
-; ANIM_OBJ_96
-	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_9C, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $25
-
-; ANIM_OBJ_97
-	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_9E, BATTLEANIMFUNC_00, PAL_BATTLE_OB_BLUE, $25
-
-; ANIM_OBJ_98
-	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $80, BATTLEANIMFRAMESET_9F, BATTLEANIMFUNC_3A, PAL_BATTLE_OB_GREEN, $23
-
-; ANIM_OBJ_99
-	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_A0, BATTLEANIMFUNC_16, PAL_BATTLE_OB_GRAY, $23
-
-; ANIM_OBJ_9A
-	battleanimobj RELATIVE_X | X_FLIP, $70, BATTLEANIMFRAMESET_78, BATTLEANIMFUNC_43, PAL_BATTLE_OB_YELLOW, $23
-
-; ANIM_OBJ_9B
-	battleanimobj RELATIVE_X | X_FLIP, $c0, BATTLEANIMFRAMESET_A2, BATTLEANIMFUNC_01, PAL_BATTLE_OB_GRAY, $25
-
-; ANIM_OBJ_9C
-	battleanimobj RELATIVE_X | X_FLIP, $40, BATTLEANIMFRAMESET_A3, BATTLEANIMFUNC_44, PAL_BATTLE_OB_YELLOW, $24
-
-; ANIM_OBJ_9D
-	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_A4, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $24
-
-; ANIM_OBJ_9E
-	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_A5, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $24
-
-; ANIM_OBJ_9F
-	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_43, BATTLEANIMFUNC_45, PAL_BATTLE_OB_RED, $12
-
-; ANIM_OBJ_A0
-	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_A6, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $02
-
-; ANIM_OBJ_A1
-	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_A7, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $02
-
-; ANIM_OBJ_A2
-	battleanimobj RELATIVE_X | X_FLIP, $00, BATTLEANIMFRAMESET_B4, BATTLEANIMFUNC_4A, PAL_BATTLE_OB_BROWN, $0f
-
-; ANIM_OBJ_A3
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_A8, BATTLEANIMFUNC_02, PAL_BATTLE_OB_YELLOW, $05
-
-; ANIM_OBJ_A4
-	battleanimobj RELATIVE_X | X_FLIP, $40, BATTLEANIMFRAMESET_9C, BATTLEANIMFUNC_11, PAL_BATTLE_OB_GRAY, $25
-
-; ANIM_OBJ_A5
-	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $90, BATTLEANIMFRAMESET_A9, BATTLEANIMFUNC_46, PAL_BATTLE_OB_GRAY, $23
-
-; ANIM_OBJ_PERISH_SONG
-	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_47, PAL_BATTLE_OB_GRAY, $0e
-
-; ANIM_OBJ_A7
-	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_AA, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $24
-
-; ANIM_OBJ_A8
-	battleanimobj RELATIVE_X | X_FLIP, $b8, BATTLEANIMFRAMESET_AB, BATTLEANIMFUNC_48, PAL_BATTLE_OB_GRAY, $13
-
-; ANIM_OBJ_A9
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_AC, BATTLEANIMFUNC_44, PAL_BATTLE_OB_GRAY, $13
-
-; ANIM_OBJ_AA
-	battleanimobj RELATIVE_X, $a8, BATTLEANIMFRAMESET_05, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01
-
-; ANIM_OBJ_AB
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_43, PAL_BATTLE_OB_GRAY, $0e
-
-; ANIM_OBJ_AC
-	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_AD, BATTLEANIMFUNC_00, PAL_BATTLE_OB_BLUE, $17
-
-; ANIM_OBJ_AD
-	battleanimobj RELATIVE_X, $a8, BATTLEANIMFRAMESET_AE, BATTLEANIMFUNC_49, PAL_BATTLE_OB_GRAY, $01
-
-; ANIM_OBJ_AE
-	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_AF, BATTLEANIMFUNC_01, PAL_BATTLE_OB_YELLOW, $11
-
-; ANIM_OBJ_AF
-	battleanimobj RELATIVE_X | X_FLIP, $00, BATTLEANIMFRAMESET_B0, BATTLEANIMFUNC_4A, PAL_BATTLE_OB_GRAY, $04
-
-; ANIM_OBJ_B0
-	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_70, BATTLEANIMFUNC_4B, PAL_BATTLE_OB_RED, $1c
-
-; ANIM_OBJ_B1
-	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_B1, BATTLEANIMFUNC_4C, PAL_BATTLE_OB_GRAY, $19
-
-; ANIM_OBJ_B2
-	battleanimobj RELATIVE_X, $b8, BATTLEANIMFRAMESET_19, BATTLEANIMFUNC_4D, PAL_BATTLE_OB_BROWN, $09
-
-; ANIM_OBJ_B3
-	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $98, BATTLEANIMFRAMESET_B3, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $27
-
-; ANIM_OBJ_B4
-	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $98, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_04, PAL_BATTLE_OB_BLUE, $15
-
-; ANIM_OBJ_B5
-	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_19, BATTLEANIMFUNC_4E, PAL_BATTLE_OB_BROWN, $09
-
-; ANIM_OBJ_FLOWER
-	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_73, BATTLEANIMFUNC_08, PAL_BATTLE_OB_RED, $1e
-
-; ANIM_OBJ_COTTON
-	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_89, BATTLEANIMFUNC_4F, PAL_BATTLE_OB_RED, $1f
-
-; ANIM_OBJ_PLAYERFEETFOLLOW
-	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_B5, BATTLEANIMFUNC_00, PAL_BATTLE_OB_ENEMY, $28
-
-; ANIM_OBJ_ENEMYFEETFOLLOW
-	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_B6, BATTLEANIMFUNC_00, PAL_BATTLE_OB_PLAYER, $29
-
-; ANIM_OBJ_BA
-	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_B7, BATTLEANIMFUNC_00, PAL_BATTLE_OB_ENEMY, $28
-
-; ANIM_OBJ_BB
-	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_B8, BATTLEANIMFUNC_00, PAL_BATTLE_OB_PLAYER, $29
-
+BattleAnimObjects: ; ccb56
+; entries correspond to ANIM_OBJ_* constants
+	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_00, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01 ; ANIM_OBJ_00
+	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_01, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01 ; ANIM_OBJ_01
+	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_02, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01 ; ANIM_OBJ_02
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_00, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01 ; ANIM_OBJ_03
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_01, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01 ; ANIM_OBJ_04
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_02, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01 ; ANIM_OBJ_05
+	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_03, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01 ; ANIM_OBJ_06
+	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_04, BATTLEANIMFUNC_1B, PAL_BATTLE_OB_GRAY, $01 ; ANIM_OBJ_07
+	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_05, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01 ; ANIM_OBJ_08
+	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_06, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01 ; ANIM_OBJ_09
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_07, BATTLEANIMFUNC_09, PAL_BATTLE_OB_GRAY, $01 ; ANIM_OBJ_0A
+	battleanimobj RELATIVE_X, $aa, BATTLEANIMFRAMESET_10, BATTLEANIMFUNC_10, PAL_BATTLE_OB_RED, $03 ; ANIM_OBJ_0B
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_0E, BATTLEANIMFUNC_04, PAL_BATTLE_OB_RED, $03 ; ANIM_OBJ_0C
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_0F, BATTLEANIMFUNC_03, PAL_BATTLE_OB_RED, $03 ; ANIM_OBJ_0D
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_10, BATTLEANIMFUNC_08, PAL_BATTLE_OB_RED, $03 ; ANIM_OBJ_0E
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_0F, BATTLEANIMFUNC_0A, PAL_BATTLE_OB_RED, $03 ; ANIM_OBJ_0F
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_11, BATTLEANIMFUNC_03, PAL_BATTLE_OB_RED, $03 ; ANIM_OBJ_BURNED
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_12, BATTLEANIMFUNC_08, PAL_BATTLE_OB_BLUE, $0a ; ANIM_OBJ_BLIZZARD
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_13, BATTLEANIMFUNC_00, PAL_BATTLE_OB_BLUE, $0a ; ANIM_OBJ_12
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_14, BATTLEANIMFUNC_01, PAL_BATTLE_OB_BLUE, $0a ; ANIM_OBJ_ICE_BEAM
+	battleanimobj RELATIVE_X | X_FLIP, $78, BATTLEANIMFRAMESET_16, BATTLEANIMFUNC_RAZOR_LEAF, PAL_BATTLE_OB_GREEN, $06 ; ANIM_OBJ_RAZOR_LEAF
+	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_09, BATTLEANIMFUNC_12, PAL_BATTLE_OB_RED, $0b ; ANIM_OBJ_POKE_BALL
+	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_09, BATTLEANIMFUNC_13, PAL_BATTLE_OB_RED, $0b ; ANIM_OBJ_POKE_BALL_BLOCKED
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_18, BATTLEANIMFUNC_00, PAL_BATTLE_OB_RED, $08 ; ANIM_OBJ_17
+	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_18, BATTLEANIMFUNC_00, PAL_BATTLE_OB_RED, $08 ; ANIM_OBJ_18
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_1D, BATTLEANIMFUNC_06, PAL_BATTLE_OB_GRAY, $0c ; ANIM_OBJ_19
+	battleanimobj RELATIVE_X, $b4, BATTLEANIMFRAMESET_1F, BATTLEANIMFUNC_38, PAL_BATTLE_OB_GRAY, $0c ; ANIM_OBJ_1A
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_08, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $07 ; ANIM_OBJ_1B
+	battleanimobj RELATIVE_X, $a0, BATTLEANIMFRAMESET_08, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $07 ; ANIM_OBJ_BALL_POOF
+	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_19, BATTLEANIMFUNC_07, PAL_BATTLE_OB_BROWN, $09 ; ANIM_OBJ_1D
+	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_1A, BATTLEANIMFUNC_07, PAL_BATTLE_OB_BROWN, $09 ; ANIM_OBJ_1E
+	battleanimobj RELATIVE_X, $b0, BATTLEANIMFRAMESET_1B, BATTLEANIMFUNC_36, PAL_BATTLE_OB_BROWN, $09 ; ANIM_OBJ_1F
+	battleanimobj RELATIVE_X, $b0, BATTLEANIMFRAMESET_84, BATTLEANIMFUNC_36, PAL_BATTLE_OB_BLUE, $21 ; ANIM_OBJ_20
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_21, BATTLEANIMFUNC_0C, PAL_BATTLE_OB_BLUE, $0d ; ANIM_OBJ_BUBBLE
+	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_23, BATTLEANIMFUNC_0D, PAL_BATTLE_OB_BLUE, $0d ; ANIM_OBJ_22
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_0E, PAL_BATTLE_OB_GRAY, $0e ; ANIM_OBJ_23
+	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $80, BATTLEANIMFRAMESET_27, BATTLEANIMFUNC_0F, PAL_BATTLE_OB_BLUE, $04 ; ANIM_OBJ_24
+	battleanimobj RELATIVE_X, $b4, BATTLEANIMFRAMESET_2A, BATTLEANIMFUNC_00, PAL_BATTLE_OB_BLUE, $04 ; ANIM_OBJ_25
+	battleanimobj RELATIVE_X, $40, BATTLEANIMFRAMESET_2B, BATTLEANIMFUNC_11, PAL_BATTLE_OB_GREEN, $0f ; ANIM_OBJ_26
+	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $98, BATTLEANIMFRAMESET_2C, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $10 ; ANIM_OBJ_27
+	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $98, BATTLEANIMFRAMESET_2D, BATTLEANIMFUNC_09, PAL_BATTLE_OB_YELLOW, $10 ; ANIM_OBJ_28
+	battleanimobj RELATIVE_X, $b8, BATTLEANIMFRAMESET_2E, BATTLEANIMFUNC_00, PAL_BATTLE_OB_BLUE, $0a ; ANIM_OBJ_ICE_BUILDUP
+	battleanimobj RELATIVE_X, $b8, BATTLEANIMFRAMESET_2F, BATTLEANIMFUNC_00, PAL_BATTLE_OB_BLUE, $0a ; ANIM_OBJ_FROZEN
+	battleanimobj RELATIVE_X, $b8, BATTLEANIMFRAMESET_30, BATTLEANIMFUNC_14, PAL_BATTLE_OB_BROWN, $11 ; ANIM_OBJ_MASTER_BALL_SPARKLE
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_21, BATTLEANIMFUNC_14, PAL_BATTLE_OB_YELLOW, $0d ; ANIM_OBJ_2C
+	battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLEANIMFRAMESET_31, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $05 ; ANIM_OBJ_2D
+	battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLEANIMFRAMESET_32, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $05 ; ANIM_OBJ_2E
+	battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLEANIMFRAMESET_33, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $05 ; ANIM_OBJ_2F
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_34, BATTLEANIMFUNC_15, PAL_BATTLE_OB_YELLOW, $05 ; ANIM_OBJ_30
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_36, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $05 ; ANIM_OBJ_31
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_37, BATTLEANIMFUNC_03, PAL_BATTLE_OB_GRAY, $08 ; ANIM_OBJ_LIGHTNING_BOLT
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_38, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $05 ; ANIM_OBJ_33
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_39, BATTLEANIMFUNC_03, PAL_BATTLE_OB_GRAY, $08 ; ANIM_OBJ_34
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_3A, BATTLEANIMFUNC_16, PAL_BATTLE_OB_GRAY, $02 ; ANIM_OBJ_35
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_3C, BATTLEANIMFUNC_17, PAL_BATTLE_OB_GRAY, $02 ; ANIM_OBJ_36
+	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_3E, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $02 ; ANIM_OBJ_37
+	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_3F, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $02 ; ANIM_OBJ_38
+	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_40, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $02 ; ANIM_OBJ_39
+	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_41, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $02 ; ANIM_OBJ_3A
+	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_42, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $02 ; ANIM_OBJ_3B
+	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_43, BATTLEANIMFUNC_18, PAL_BATTLE_OB_GREEN, $12 ; ANIM_OBJ_3C
+	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_44, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GREEN, $12 ; ANIM_OBJ_3D
+	battleanimobj RELATIVE_X | X_FLIP, $b8, BATTLEANIMFRAMESET_45, BATTLEANIMFUNC_19, PAL_BATTLE_OB_GRAY, $13 ; ANIM_OBJ_GUST
+	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_46, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $14 ; ANIM_OBJ_3F
+	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_47, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $14 ; ANIM_OBJ_40
+	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_48, BATTLEANIMFUNC_1A, PAL_BATTLE_OB_GRAY, $14 ; ANIM_OBJ_41
+	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_49, BATTLEANIMFUNC_1A, PAL_BATTLE_OB_GRAY, $14 ; ANIM_OBJ_42
+	battleanimobj RELATIVE_X | X_FLIP, $98, BATTLEANIMFRAMESET_4A, BATTLEANIMFUNC_01, PAL_BATTLE_OB_GRAY, $14 ; ANIM_OBJ_43
+	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_4B, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $11 ; ANIM_OBJ_44
+	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_4C, BATTLEANIMFUNC_1C, PAL_BATTLE_OB_GREEN, $12 ; ANIM_OBJ_ABSORB
+	battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLEANIMFRAMESET_4D, BATTLEANIMFUNC_1D, PAL_BATTLE_OB_GRAY, $15 ; ANIM_OBJ_46
+	battleanimobj RELATIVE_X, $b0, BATTLEANIMFRAMESET_51, BATTLEANIMFUNC_1E, PAL_BATTLE_OB_YELLOW, $11 ; ANIM_OBJ_47
+	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_52, BATTLEANIMFUNC_1F, PAL_BATTLE_OB_GREEN, $16 ; ANIM_OBJ_48
+	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_54, BATTLEANIMFUNC_1F, PAL_BATTLE_OB_GREEN, $16 ; ANIM_OBJ_49
+	battleanimobj RELATIVE_X | X_FLIP, $68, BATTLEANIMFRAMESET_56, BATTLEANIMFUNC_LEECH_SEED, PAL_BATTLE_OB_GREEN, $06 ; ANIM_OBJ_LEECH_SEED
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_59, BATTLEANIMFUNC_21, PAL_BATTLE_OB_GRAY, $0e ; ANIM_OBJ_4B
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_5C, BATTLEANIMFUNC_02, PAL_BATTLE_OB_GRAY, $17 ; ANIM_OBJ_4C
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_5D, BATTLEANIMFUNC_22, PAL_BATTLE_OB_YELLOW, $11 ; ANIM_OBJ_4D
+	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $88, BATTLEANIMFRAMESET_5F, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $10 ; ANIM_OBJ_4E
+	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $88, BATTLEANIMFRAMESET_2D, BATTLEANIMFUNC_09, PAL_BATTLE_OB_YELLOW, $10 ; ANIM_OBJ_4F
+	battleanimobj RELATIVE_X | X_FLIP, $88, BATTLEANIMFRAMESET_60, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $18 ; ANIM_OBJ_50
+	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_60, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $18 ; ANIM_OBJ_51
+	battleanimobj RELATIVE_X | X_FLIP, $50, BATTLEANIMFRAMESET_61, BATTLEANIMFUNC_23, PAL_BATTLE_OB_YELLOW, $19 ; ANIM_OBJ_CHICK
+	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_63, BATTLEANIMFUNC_24, PAL_BATTLE_OB_GRAY, $19 ; ANIM_OBJ_53
+	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_66, BATTLEANIMFUNC_25, PAL_BATTLE_OB_GRAY, $19 ; ANIM_OBJ_54
+	battleanimobj RELATIVE_X, $50, BATTLEANIMFRAMESET_1C, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $0c ; ANIM_OBJ_SKULL
+	battleanimobj RELATIVE_X | X_FLIP, $a8, BATTLEANIMFRAMESET_67, BATTLEANIMFUNC_26, PAL_BATTLE_OB_BROWN, $1a ; ANIM_OBJ_56
+	battleanimobj RELATIVE_X | X_FLIP, $a8, BATTLEANIMFRAMESET_68, BATTLEANIMFUNC_00, PAL_BATTLE_OB_BROWN, $1a ; ANIM_OBJ_57
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_69, BATTLEANIMFUNC_01, PAL_BATTLE_OB_GRAY, $1a ; ANIM_OBJ_58
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_6D, BATTLEANIMFUNC_28, PAL_BATTLE_OB_YELLOW, $19 ; ANIM_OBJ_PARALYZED
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_6A, BATTLEANIMFUNC_27, PAL_BATTLE_OB_GRAY, $1b ; ANIM_OBJ_5A
+	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_6F, BATTLEANIMFUNC_SPRIAL_DESCENT, PAL_BATTLE_OB_GRAY, $1c ; ANIM_OBJ_HAZE
+	battleanimobj RELATIVE_X | X_FLIP, $48, BATTLEANIMFRAMESET_70, BATTLEANIMFUNC_SPRIAL_DESCENT, PAL_BATTLE_OB_GRAY, $1c ; ANIM_OBJ_MIST
+	battleanimobj RELATIVE_X | X_FLIP, $48, BATTLEANIMFRAMESET_6F, BATTLEANIMFUNC_SPRIAL_DESCENT, PAL_BATTLE_OB_GRAY, $1c ; ANIM_OBJ_SMOG
+	battleanimobj RELATIVE_X | X_FLIP, $78, BATTLEANIMFRAMESET_6F, BATTLEANIMFUNC_POISON_GAS, PAL_BATTLE_OB_GRAY, $1c ; ANIM_OBJ_POISON_GAS
+	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $90, BATTLEANIMFRAMESET_71, BATTLEANIMFUNC_HORN, PAL_BATTLE_OB_GRAY, $1d ; ANIM_OBJ_HORN
+	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $90, BATTLEANIMFRAMESET_72, BATTLEANIMFUNC_2C, PAL_BATTLE_OB_GRAY, $1d ; ANIM_OBJ_60
+	battleanimobj RELATIVE_X, $48, BATTLEANIMFRAMESET_73, BATTLEANIMFUNC_2D, PAL_BATTLE_OB_RED, $1e ; ANIM_OBJ_61
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_06, PAL_BATTLE_OB_GRAY, $15 ; ANIM_OBJ_62
+	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_75, BATTLEANIMFUNC_2E, PAL_BATTLE_OB_BROWN, $19 ; ANIM_OBJ_63
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_4A, BATTLEANIMFUNC_02, PAL_BATTLE_OB_GRAY, $14 ; ANIM_OBJ_64
+	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_30, BATTLEANIMFUNC_2F, PAL_BATTLE_OB_GRAY, $11 ; ANIM_OBJ_65
+	battleanimobj RELATIVE_X, $78, BATTLEANIMFRAMESET_76, BATTLEANIMFUNC_POISON_GAS, PAL_BATTLE_OB_RED, $23 ; ANIM_OBJ_66
+	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_77, BATTLEANIMFUNC_30, PAL_BATTLE_OB_GRAY, $1f ; ANIM_OBJ_67
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_77, BATTLEANIMFUNC_02, PAL_BATTLE_OB_GRAY, $1f ; ANIM_OBJ_68
+	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_77, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $1f ; ANIM_OBJ_69
+	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_78, BATTLEANIMFUNC_08, PAL_BATTLE_OB_YELLOW, $23 ; ANIM_OBJ_6A
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_79, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $1f ; ANIM_OBJ_6B
+	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_7A, BATTLEANIMFUNC_31, PAL_BATTLE_OB_YELLOW, $11 ; ANIM_OBJ_6C
+	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_7A, BATTLEANIMFUNC_31, PAL_BATTLE_OB_YELLOW, $11 ; ANIM_OBJ_6D
+	battleanimobj RELATIVE_X | X_FLIP, $88, BATTLEANIMFRAMESET_7B, BATTLEANIMFUNC_32, PAL_BATTLE_OB_GRAY, $20 ; ANIM_OBJ_SKY_ATTACK_FEAROW
+	battleanimobj RELATIVE_X | X_FLIP, $98, BATTLEANIMFRAMESET_7C, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $04 ; ANIM_OBJ_LICK
+	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_7D, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $18 ; ANIM_OBJ_WITHDRAW
+	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_21, BATTLEANIMFUNC_2F, PAL_BATTLE_OB_BLUE, $0d ; ANIM_OBJ_71
+	battleanimobj RELATIVE_X, $b0, BATTLEANIMFRAMESET_7E, BATTLEANIMFUNC_33, PAL_BATTLE_OB_YELLOW, $12 ; ANIM_OBJ_72
+	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_7F, BATTLEANIMFUNC_2F, PAL_BATTLE_OB_GRAY, $08 ; ANIM_OBJ_73
+	battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLEANIMFRAMESET_6F, BATTLEANIMFUNC_34, PAL_BATTLE_OB_GRAY, $1c ; ANIM_OBJ_74
+	battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_35, PAL_BATTLE_OB_GRAY, $15 ; ANIM_OBJ_75
+	battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLEANIMFRAMESET_80, BATTLEANIMFUNC_33, PAL_BATTLE_OB_GRAY, $14 ; ANIM_OBJ_76
+	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_81, BATTLEANIMFUNC_37, PAL_BATTLE_OB_GRAY, $11 ; ANIM_OBJ_77
+	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_85, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $22 ; ANIM_OBJ_78
+	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_86, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $22 ; ANIM_OBJ_79
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_87, BATTLEANIMFUNC_39, PAL_BATTLE_OB_GRAY, $1f ; ANIM_OBJ_7A
+	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_30, BATTLEANIMFUNC_3A, PAL_BATTLE_OB_YELLOW, $11 ; ANIM_OBJ_7B
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_34, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $05 ; ANIM_OBJ_7C
+	battleanimobj RELATIVE_X | X_FLIP | BEHIND_BG, $88, BATTLEANIMFRAMESET_88, BATTLEANIMFUNC_3B, PAL_BATTLE_OB_BLUE, $13 ; ANIM_OBJ_7D
+	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_76, BATTLEANIMFUNC_25, PAL_BATTLE_OB_RED, $23 ; ANIM_OBJ_HEART
+	battleanimobj RELATIVE_X, $98, BATTLEANIMFRAMESET_10, BATTLEANIMFUNC_34, PAL_BATTLE_OB_RED, $03 ; ANIM_OBJ_7F
+	battleanimobj RELATIVE_X, $a8, BATTLEANIMFRAMESET_0F, BATTLEANIMFUNC_3C, PAL_BATTLE_OB_RED, $03 ; ANIM_OBJ_80
+	battleanimobj RELATIVE_X | X_FLIP, $68, BATTLEANIMFRAMESET_89, BATTLEANIMFUNC_SPRIAL_DESCENT, PAL_BATTLE_OB_GRAY, $1f ; ANIM_OBJ_COTTON_SPORE
+	battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLEANIMFRAMESET_8A, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $1f ; ANIM_OBJ_82
+	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_8C, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $1f ; ANIM_OBJ_83
+	battleanimobj RELATIVE_X | X_FLIP, $50, BATTLEANIMFRAMESET_8D, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $1f ; ANIM_OBJ_84
+	battleanimobj RELATIVE_X, $40, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_40, PAL_BATTLE_OB_GRAY, $0e ; ANIM_OBJ_85
+	battleanimobj RELATIVE_X | X_FLIP, $a8, BATTLEANIMFRAMESET_8E, BATTLEANIMFUNC_41, PAL_BATTLE_OB_RED, $1f ; ANIM_OBJ_86
+	battleanimobj RELATIVE_X | X_FLIP, $88, BATTLEANIMFRAMESET_8F, BATTLEANIMFUNC_3E, PAL_BATTLE_OB_GRAY, $1f ; ANIM_OBJ_87
+	battleanimobj RELATIVE_X | X_FLIP, $88, BATTLEANIMFRAMESET_93, BATTLEANIMFUNC_3E, PAL_BATTLE_OB_GRAY, $1f ; ANIM_OBJ_88
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_97, BATTLEANIMFUNC_3D, PAL_BATTLE_OB_GRAY, $1f ; ANIM_OBJ_89
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_78, BATTLEANIMFUNC_3D, PAL_BATTLE_OB_YELLOW, $23 ; ANIM_OBJ_8A
+	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_99, BATTLEANIMFUNC_2E, PAL_BATTLE_OB_GRAY, $19 ; ANIM_OBJ_8B
+	battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_02, PAL_BATTLE_OB_GRAY, $15 ; ANIM_OBJ_8C
+	battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLEANIMFRAMESET_99, BATTLEANIMFUNC_35, PAL_BATTLE_OB_RED, $19 ; ANIM_OBJ_8D
+	battleanimobj RELATIVE_X | X_FLIP, $70, BATTLEANIMFRAMESET_8B, BATTLEANIMFUNC_3F, PAL_BATTLE_OB_GRAY, $1f ; ANIM_OBJ_SPIKES
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_15, BATTLEANIMFUNC_08, PAL_BATTLE_OB_GRAY, $0a ; ANIM_OBJ_8F
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_11, BATTLEANIMFUNC_02, PAL_BATTLE_OB_RED, $03 ; ANIM_OBJ_90
+	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_7F, BATTLEANIMFUNC_42, PAL_BATTLE_OB_GRAY, $08 ; ANIM_OBJ_91
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_9A, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $1b ; ANIM_OBJ_92
+	battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLEANIMFRAMESET_9B, BATTLEANIMFUNC_35, PAL_BATTLE_OB_RED, $23 ; ANIM_OBJ_93
+	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_9C, BATTLEANIMFUNC_23, PAL_BATTLE_OB_GRAY, $25 ; ANIM_OBJ_94
+	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_9D, BATTLEANIMFUNC_25, PAL_BATTLE_OB_GRAY, $25 ; ANIM_OBJ_95
+	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_9C, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $25 ; ANIM_OBJ_96
+	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_9E, BATTLEANIMFUNC_00, PAL_BATTLE_OB_BLUE, $25 ; ANIM_OBJ_97
+	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $80, BATTLEANIMFRAMESET_9F, BATTLEANIMFUNC_3A, PAL_BATTLE_OB_GREEN, $23 ; ANIM_OBJ_98
+	battleanimobj RELATIVE_X | X_FLIP, $80, BATTLEANIMFRAMESET_A0, BATTLEANIMFUNC_16, PAL_BATTLE_OB_GRAY, $23 ; ANIM_OBJ_99
+	battleanimobj RELATIVE_X | X_FLIP, $70, BATTLEANIMFRAMESET_78, BATTLEANIMFUNC_43, PAL_BATTLE_OB_YELLOW, $23 ; ANIM_OBJ_9A
+	battleanimobj RELATIVE_X | X_FLIP, $c0, BATTLEANIMFRAMESET_A2, BATTLEANIMFUNC_01, PAL_BATTLE_OB_GRAY, $25 ; ANIM_OBJ_9B
+	battleanimobj RELATIVE_X | X_FLIP, $40, BATTLEANIMFRAMESET_A3, BATTLEANIMFUNC_44, PAL_BATTLE_OB_YELLOW, $24 ; ANIM_OBJ_9C
+	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_A4, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $24 ; ANIM_OBJ_9D
+	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_A5, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $24 ; ANIM_OBJ_9E
+	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_43, BATTLEANIMFUNC_45, PAL_BATTLE_OB_RED, $12 ; ANIM_OBJ_9F
+	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_A6, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $02 ; ANIM_OBJ_A0
+	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_A7, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $02 ; ANIM_OBJ_A1
+	battleanimobj RELATIVE_X | X_FLIP, $00, BATTLEANIMFRAMESET_B4, BATTLEANIMFUNC_4A, PAL_BATTLE_OB_BROWN, $0f ; ANIM_OBJ_A2
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_A8, BATTLEANIMFUNC_02, PAL_BATTLE_OB_YELLOW, $05 ; ANIM_OBJ_A3
+	battleanimobj RELATIVE_X | X_FLIP, $40, BATTLEANIMFRAMESET_9C, BATTLEANIMFUNC_11, PAL_BATTLE_OB_GRAY, $25 ; ANIM_OBJ_A4
+	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $90, BATTLEANIMFRAMESET_A9, BATTLEANIMFUNC_46, PAL_BATTLE_OB_GRAY, $23 ; ANIM_OBJ_A5
+	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_47, PAL_BATTLE_OB_GRAY, $0e ; ANIM_OBJ_PERISH_SONG
+	battleanimobj RELATIVE_X, $80, BATTLEANIMFRAMESET_AA, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $24 ; ANIM_OBJ_A7
+	battleanimobj RELATIVE_X | X_FLIP, $b8, BATTLEANIMFRAMESET_AB, BATTLEANIMFUNC_48, PAL_BATTLE_OB_GRAY, $13 ; ANIM_OBJ_A8
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_AC, BATTLEANIMFUNC_44, PAL_BATTLE_OB_GRAY, $13 ; ANIM_OBJ_A9
+	battleanimobj RELATIVE_X, $a8, BATTLEANIMFRAMESET_05, BATTLEANIMFUNC_00, PAL_BATTLE_OB_GRAY, $01 ; ANIM_OBJ_AA
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_43, PAL_BATTLE_OB_GRAY, $0e ; ANIM_OBJ_AB
+	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_AD, BATTLEANIMFUNC_00, PAL_BATTLE_OB_BLUE, $17 ; ANIM_OBJ_AC
+	battleanimobj RELATIVE_X, $a8, BATTLEANIMFRAMESET_AE, BATTLEANIMFUNC_49, PAL_BATTLE_OB_GRAY, $01 ; ANIM_OBJ_AD
+	battleanimobj RELATIVE_X | X_FLIP, $90, BATTLEANIMFRAMESET_AF, BATTLEANIMFUNC_01, PAL_BATTLE_OB_YELLOW, $11 ; ANIM_OBJ_AE
+	battleanimobj RELATIVE_X | X_FLIP, $00, BATTLEANIMFRAMESET_B0, BATTLEANIMFUNC_4A, PAL_BATTLE_OB_GRAY, $04 ; ANIM_OBJ_AF
+	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_70, BATTLEANIMFUNC_4B, PAL_BATTLE_OB_RED, $1c ; ANIM_OBJ_B0
+	battleanimobj RELATIVE_X, $88, BATTLEANIMFRAMESET_B1, BATTLEANIMFUNC_4C, PAL_BATTLE_OB_GRAY, $19 ; ANIM_OBJ_B1
+	battleanimobj RELATIVE_X, $b8, BATTLEANIMFRAMESET_19, BATTLEANIMFUNC_4D, PAL_BATTLE_OB_BROWN, $09 ; ANIM_OBJ_B2
+	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $98, BATTLEANIMFRAMESET_B3, BATTLEANIMFUNC_00, PAL_BATTLE_OB_YELLOW, $27 ; ANIM_OBJ_B3
+	battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $98, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_04, PAL_BATTLE_OB_BLUE, $15 ; ANIM_OBJ_B4
+	battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLEANIMFRAMESET_19, BATTLEANIMFUNC_4E, PAL_BATTLE_OB_BROWN, $09 ; ANIM_OBJ_B5
+	battleanimobj RELATIVE_X, $90, BATTLEANIMFRAMESET_73, BATTLEANIMFUNC_08, PAL_BATTLE_OB_RED, $1e ; ANIM_OBJ_FLOWER
+	battleanimobj RELATIVE_X, $ff, BATTLEANIMFRAMESET_89, BATTLEANIMFUNC_4F, PAL_BATTLE_OB_RED, $1f ; ANIM_OBJ_COTTON
+	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_B5, BATTLEANIMFUNC_00, PAL_BATTLE_OB_ENEMY, $28 ; ANIM_OBJ_PLAYERFEETFOLLOW
+	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_B6, BATTLEANIMFUNC_00, PAL_BATTLE_OB_PLAYER, $29 ; ANIM_OBJ_ENEMYFEETFOLLOW
+	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_B7, BATTLEANIMFUNC_00, PAL_BATTLE_OB_ENEMY, $28 ; ANIM_OBJ_BA
+	battleanimobj ABSOLUTE_X, $00, BATTLEANIMFRAMESET_B8, BATTLEANIMFUNC_00, PAL_BATTLE_OB_PLAYER, $29 ; ANIM_OBJ_BB
 ; ccfbe
--- a/battle/objects/gfx_headers.asm
+++ b/battle/objects/gfx_headers.asm
@@ -1,6 +1,3 @@
-
-AnimObjGFX: ; cfcf6
-
 object_gfx: MACRO
 ; # tiles, label
 	db  \1
@@ -7,6 +4,8 @@
 	dba \2
 ENDM
 
+AnimObjGFX: ; cfcf6
+; entries correspond to ANIM_GFX_* constants
 	object_gfx  0, AnimObj00GFX
 	object_gfx 21, AnimObjHitGFX
 	object_gfx  6, AnimObjCutGFX
--- a/constants/effect_command_constants.asm
+++ b/constants/effect_command_constants.asm
@@ -1,10 +1,9 @@
-; BattleCommandPointers indexes (see battle/effect_commands.asm)
-
 command: macro
 	enum \1_command
 \1 equs "db \1_command"
 endm
 
+; BattleCommandPointers indexes (see battle/effect_commands.asm)
 	enum_start 1
 	command checkturn               ; 01
 	command checkobedience          ; 02
--- a/constants/map_dimension_constants.asm
+++ b/constants/map_dimension_constants.asm
@@ -1,3 +1,18 @@
+newgroup: macro
+const_value = const_value + 1
+	enum_start 1
+endm
+
+mapgroup: macro
+;\1: map id
+;\2: height: in blocks
+;\3: width: in blocks
+GROUP_\1 EQU const_value
+	enum MAP_\1
+\1_HEIGHT EQU \2
+\1_WIDTH EQU \3
+endm
+
 ; map group ids
 ; `newgroup` indexes are for:
 ; - MapGroupPointers (see maps/map_headers.asm)
--- a/constants/trainer_constants.asm
+++ b/constants/trainer_constants.asm
@@ -1,3 +1,8 @@
+trainerclass: MACRO
+	enum \1
+const_value = 1
+ENDM
+
 ; trainer class ids
 ; `trainerclass` indexes are for:
 ; - TrainerClassAttributes (see trainers/attributes.asm)
--- a/data/hm_moves.asm
+++ /dev/null
@@ -1,12 +1,0 @@
-;  HM moves can't be forgotten
-
-HMMoves: ; 34f0
-	db CUT
-	db FLY
-	db SURF
-	db STRENGTH
-	db FLASH
-	db WATERFALL
-	db WHIRLPOOL
-	db -1 ; end
-; 34f8
--- /dev/null
+++ b/data/unown_words.asm
@@ -1,0 +1,67 @@
+unownword: macro
+x = 1
+	rept STRLEN(\1)
+	db STRSUB(\1, x, 1) - $40
+x = x + 1
+	endr
+	db -1
+endm
+
+UnownWords: ; fba5a
+; entries correspond to Unown forms
+	dw UnownWord1
+	dw UnownWord1
+	dw UnownWord2
+	dw UnownWord3
+	dw UnownWord4
+	dw UnownWord5
+	dw UnownWord6
+	dw UnownWord7
+	dw UnownWord8
+	dw UnownWord9
+	dw UnownWord10
+	dw UnownWord11
+	dw UnownWord12
+	dw UnownWord13
+	dw UnownWord14
+	dw UnownWord15
+	dw UnownWord16
+	dw UnownWord17
+	dw UnownWord18
+	dw UnownWord19
+	dw UnownWord20
+	dw UnownWord21
+	dw UnownWord22
+	dw UnownWord23
+	dw UnownWord24
+	dw UnownWord25
+	dw UnownWord26
+; fba90
+
+UnownWord1:	 unownword "ANGRY"
+UnownWord2:	 unownword "BEAR"
+UnownWord3:	 unownword "CHASE"
+UnownWord4:	 unownword "DIRECT"
+UnownWord5:	 unownword "ENGAGE"
+UnownWord6:	 unownword "FIND"
+UnownWord7:	 unownword "GIVE"
+UnownWord8:	 unownword "HELP"
+UnownWord9:	 unownword "INCREASE"
+UnownWord10: unownword "JOIN"
+UnownWord11: unownword "KEEP"
+UnownWord12: unownword "LAUGH"
+UnownWord13: unownword "MAKE"
+UnownWord14: unownword "NUZZLE"
+UnownWord15: unownword "OBSERVE"
+UnownWord16: unownword "PERFORM"
+UnownWord17: unownword "QUICKEN"
+UnownWord18: unownword "REASSURE"
+UnownWord19: unownword "SEARCH"
+UnownWord20: unownword "TELL"
+UnownWord21: unownword "UNDO"
+UnownWord22: unownword "VANISH"
+UnownWord23: unownword "WANT"
+UnownWord24: unownword "XXXXX"
+UnownWord25: unownword "YIELD"
+UnownWord26: unownword "ZOOM"
+; fbb32
--- a/engine/battle_start.asm
+++ b/engine/battle_start.asm
@@ -363,19 +363,6 @@
 	ld [wcf64], a
 	ret
 
-spintable_entry: MACRO
-	db \1
-	dw .wedge\2
-	dwcoord \3, \4
-ENDM
-
-; quadrants
-	const_def
-	const UPPER_LEFT
-	const UPPER_RIGHT
-	const LOWER_LEFT
-	const LOWER_RIGHT
-
 StartTrainerBattle_SpinToBlack: ; 8c44f (23:444f)
 	xor a
 	ld [hBGMapMode], a
@@ -412,7 +399,19 @@
 	ret
 ; 8c490 (23:4490)
 
+; quadrants
+	const_def
+	const UPPER_LEFT
+	const UPPER_RIGHT
+	const LOWER_LEFT
+	const LOWER_RIGHT
+
 .spintable ; 8c490
+spintable_entry: MACRO
+	db \1
+	dw .wedge\2
+	dwcoord \3, \4
+ENDM
 	spintable_entry UPPER_LEFT,  1,  1,  6
 	spintable_entry UPPER_LEFT,  2,  0,  3
 	spintable_entry UPPER_LEFT,  3,  1,  0
@@ -797,12 +796,6 @@
 	sine_wave $100
 ; 8c768
 
-zoombox: macro
-; width, height, start y, start x
-	db \1, \2
-	dwcoord \3, \4
-endm
-
 StartTrainerBattle_ZoomToBlack: ; 8c768 (23:4768)
 	callba Function5602
 	ld de, .boxes
@@ -835,6 +828,11 @@
 ; 8c792 (23:4792)
 
 .boxes ; 8c792
+zoombox: macro
+; width, height, start y, start x
+	db \1, \2
+	dwcoord \3, \4
+endm
 	zoombox  4,  2,  8, 8
 	zoombox  6,  4,  7, 7
 	zoombox  8,  6,  6, 6
--- a/engine/card_flip.asm
+++ b/engine/card_flip.asm
@@ -1415,7 +1415,6 @@
 endc
 endm
 
-
 	cardflip_cursor 11,  2,       .Impossible
 	cardflip_cursor 12,  2,       .Impossible
 	cardflip_cursor 13,  2,       .PokeGroupPair
--- a/engine/pokegear.asm
+++ b/engine/pokegear.asm
@@ -2340,11 +2340,11 @@
 
 Flypoints: ; 91c5e
 ; landmark, spawn point
-	const_def
 flypoint: MACRO
 	const FLY_\1
 	db \2, SPAWN_\1
 ENDM
+	const_def
 ; Johto
 	flypoint NEW_BARK,    NEW_BARK_TOWN
 	flypoint CHERRYGROVE, CHERRYGROVE_CITY
--- a/engine/prof_oaks_pc.asm
+++ b/engine/prof_oaks_pc.asm
@@ -1,4 +1,3 @@
-
 ProfOaksPC: ; 0x265d3
 	ld hl, OakPCText1
 	call MenuTextBox
@@ -100,31 +99,26 @@
 	ret
 
 OakRatings: ; 0x2667f
-oakrating: MACRO
-	db \1
-	dw \2, \3
-endm
-
 ; if you caught at most this many, play this sound, load this text
-	oakrating   9, SFX_DEX_FANFARE_LESS_THAN_20, OakRating01
-	oakrating  19, SFX_DEX_FANFARE_LESS_THAN_20, OakRating02
-	oakrating  34, SFX_DEX_FANFARE_20_49,        OakRating03
-	oakrating  49, SFX_DEX_FANFARE_20_49,        OakRating04
-	oakrating  64, SFX_DEX_FANFARE_50_79,        OakRating05
-	oakrating  79, SFX_DEX_FANFARE_50_79,        OakRating06
-	oakrating  94, SFX_DEX_FANFARE_80_109,       OakRating07
-	oakrating 109, SFX_DEX_FANFARE_80_109,       OakRating08
-	oakrating 124, SFX_CAUGHT_MON,               OakRating09
-	oakrating 139, SFX_CAUGHT_MON,               OakRating10
-	oakrating 154, SFX_DEX_FANFARE_140_169,      OakRating11
-	oakrating 169, SFX_DEX_FANFARE_140_169,      OakRating12
-	oakrating 184, SFX_DEX_FANFARE_170_199,      OakRating13
-	oakrating 199, SFX_DEX_FANFARE_170_199,      OakRating14
-	oakrating 214, SFX_DEX_FANFARE_200_229,      OakRating15
-	oakrating 229, SFX_DEX_FANFARE_200_229,      OakRating16
-	oakrating 239, SFX_DEX_FANFARE_230_PLUS,     OakRating17
-	oakrating 248, SFX_DEX_FANFARE_230_PLUS,     OakRating18
-	oakrating 255, SFX_DEX_FANFARE_230_PLUS,     OakRating19
+	dbww   9, SFX_DEX_FANFARE_LESS_THAN_20, OakRating01
+	dbww  19, SFX_DEX_FANFARE_LESS_THAN_20, OakRating02
+	dbww  34, SFX_DEX_FANFARE_20_49,        OakRating03
+	dbww  49, SFX_DEX_FANFARE_20_49,        OakRating04
+	dbww  64, SFX_DEX_FANFARE_50_79,        OakRating05
+	dbww  79, SFX_DEX_FANFARE_50_79,        OakRating06
+	dbww  94, SFX_DEX_FANFARE_80_109,       OakRating07
+	dbww 109, SFX_DEX_FANFARE_80_109,       OakRating08
+	dbww 124, SFX_CAUGHT_MON,               OakRating09
+	dbww 139, SFX_CAUGHT_MON,               OakRating10
+	dbww 154, SFX_DEX_FANFARE_140_169,      OakRating11
+	dbww 169, SFX_DEX_FANFARE_140_169,      OakRating12
+	dbww 184, SFX_DEX_FANFARE_170_199,      OakRating13
+	dbww 199, SFX_DEX_FANFARE_170_199,      OakRating14
+	dbww 214, SFX_DEX_FANFARE_200_229,      OakRating15
+	dbww 229, SFX_DEX_FANFARE_200_229,      OakRating16
+	dbww 239, SFX_DEX_FANFARE_230_PLUS,     OakRating17
+	dbww 248, SFX_DEX_FANFARE_230_PLUS,     OakRating18
+	dbww 255, SFX_DEX_FANFARE_230_PLUS,     OakRating19
 
 OakPCText1: ; 0x266de
 	text_jump _OakPCText1
--- a/engine/radio.asm
+++ b/engine/radio.asm
@@ -1578,7 +1578,6 @@
 .greater_than_11
 	call Random
 	maskbits NUM_PASSWORD_CATEGORIES
-	and x
 	cp NUM_PASSWORD_CATEGORIES
 	jr nc, .greater_than_11
 ; Store it in the high nybble of e.
--- a/engine/timeofdaypals.asm
+++ b/engine/timeofdaypals.asm
@@ -196,10 +196,6 @@
 	ret
 ; 8c0e5
 
-brightlevel: MACRO
-	db (\1 << 6) | (\2 << 4) | (\3 << 2) | \4
-ENDM
-
 ReplaceTimeOfDayPals: ; 8c0e5
 	ld hl, .BrightnessLevels
 	ld a, [wMapTimeOfDay]
@@ -230,14 +226,14 @@
 ; 8c10f (23:410f)
 
 .BrightnessLevels: ; 8c10f
-	brightlevel 3, 2, 1, 0
-	brightlevel 1, 1, 1, 1
-	brightlevel 2, 2, 2, 2
-	brightlevel 0, 0, 0, 0
-	brightlevel 3, 3, 3, 3
-	brightlevel 3, 2, 1, 0
-	brightlevel 3, 2, 1, 0
-	brightlevel 3, 2, 1, 0
+	dc 3, 2, 1, 0
+	dc 1, 1, 1, 1
+	dc 2, 2, 2, 2
+	dc 0, 0, 0, 0
+	dc 3, 3, 3, 3
+	dc 3, 2, 1, 0
+	dc 3, 2, 1, 0
+	dc 3, 2, 1, 0
 ; 8c117
 
 GetTimePalette: ; 8c117
--- a/engine/unown_puzzle.asm
+++ b/engine/unown_puzzle.asm
@@ -1,6 +1,7 @@
-puzcoord EQUS "* 6 +"
 PUZZLE_BORDER EQU $ee
 PUZZLE_VOID   EQU $ef
+
+puzcoord EQUS "* 6 +"
 
 UnownPuzzle: ; e1190
 	ld a, [hInMenu]
--- a/engine/unowndex.asm
+++ b/engine/unowndex.asm
@@ -19,7 +19,6 @@
 	ret
 ; fba2e
 
-
 PrintUnownWord: ; fba2e (3e:7a2e)
 	hlcoord 4, 15
 	ld bc, 12
@@ -49,70 +48,4 @@
 	jr .loop
 ; fba5a (3e:7a5a)
 
-UnownWords: ; fba5a
-	dw UnownWord1
-	dw UnownWord1
-	dw UnownWord2
-	dw UnownWord3
-	dw UnownWord4
-	dw UnownWord5
-	dw UnownWord6
-	dw UnownWord7
-	dw UnownWord8
-	dw UnownWord9
-	dw UnownWord10
-	dw UnownWord11
-	dw UnownWord12
-	dw UnownWord13
-	dw UnownWord14
-	dw UnownWord15
-	dw UnownWord16
-	dw UnownWord17
-	dw UnownWord18
-	dw UnownWord19
-	dw UnownWord20
-	dw UnownWord21
-	dw UnownWord22
-	dw UnownWord23
-	dw UnownWord24
-	dw UnownWord25
-	dw UnownWord26
-; fba90
-
-unownword: macro
-x = 1
-	rept STRLEN(\1)
-	db STRSUB(\1, x, 1) - $40
-x = x + 1
-	endr
-	db -1
-endm
-
-
-UnownWord1:	 unownword "ANGRY"
-UnownWord2:	 unownword "BEAR"
-UnownWord3:	 unownword "CHASE"
-UnownWord4:	 unownword "DIRECT"
-UnownWord5:	 unownword "ENGAGE"
-UnownWord6:	 unownword "FIND"
-UnownWord7:	 unownword "GIVE"
-UnownWord8:	 unownword "HELP"
-UnownWord9:	 unownword "INCREASE"
-UnownWord10: unownword "JOIN"
-UnownWord11: unownword "KEEP"
-UnownWord12: unownword "LAUGH"
-UnownWord13: unownword "MAKE"
-UnownWord14: unownword "NUZZLE"
-UnownWord15: unownword "OBSERVE"
-UnownWord16: unownword "PERFORM"
-UnownWord17: unownword "QUICKEN"
-UnownWord18: unownword "REASSURE"
-UnownWord19: unownword "SEARCH"
-UnownWord20: unownword "TELL"
-UnownWord21: unownword "UNDO"
-UnownWord22: unownword "VANISH"
-UnownWord23: unownword "WANT"
-UnownWord24: unownword "XXXXX"
-UnownWord25: unownword "YIELD"
-UnownWord26: unownword "ZOOM"
-; fbb32
+INCLUDE "data/unown_words.asm"
--- a/event/unown.asm
+++ b/event/unown.asm
@@ -1,5 +1,3 @@
-
-
 SpecialHoOhChamber: ; 0x8addb
 	ld hl, PartySpecies
 	ld a, [hl]
--- a/gfx/pics/animation.asm
+++ b/gfx/pics/animation.asm
@@ -1,6 +1,5 @@
 ; Pic animation arrangement.
 
-
 AnimateMon_Slow_Normal: ; d0000
 	hlcoord 12, 0
 	ld a, [wBattleMode]
@@ -53,23 +52,18 @@
 	ret
 ; d0042
 
-
-POKEANIM: MACRO
+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
@@ -81,15 +75,15 @@
 	dw .Egg1
 	dw .Egg2
 
-.Slow:   POKEANIM StereoCry, Setup2, Play
-.Normal: POKEANIM StereoCry, Setup, Play
-.Menu:   POKEANIM CryNoWait, Setup, Play, SetWait, Wait, Extra, Play
-.Trade:  POKEANIM Extra, Play2, Extra, Play, SetWait, Wait, Cry, Setup, Play
-.Evolve: POKEANIM Extra, Play, SetWait, Wait, CryNoWait, Setup, Play
-.Hatch:  POKEANIM Extra, Play, CryNoWait, Setup, Play, SetWait, Wait, Extra, Play
-.Unused: POKEANIM CryNoWait, Setup, Play, SetWait, Wait, Extra, Play
-.Egg1:   POKEANIM Setup, Play
-.Egg2:   POKEANIM Extra, Play
+.Slow:   pokeanim StereoCry, Setup2, Play
+.Normal: pokeanim StereoCry, Setup, Play
+.Menu:   pokeanim CryNoWait, Setup, Play, SetWait, Wait, Extra, Play
+.Trade:  pokeanim Extra, Play2, Extra, Play, SetWait, Wait, Cry, Setup, Play
+.Evolve: pokeanim Extra, Play, SetWait, Wait, CryNoWait, Setup, Play
+.Hatch:  pokeanim Extra, Play, CryNoWait, Setup, Play, SetWait, Wait, Extra, Play
+.Unused: pokeanim CryNoWait, Setup, Play, SetWait, Wait, Extra, Play
+.Egg1:   pokeanim Setup, Play
+.Egg2:   pokeanim Extra, Play
 
 
 AnimateFrontpic: ; d008e
--- a/gfx/pics/pic_pointers.asm
+++ b/gfx/pics/pic_pointers.asm
@@ -1,511 +1,511 @@
 PicPointers::
 ; entries correspond to constants/pokemon_constants.asm, two apiece
-	add_pic BulbasaurFrontpic
-	add_pic BulbasaurBackpic
-	add_pic IvysaurFrontpic
-	add_pic IvysaurBackpic
-	add_pic VenusaurFrontpic
-	add_pic VenusaurBackpic
-	add_pic CharmanderFrontpic
-	add_pic CharmanderBackpic
-	add_pic CharmeleonFrontpic
-	add_pic CharmeleonBackpic
-	add_pic CharizardFrontpic
-	add_pic CharizardBackpic
-	add_pic SquirtleFrontpic
-	add_pic SquirtleBackpic
-	add_pic WartortleFrontpic
-	add_pic WartortleBackpic
-	add_pic BlastoiseFrontpic
-	add_pic BlastoiseBackpic
-	add_pic CaterpieFrontpic
-	add_pic CaterpieBackpic
-	add_pic MetapodFrontpic
-	add_pic MetapodBackpic
-	add_pic ButterfreeFrontpic
-	add_pic ButterfreeBackpic
-	add_pic WeedleFrontpic
-	add_pic WeedleBackpic
-	add_pic KakunaFrontpic
-	add_pic KakunaBackpic
-	add_pic BeedrillFrontpic
-	add_pic BeedrillBackpic
-	add_pic PidgeyFrontpic
-	add_pic PidgeyBackpic
-	add_pic PidgeottoFrontpic
-	add_pic PidgeottoBackpic
-	add_pic PidgeotFrontpic
-	add_pic PidgeotBackpic
-	add_pic RattataFrontpic
-	add_pic RattataBackpic
-	add_pic RaticateFrontpic
-	add_pic RaticateBackpic
-	add_pic SpearowFrontpic
-	add_pic SpearowBackpic
-	add_pic FearowFrontpic
-	add_pic FearowBackpic
-	add_pic EkansFrontpic
-	add_pic EkansBackpic
-	add_pic ArbokFrontpic
-	add_pic ArbokBackpic
-	add_pic PikachuFrontpic
-	add_pic PikachuBackpic
-	add_pic RaichuFrontpic
-	add_pic RaichuBackpic
-	add_pic SandshrewFrontpic
-	add_pic SandshrewBackpic
-	add_pic SandslashFrontpic
-	add_pic SandslashBackpic
-	add_pic NidoranFFrontpic
-	add_pic NidoranFBackpic
-	add_pic NidorinaFrontpic
-	add_pic NidorinaBackpic
-	add_pic NidoqueenFrontpic
-	add_pic NidoqueenBackpic
-	add_pic NidoranMFrontpic
-	add_pic NidoranMBackpic
-	add_pic NidorinoFrontpic
-	add_pic NidorinoBackpic
-	add_pic NidokingFrontpic
-	add_pic NidokingBackpic
-	add_pic ClefairyFrontpic
-	add_pic ClefairyBackpic
-	add_pic ClefableFrontpic
-	add_pic ClefableBackpic
-	add_pic VulpixFrontpic
-	add_pic VulpixBackpic
-	add_pic NinetalesFrontpic
-	add_pic NinetalesBackpic
-	add_pic JigglypuffFrontpic
-	add_pic JigglypuffBackpic
-	add_pic WigglytuffFrontpic
-	add_pic WigglytuffBackpic
-	add_pic ZubatFrontpic
-	add_pic ZubatBackpic
-	add_pic GolbatFrontpic
-	add_pic GolbatBackpic
-	add_pic OddishFrontpic
-	add_pic OddishBackpic
-	add_pic GloomFrontpic
-	add_pic GloomBackpic
-	add_pic VileplumeFrontpic
-	add_pic VileplumeBackpic
-	add_pic ParasFrontpic
-	add_pic ParasBackpic
-	add_pic ParasectFrontpic
-	add_pic ParasectBackpic
-	add_pic VenonatFrontpic
-	add_pic VenonatBackpic
-	add_pic VenomothFrontpic
-	add_pic VenomothBackpic
-	add_pic DiglettFrontpic
-	add_pic DiglettBackpic
-	add_pic DugtrioFrontpic
-	add_pic DugtrioBackpic
-	add_pic MeowthFrontpic
-	add_pic MeowthBackpic
-	add_pic PersianFrontpic
-	add_pic PersianBackpic
-	add_pic PsyduckFrontpic
-	add_pic PsyduckBackpic
-	add_pic GolduckFrontpic
-	add_pic GolduckBackpic
-	add_pic MankeyFrontpic
-	add_pic MankeyBackpic
-	add_pic PrimeapeFrontpic
-	add_pic PrimeapeBackpic
-	add_pic GrowlitheFrontpic
-	add_pic GrowlitheBackpic
-	add_pic ArcanineFrontpic
-	add_pic ArcanineBackpic
-	add_pic PoliwagFrontpic
-	add_pic PoliwagBackpic
-	add_pic PoliwhirlFrontpic
-	add_pic PoliwhirlBackpic
-	add_pic PoliwrathFrontpic
-	add_pic PoliwrathBackpic
-	add_pic AbraFrontpic
-	add_pic AbraBackpic
-	add_pic KadabraFrontpic
-	add_pic KadabraBackpic
-	add_pic AlakazamFrontpic
-	add_pic AlakazamBackpic
-	add_pic MachopFrontpic
-	add_pic MachopBackpic
-	add_pic MachokeFrontpic
-	add_pic MachokeBackpic
-	add_pic MachampFrontpic
-	add_pic MachampBackpic
-	add_pic BellsproutFrontpic
-	add_pic BellsproutBackpic
-	add_pic WeepinbellFrontpic
-	add_pic WeepinbellBackpic
-	add_pic VictreebelFrontpic
-	add_pic VictreebelBackpic
-	add_pic TentacoolFrontpic
-	add_pic TentacoolBackpic
-	add_pic TentacruelFrontpic
-	add_pic TentacruelBackpic
-	add_pic GeodudeFrontpic
-	add_pic GeodudeBackpic
-	add_pic GravelerFrontpic
-	add_pic GravelerBackpic
-	add_pic GolemFrontpic
-	add_pic GolemBackpic
-	add_pic PonytaFrontpic
-	add_pic PonytaBackpic
-	add_pic RapidashFrontpic
-	add_pic RapidashBackpic
-	add_pic SlowpokeFrontpic
-	add_pic SlowpokeBackpic
-	add_pic SlowbroFrontpic
-	add_pic SlowbroBackpic
-	add_pic MagnemiteFrontpic
-	add_pic MagnemiteBackpic
-	add_pic MagnetonFrontpic
-	add_pic MagnetonBackpic
-	add_pic FarfetchDFrontpic
-	add_pic FarfetchDBackpic
-	add_pic DoduoFrontpic
-	add_pic DoduoBackpic
-	add_pic DodrioFrontpic
-	add_pic DodrioBackpic
-	add_pic SeelFrontpic
-	add_pic SeelBackpic
-	add_pic DewgongFrontpic
-	add_pic DewgongBackpic
-	add_pic GrimerFrontpic
-	add_pic GrimerBackpic
-	add_pic MukFrontpic
-	add_pic MukBackpic
-	add_pic ShellderFrontpic
-	add_pic ShellderBackpic
-	add_pic CloysterFrontpic
-	add_pic CloysterBackpic
-	add_pic GastlyFrontpic
-	add_pic GastlyBackpic
-	add_pic HaunterFrontpic
-	add_pic HaunterBackpic
-	add_pic GengarFrontpic
-	add_pic GengarBackpic
-	add_pic OnixFrontpic
-	add_pic OnixBackpic
-	add_pic DrowzeeFrontpic
-	add_pic DrowzeeBackpic
-	add_pic HypnoFrontpic
-	add_pic HypnoBackpic
-	add_pic KrabbyFrontpic
-	add_pic KrabbyBackpic
-	add_pic KinglerFrontpic
-	add_pic KinglerBackpic
-	add_pic VoltorbFrontpic
-	add_pic VoltorbBackpic
-	add_pic ElectrodeFrontpic
-	add_pic ElectrodeBackpic
-	add_pic ExeggcuteFrontpic
-	add_pic ExeggcuteBackpic
-	add_pic ExeggutorFrontpic
-	add_pic ExeggutorBackpic
-	add_pic CuboneFrontpic
-	add_pic CuboneBackpic
-	add_pic MarowakFrontpic
-	add_pic MarowakBackpic
-	add_pic HitmonleeFrontpic
-	add_pic HitmonleeBackpic
-	add_pic HitmonchanFrontpic
-	add_pic HitmonchanBackpic
-	add_pic LickitungFrontpic
-	add_pic LickitungBackpic
-	add_pic KoffingFrontpic
-	add_pic KoffingBackpic
-	add_pic WeezingFrontpic
-	add_pic WeezingBackpic
-	add_pic RhyhornFrontpic
-	add_pic RhyhornBackpic
-	add_pic RhydonFrontpic
-	add_pic RhydonBackpic
-	add_pic ChanseyFrontpic
-	add_pic ChanseyBackpic
-	add_pic TangelaFrontpic
-	add_pic TangelaBackpic
-	add_pic KangaskhanFrontpic
-	add_pic KangaskhanBackpic
-	add_pic HorseaFrontpic
-	add_pic HorseaBackpic
-	add_pic SeadraFrontpic
-	add_pic SeadraBackpic
-	add_pic GoldeenFrontpic
-	add_pic GoldeenBackpic
-	add_pic SeakingFrontpic
-	add_pic SeakingBackpic
-	add_pic StaryuFrontpic
-	add_pic StaryuBackpic
-	add_pic StarmieFrontpic
-	add_pic StarmieBackpic
-	add_pic MrMimeFrontpic
-	add_pic MrMimeBackpic
-	add_pic ScytherFrontpic
-	add_pic ScytherBackpic
-	add_pic JynxFrontpic
-	add_pic JynxBackpic
-	add_pic ElectabuzzFrontpic
-	add_pic ElectabuzzBackpic
-	add_pic MagmarFrontpic
-	add_pic MagmarBackpic
-	add_pic PinsirFrontpic
-	add_pic PinsirBackpic
-	add_pic TaurosFrontpic
-	add_pic TaurosBackpic
-	add_pic MagikarpFrontpic
-	add_pic MagikarpBackpic
-	add_pic GyaradosFrontpic
-	add_pic GyaradosBackpic
-	add_pic LaprasFrontpic
-	add_pic LaprasBackpic
-	add_pic DittoFrontpic
-	add_pic DittoBackpic
-	add_pic EeveeFrontpic
-	add_pic EeveeBackpic
-	add_pic VaporeonFrontpic
-	add_pic VaporeonBackpic
-	add_pic JolteonFrontpic
-	add_pic JolteonBackpic
-	add_pic FlareonFrontpic
-	add_pic FlareonBackpic
-	add_pic PorygonFrontpic
-	add_pic PorygonBackpic
-	add_pic OmanyteFrontpic
-	add_pic OmanyteBackpic
-	add_pic OmastarFrontpic
-	add_pic OmastarBackpic
-	add_pic KabutoFrontpic
-	add_pic KabutoBackpic
-	add_pic KabutopsFrontpic
-	add_pic KabutopsBackpic
-	add_pic AerodactylFrontpic
-	add_pic AerodactylBackpic
-	add_pic SnorlaxFrontpic
-	add_pic SnorlaxBackpic
-	add_pic ArticunoFrontpic
-	add_pic ArticunoBackpic
-	add_pic ZapdosFrontpic
-	add_pic ZapdosBackpic
-	add_pic MoltresFrontpic
-	add_pic MoltresBackpic
-	add_pic DratiniFrontpic
-	add_pic DratiniBackpic
-	add_pic DragonairFrontpic
-	add_pic DragonairBackpic
-	add_pic DragoniteFrontpic
-	add_pic DragoniteBackpic
-	add_pic MewtwoFrontpic
-	add_pic MewtwoBackpic
-	add_pic MewFrontpic
-	add_pic MewBackpic
-	add_pic ChikoritaFrontpic
-	add_pic ChikoritaBackpic
-	add_pic BayleefFrontpic
-	add_pic BayleefBackpic
-	add_pic MeganiumFrontpic
-	add_pic MeganiumBackpic
-	add_pic CyndaquilFrontpic
-	add_pic CyndaquilBackpic
-	add_pic QuilavaFrontpic
-	add_pic QuilavaBackpic
-	add_pic TyphlosionFrontpic
-	add_pic TyphlosionBackpic
-	add_pic TotodileFrontpic
-	add_pic TotodileBackpic
-	add_pic CroconawFrontpic
-	add_pic CroconawBackpic
-	add_pic FeraligatrFrontpic
-	add_pic FeraligatrBackpic
-	add_pic SentretFrontpic
-	add_pic SentretBackpic
-	add_pic FurretFrontpic
-	add_pic FurretBackpic
-	add_pic HoothootFrontpic
-	add_pic HoothootBackpic
-	add_pic NoctowlFrontpic
-	add_pic NoctowlBackpic
-	add_pic LedybaFrontpic
-	add_pic LedybaBackpic
-	add_pic LedianFrontpic
-	add_pic LedianBackpic
-	add_pic SpinarakFrontpic
-	add_pic SpinarakBackpic
-	add_pic AriadosFrontpic
-	add_pic AriadosBackpic
-	add_pic CrobatFrontpic
-	add_pic CrobatBackpic
-	add_pic ChinchouFrontpic
-	add_pic ChinchouBackpic
-	add_pic LanturnFrontpic
-	add_pic LanturnBackpic
-	add_pic PichuFrontpic
-	add_pic PichuBackpic
-	add_pic CleffaFrontpic
-	add_pic CleffaBackpic
-	add_pic IgglybuffFrontpic
-	add_pic IgglybuffBackpic
-	add_pic TogepiFrontpic
-	add_pic TogepiBackpic
-	add_pic TogeticFrontpic
-	add_pic TogeticBackpic
-	add_pic NatuFrontpic
-	add_pic NatuBackpic
-	add_pic XatuFrontpic
-	add_pic XatuBackpic
-	add_pic MareepFrontpic
-	add_pic MareepBackpic
-	add_pic FlaaffyFrontpic
-	add_pic FlaaffyBackpic
-	add_pic AmpharosFrontpic
-	add_pic AmpharosBackpic
-	add_pic BellossomFrontpic
-	add_pic BellossomBackpic
-	add_pic MarillFrontpic
-	add_pic MarillBackpic
-	add_pic AzumarillFrontpic
-	add_pic AzumarillBackpic
-	add_pic SudowoodoFrontpic
-	add_pic SudowoodoBackpic
-	add_pic PolitoedFrontpic
-	add_pic PolitoedBackpic
-	add_pic HoppipFrontpic
-	add_pic HoppipBackpic
-	add_pic SkiploomFrontpic
-	add_pic SkiploomBackpic
-	add_pic JumpluffFrontpic
-	add_pic JumpluffBackpic
-	add_pic AipomFrontpic
-	add_pic AipomBackpic
-	add_pic SunkernFrontpic
-	add_pic SunkernBackpic
-	add_pic SunfloraFrontpic
-	add_pic SunfloraBackpic
-	add_pic YanmaFrontpic
-	add_pic YanmaBackpic
-	add_pic WooperFrontpic
-	add_pic WooperBackpic
-	add_pic QuagsireFrontpic
-	add_pic QuagsireBackpic
-	add_pic EspeonFrontpic
-	add_pic EspeonBackpic
-	add_pic UmbreonFrontpic
-	add_pic UmbreonBackpic
-	add_pic MurkrowFrontpic
-	add_pic MurkrowBackpic
-	add_pic SlowkingFrontpic
-	add_pic SlowkingBackpic
-	add_pic MisdreavusFrontpic
-	add_pic MisdreavusBackpic
+	dba_pic BulbasaurFrontpic
+	dba_pic BulbasaurBackpic
+	dba_pic IvysaurFrontpic
+	dba_pic IvysaurBackpic
+	dba_pic VenusaurFrontpic
+	dba_pic VenusaurBackpic
+	dba_pic CharmanderFrontpic
+	dba_pic CharmanderBackpic
+	dba_pic CharmeleonFrontpic
+	dba_pic CharmeleonBackpic
+	dba_pic CharizardFrontpic
+	dba_pic CharizardBackpic
+	dba_pic SquirtleFrontpic
+	dba_pic SquirtleBackpic
+	dba_pic WartortleFrontpic
+	dba_pic WartortleBackpic
+	dba_pic BlastoiseFrontpic
+	dba_pic BlastoiseBackpic
+	dba_pic CaterpieFrontpic
+	dba_pic CaterpieBackpic
+	dba_pic MetapodFrontpic
+	dba_pic MetapodBackpic
+	dba_pic ButterfreeFrontpic
+	dba_pic ButterfreeBackpic
+	dba_pic WeedleFrontpic
+	dba_pic WeedleBackpic
+	dba_pic KakunaFrontpic
+	dba_pic KakunaBackpic
+	dba_pic BeedrillFrontpic
+	dba_pic BeedrillBackpic
+	dba_pic PidgeyFrontpic
+	dba_pic PidgeyBackpic
+	dba_pic PidgeottoFrontpic
+	dba_pic PidgeottoBackpic
+	dba_pic PidgeotFrontpic
+	dba_pic PidgeotBackpic
+	dba_pic RattataFrontpic
+	dba_pic RattataBackpic
+	dba_pic RaticateFrontpic
+	dba_pic RaticateBackpic
+	dba_pic SpearowFrontpic
+	dba_pic SpearowBackpic
+	dba_pic FearowFrontpic
+	dba_pic FearowBackpic
+	dba_pic EkansFrontpic
+	dba_pic EkansBackpic
+	dba_pic ArbokFrontpic
+	dba_pic ArbokBackpic
+	dba_pic PikachuFrontpic
+	dba_pic PikachuBackpic
+	dba_pic RaichuFrontpic
+	dba_pic RaichuBackpic
+	dba_pic SandshrewFrontpic
+	dba_pic SandshrewBackpic
+	dba_pic SandslashFrontpic
+	dba_pic SandslashBackpic
+	dba_pic NidoranFFrontpic
+	dba_pic NidoranFBackpic
+	dba_pic NidorinaFrontpic
+	dba_pic NidorinaBackpic
+	dba_pic NidoqueenFrontpic
+	dba_pic NidoqueenBackpic
+	dba_pic NidoranMFrontpic
+	dba_pic NidoranMBackpic
+	dba_pic NidorinoFrontpic
+	dba_pic NidorinoBackpic
+	dba_pic NidokingFrontpic
+	dba_pic NidokingBackpic
+	dba_pic ClefairyFrontpic
+	dba_pic ClefairyBackpic
+	dba_pic ClefableFrontpic
+	dba_pic ClefableBackpic
+	dba_pic VulpixFrontpic
+	dba_pic VulpixBackpic
+	dba_pic NinetalesFrontpic
+	dba_pic NinetalesBackpic
+	dba_pic JigglypuffFrontpic
+	dba_pic JigglypuffBackpic
+	dba_pic WigglytuffFrontpic
+	dba_pic WigglytuffBackpic
+	dba_pic ZubatFrontpic
+	dba_pic ZubatBackpic
+	dba_pic GolbatFrontpic
+	dba_pic GolbatBackpic
+	dba_pic OddishFrontpic
+	dba_pic OddishBackpic
+	dba_pic GloomFrontpic
+	dba_pic GloomBackpic
+	dba_pic VileplumeFrontpic
+	dba_pic VileplumeBackpic
+	dba_pic ParasFrontpic
+	dba_pic ParasBackpic
+	dba_pic ParasectFrontpic
+	dba_pic ParasectBackpic
+	dba_pic VenonatFrontpic
+	dba_pic VenonatBackpic
+	dba_pic VenomothFrontpic
+	dba_pic VenomothBackpic
+	dba_pic DiglettFrontpic
+	dba_pic DiglettBackpic
+	dba_pic DugtrioFrontpic
+	dba_pic DugtrioBackpic
+	dba_pic MeowthFrontpic
+	dba_pic MeowthBackpic
+	dba_pic PersianFrontpic
+	dba_pic PersianBackpic
+	dba_pic PsyduckFrontpic
+	dba_pic PsyduckBackpic
+	dba_pic GolduckFrontpic
+	dba_pic GolduckBackpic
+	dba_pic MankeyFrontpic
+	dba_pic MankeyBackpic
+	dba_pic PrimeapeFrontpic
+	dba_pic PrimeapeBackpic
+	dba_pic GrowlitheFrontpic
+	dba_pic GrowlitheBackpic
+	dba_pic ArcanineFrontpic
+	dba_pic ArcanineBackpic
+	dba_pic PoliwagFrontpic
+	dba_pic PoliwagBackpic
+	dba_pic PoliwhirlFrontpic
+	dba_pic PoliwhirlBackpic
+	dba_pic PoliwrathFrontpic
+	dba_pic PoliwrathBackpic
+	dba_pic AbraFrontpic
+	dba_pic AbraBackpic
+	dba_pic KadabraFrontpic
+	dba_pic KadabraBackpic
+	dba_pic AlakazamFrontpic
+	dba_pic AlakazamBackpic
+	dba_pic MachopFrontpic
+	dba_pic MachopBackpic
+	dba_pic MachokeFrontpic
+	dba_pic MachokeBackpic
+	dba_pic MachampFrontpic
+	dba_pic MachampBackpic
+	dba_pic BellsproutFrontpic
+	dba_pic BellsproutBackpic
+	dba_pic WeepinbellFrontpic
+	dba_pic WeepinbellBackpic
+	dba_pic VictreebelFrontpic
+	dba_pic VictreebelBackpic
+	dba_pic TentacoolFrontpic
+	dba_pic TentacoolBackpic
+	dba_pic TentacruelFrontpic
+	dba_pic TentacruelBackpic
+	dba_pic GeodudeFrontpic
+	dba_pic GeodudeBackpic
+	dba_pic GravelerFrontpic
+	dba_pic GravelerBackpic
+	dba_pic GolemFrontpic
+	dba_pic GolemBackpic
+	dba_pic PonytaFrontpic
+	dba_pic PonytaBackpic
+	dba_pic RapidashFrontpic
+	dba_pic RapidashBackpic
+	dba_pic SlowpokeFrontpic
+	dba_pic SlowpokeBackpic
+	dba_pic SlowbroFrontpic
+	dba_pic SlowbroBackpic
+	dba_pic MagnemiteFrontpic
+	dba_pic MagnemiteBackpic
+	dba_pic MagnetonFrontpic
+	dba_pic MagnetonBackpic
+	dba_pic FarfetchDFrontpic
+	dba_pic FarfetchDBackpic
+	dba_pic DoduoFrontpic
+	dba_pic DoduoBackpic
+	dba_pic DodrioFrontpic
+	dba_pic DodrioBackpic
+	dba_pic SeelFrontpic
+	dba_pic SeelBackpic
+	dba_pic DewgongFrontpic
+	dba_pic DewgongBackpic
+	dba_pic GrimerFrontpic
+	dba_pic GrimerBackpic
+	dba_pic MukFrontpic
+	dba_pic MukBackpic
+	dba_pic ShellderFrontpic
+	dba_pic ShellderBackpic
+	dba_pic CloysterFrontpic
+	dba_pic CloysterBackpic
+	dba_pic GastlyFrontpic
+	dba_pic GastlyBackpic
+	dba_pic HaunterFrontpic
+	dba_pic HaunterBackpic
+	dba_pic GengarFrontpic
+	dba_pic GengarBackpic
+	dba_pic OnixFrontpic
+	dba_pic OnixBackpic
+	dba_pic DrowzeeFrontpic
+	dba_pic DrowzeeBackpic
+	dba_pic HypnoFrontpic
+	dba_pic HypnoBackpic
+	dba_pic KrabbyFrontpic
+	dba_pic KrabbyBackpic
+	dba_pic KinglerFrontpic
+	dba_pic KinglerBackpic
+	dba_pic VoltorbFrontpic
+	dba_pic VoltorbBackpic
+	dba_pic ElectrodeFrontpic
+	dba_pic ElectrodeBackpic
+	dba_pic ExeggcuteFrontpic
+	dba_pic ExeggcuteBackpic
+	dba_pic ExeggutorFrontpic
+	dba_pic ExeggutorBackpic
+	dba_pic CuboneFrontpic
+	dba_pic CuboneBackpic
+	dba_pic MarowakFrontpic
+	dba_pic MarowakBackpic
+	dba_pic HitmonleeFrontpic
+	dba_pic HitmonleeBackpic
+	dba_pic HitmonchanFrontpic
+	dba_pic HitmonchanBackpic
+	dba_pic LickitungFrontpic
+	dba_pic LickitungBackpic
+	dba_pic KoffingFrontpic
+	dba_pic KoffingBackpic
+	dba_pic WeezingFrontpic
+	dba_pic WeezingBackpic
+	dba_pic RhyhornFrontpic
+	dba_pic RhyhornBackpic
+	dba_pic RhydonFrontpic
+	dba_pic RhydonBackpic
+	dba_pic ChanseyFrontpic
+	dba_pic ChanseyBackpic
+	dba_pic TangelaFrontpic
+	dba_pic TangelaBackpic
+	dba_pic KangaskhanFrontpic
+	dba_pic KangaskhanBackpic
+	dba_pic HorseaFrontpic
+	dba_pic HorseaBackpic
+	dba_pic SeadraFrontpic
+	dba_pic SeadraBackpic
+	dba_pic GoldeenFrontpic
+	dba_pic GoldeenBackpic
+	dba_pic SeakingFrontpic
+	dba_pic SeakingBackpic
+	dba_pic StaryuFrontpic
+	dba_pic StaryuBackpic
+	dba_pic StarmieFrontpic
+	dba_pic StarmieBackpic
+	dba_pic MrMimeFrontpic
+	dba_pic MrMimeBackpic
+	dba_pic ScytherFrontpic
+	dba_pic ScytherBackpic
+	dba_pic JynxFrontpic
+	dba_pic JynxBackpic
+	dba_pic ElectabuzzFrontpic
+	dba_pic ElectabuzzBackpic
+	dba_pic MagmarFrontpic
+	dba_pic MagmarBackpic
+	dba_pic PinsirFrontpic
+	dba_pic PinsirBackpic
+	dba_pic TaurosFrontpic
+	dba_pic TaurosBackpic
+	dba_pic MagikarpFrontpic
+	dba_pic MagikarpBackpic
+	dba_pic GyaradosFrontpic
+	dba_pic GyaradosBackpic
+	dba_pic LaprasFrontpic
+	dba_pic LaprasBackpic
+	dba_pic DittoFrontpic
+	dba_pic DittoBackpic
+	dba_pic EeveeFrontpic
+	dba_pic EeveeBackpic
+	dba_pic VaporeonFrontpic
+	dba_pic VaporeonBackpic
+	dba_pic JolteonFrontpic
+	dba_pic JolteonBackpic
+	dba_pic FlareonFrontpic
+	dba_pic FlareonBackpic
+	dba_pic PorygonFrontpic
+	dba_pic PorygonBackpic
+	dba_pic OmanyteFrontpic
+	dba_pic OmanyteBackpic
+	dba_pic OmastarFrontpic
+	dba_pic OmastarBackpic
+	dba_pic KabutoFrontpic
+	dba_pic KabutoBackpic
+	dba_pic KabutopsFrontpic
+	dba_pic KabutopsBackpic
+	dba_pic AerodactylFrontpic
+	dba_pic AerodactylBackpic
+	dba_pic SnorlaxFrontpic
+	dba_pic SnorlaxBackpic
+	dba_pic ArticunoFrontpic
+	dba_pic ArticunoBackpic
+	dba_pic ZapdosFrontpic
+	dba_pic ZapdosBackpic
+	dba_pic MoltresFrontpic
+	dba_pic MoltresBackpic
+	dba_pic DratiniFrontpic
+	dba_pic DratiniBackpic
+	dba_pic DragonairFrontpic
+	dba_pic DragonairBackpic
+	dba_pic DragoniteFrontpic
+	dba_pic DragoniteBackpic
+	dba_pic MewtwoFrontpic
+	dba_pic MewtwoBackpic
+	dba_pic MewFrontpic
+	dba_pic MewBackpic
+	dba_pic ChikoritaFrontpic
+	dba_pic ChikoritaBackpic
+	dba_pic BayleefFrontpic
+	dba_pic BayleefBackpic
+	dba_pic MeganiumFrontpic
+	dba_pic MeganiumBackpic
+	dba_pic CyndaquilFrontpic
+	dba_pic CyndaquilBackpic
+	dba_pic QuilavaFrontpic
+	dba_pic QuilavaBackpic
+	dba_pic TyphlosionFrontpic
+	dba_pic TyphlosionBackpic
+	dba_pic TotodileFrontpic
+	dba_pic TotodileBackpic
+	dba_pic CroconawFrontpic
+	dba_pic CroconawBackpic
+	dba_pic FeraligatrFrontpic
+	dba_pic FeraligatrBackpic
+	dba_pic SentretFrontpic
+	dba_pic SentretBackpic
+	dba_pic FurretFrontpic
+	dba_pic FurretBackpic
+	dba_pic HoothootFrontpic
+	dba_pic HoothootBackpic
+	dba_pic NoctowlFrontpic
+	dba_pic NoctowlBackpic
+	dba_pic LedybaFrontpic
+	dba_pic LedybaBackpic
+	dba_pic LedianFrontpic
+	dba_pic LedianBackpic
+	dba_pic SpinarakFrontpic
+	dba_pic SpinarakBackpic
+	dba_pic AriadosFrontpic
+	dba_pic AriadosBackpic
+	dba_pic CrobatFrontpic
+	dba_pic CrobatBackpic
+	dba_pic ChinchouFrontpic
+	dba_pic ChinchouBackpic
+	dba_pic LanturnFrontpic
+	dba_pic LanturnBackpic
+	dba_pic PichuFrontpic
+	dba_pic PichuBackpic
+	dba_pic CleffaFrontpic
+	dba_pic CleffaBackpic
+	dba_pic IgglybuffFrontpic
+	dba_pic IgglybuffBackpic
+	dba_pic TogepiFrontpic
+	dba_pic TogepiBackpic
+	dba_pic TogeticFrontpic
+	dba_pic TogeticBackpic
+	dba_pic NatuFrontpic
+	dba_pic NatuBackpic
+	dba_pic XatuFrontpic
+	dba_pic XatuBackpic
+	dba_pic MareepFrontpic
+	dba_pic MareepBackpic
+	dba_pic FlaaffyFrontpic
+	dba_pic FlaaffyBackpic
+	dba_pic AmpharosFrontpic
+	dba_pic AmpharosBackpic
+	dba_pic BellossomFrontpic
+	dba_pic BellossomBackpic
+	dba_pic MarillFrontpic
+	dba_pic MarillBackpic
+	dba_pic AzumarillFrontpic
+	dba_pic AzumarillBackpic
+	dba_pic SudowoodoFrontpic
+	dba_pic SudowoodoBackpic
+	dba_pic PolitoedFrontpic
+	dba_pic PolitoedBackpic
+	dba_pic HoppipFrontpic
+	dba_pic HoppipBackpic
+	dba_pic SkiploomFrontpic
+	dba_pic SkiploomBackpic
+	dba_pic JumpluffFrontpic
+	dba_pic JumpluffBackpic
+	dba_pic AipomFrontpic
+	dba_pic AipomBackpic
+	dba_pic SunkernFrontpic
+	dba_pic SunkernBackpic
+	dba_pic SunfloraFrontpic
+	dba_pic SunfloraBackpic
+	dba_pic YanmaFrontpic
+	dba_pic YanmaBackpic
+	dba_pic WooperFrontpic
+	dba_pic WooperBackpic
+	dba_pic QuagsireFrontpic
+	dba_pic QuagsireBackpic
+	dba_pic EspeonFrontpic
+	dba_pic EspeonBackpic
+	dba_pic UmbreonFrontpic
+	dba_pic UmbreonBackpic
+	dba_pic MurkrowFrontpic
+	dba_pic MurkrowBackpic
+	dba_pic SlowkingFrontpic
+	dba_pic SlowkingBackpic
+	dba_pic MisdreavusFrontpic
+	dba_pic MisdreavusBackpic
 
 	; Unown pics have their own table. See UnownPicPointers
 	dbw -1, -1
 	dbw -1, -1
 
-	add_pic WobbuffetFrontpic
-	add_pic WobbuffetBackpic
-	add_pic GirafarigFrontpic
-	add_pic GirafarigBackpic
-	add_pic PinecoFrontpic
-	add_pic PinecoBackpic
-	add_pic ForretressFrontpic
-	add_pic ForretressBackpic
-	add_pic DunsparceFrontpic
-	add_pic DunsparceBackpic
-	add_pic GligarFrontpic
-	add_pic GligarBackpic
-	add_pic SteelixFrontpic
-	add_pic SteelixBackpic
-	add_pic SnubbullFrontpic
-	add_pic SnubbullBackpic
-	add_pic GranbullFrontpic
-	add_pic GranbullBackpic
-	add_pic QwilfishFrontpic
-	add_pic QwilfishBackpic
-	add_pic ScizorFrontpic
-	add_pic ScizorBackpic
-	add_pic ShuckleFrontpic
-	add_pic ShuckleBackpic
-	add_pic HeracrossFrontpic
-	add_pic HeracrossBackpic
-	add_pic SneaselFrontpic
-	add_pic SneaselBackpic
-	add_pic TeddiursaFrontpic
-	add_pic TeddiursaBackpic
-	add_pic UrsaringFrontpic
-	add_pic UrsaringBackpic
-	add_pic SlugmaFrontpic
-	add_pic SlugmaBackpic
-	add_pic MagcargoFrontpic
-	add_pic MagcargoBackpic
-	add_pic SwinubFrontpic
-	add_pic SwinubBackpic
-	add_pic PiloswineFrontpic
-	add_pic PiloswineBackpic
-	add_pic CorsolaFrontpic
-	add_pic CorsolaBackpic
-	add_pic RemoraidFrontpic
-	add_pic RemoraidBackpic
-	add_pic OctilleryFrontpic
-	add_pic OctilleryBackpic
-	add_pic DelibirdFrontpic
-	add_pic DelibirdBackpic
-	add_pic MantineFrontpic
-	add_pic MantineBackpic
-	add_pic SkarmoryFrontpic
-	add_pic SkarmoryBackpic
-	add_pic HoundourFrontpic
-	add_pic HoundourBackpic
-	add_pic HoundoomFrontpic
-	add_pic HoundoomBackpic
-	add_pic KingdraFrontpic
-	add_pic KingdraBackpic
-	add_pic PhanpyFrontpic
-	add_pic PhanpyBackpic
-	add_pic DonphanFrontpic
-	add_pic DonphanBackpic
-	add_pic Porygon2Frontpic
-	add_pic Porygon2Backpic
-	add_pic StantlerFrontpic
-	add_pic StantlerBackpic
-	add_pic SmeargleFrontpic
-	add_pic SmeargleBackpic
-	add_pic TyrogueFrontpic
-	add_pic TyrogueBackpic
-	add_pic HitmontopFrontpic
-	add_pic HitmontopBackpic
-	add_pic SmoochumFrontpic
-	add_pic SmoochumBackpic
-	add_pic ElekidFrontpic
-	add_pic ElekidBackpic
-	add_pic MagbyFrontpic
-	add_pic MagbyBackpic
-	add_pic MiltankFrontpic
-	add_pic MiltankBackpic
-	add_pic BlisseyFrontpic
-	add_pic BlisseyBackpic
-	add_pic RaikouFrontpic
-	add_pic RaikouBackpic
-	add_pic EnteiFrontpic
-	add_pic EnteiBackpic
-	add_pic SuicuneFrontpic
-	add_pic SuicuneBackpic
-	add_pic LarvitarFrontpic
-	add_pic LarvitarBackpic
-	add_pic PupitarFrontpic
-	add_pic PupitarBackpic
-	add_pic TyranitarFrontpic
-	add_pic TyranitarBackpic
-	add_pic LugiaFrontpic
-	add_pic LugiaBackpic
-	add_pic HoOhFrontpic
-	add_pic HoOhBackpic
-	add_pic CelebiFrontpic
-	add_pic CelebiBackpic
+	dba_pic WobbuffetFrontpic
+	dba_pic WobbuffetBackpic
+	dba_pic GirafarigFrontpic
+	dba_pic GirafarigBackpic
+	dba_pic PinecoFrontpic
+	dba_pic PinecoBackpic
+	dba_pic ForretressFrontpic
+	dba_pic ForretressBackpic
+	dba_pic DunsparceFrontpic
+	dba_pic DunsparceBackpic
+	dba_pic GligarFrontpic
+	dba_pic GligarBackpic
+	dba_pic SteelixFrontpic
+	dba_pic SteelixBackpic
+	dba_pic SnubbullFrontpic
+	dba_pic SnubbullBackpic
+	dba_pic GranbullFrontpic
+	dba_pic GranbullBackpic
+	dba_pic QwilfishFrontpic
+	dba_pic QwilfishBackpic
+	dba_pic ScizorFrontpic
+	dba_pic ScizorBackpic
+	dba_pic ShuckleFrontpic
+	dba_pic ShuckleBackpic
+	dba_pic HeracrossFrontpic
+	dba_pic HeracrossBackpic
+	dba_pic SneaselFrontpic
+	dba_pic SneaselBackpic
+	dba_pic TeddiursaFrontpic
+	dba_pic TeddiursaBackpic
+	dba_pic UrsaringFrontpic
+	dba_pic UrsaringBackpic
+	dba_pic SlugmaFrontpic
+	dba_pic SlugmaBackpic
+	dba_pic MagcargoFrontpic
+	dba_pic MagcargoBackpic
+	dba_pic SwinubFrontpic
+	dba_pic SwinubBackpic
+	dba_pic PiloswineFrontpic
+	dba_pic PiloswineBackpic
+	dba_pic CorsolaFrontpic
+	dba_pic CorsolaBackpic
+	dba_pic RemoraidFrontpic
+	dba_pic RemoraidBackpic
+	dba_pic OctilleryFrontpic
+	dba_pic OctilleryBackpic
+	dba_pic DelibirdFrontpic
+	dba_pic DelibirdBackpic
+	dba_pic MantineFrontpic
+	dba_pic MantineBackpic
+	dba_pic SkarmoryFrontpic
+	dba_pic SkarmoryBackpic
+	dba_pic HoundourFrontpic
+	dba_pic HoundourBackpic
+	dba_pic HoundoomFrontpic
+	dba_pic HoundoomBackpic
+	dba_pic KingdraFrontpic
+	dba_pic KingdraBackpic
+	dba_pic PhanpyFrontpic
+	dba_pic PhanpyBackpic
+	dba_pic DonphanFrontpic
+	dba_pic DonphanBackpic
+	dba_pic Porygon2Frontpic
+	dba_pic Porygon2Backpic
+	dba_pic StantlerFrontpic
+	dba_pic StantlerBackpic
+	dba_pic SmeargleFrontpic
+	dba_pic SmeargleBackpic
+	dba_pic TyrogueFrontpic
+	dba_pic TyrogueBackpic
+	dba_pic HitmontopFrontpic
+	dba_pic HitmontopBackpic
+	dba_pic SmoochumFrontpic
+	dba_pic SmoochumBackpic
+	dba_pic ElekidFrontpic
+	dba_pic ElekidBackpic
+	dba_pic MagbyFrontpic
+	dba_pic MagbyBackpic
+	dba_pic MiltankFrontpic
+	dba_pic MiltankBackpic
+	dba_pic BlisseyFrontpic
+	dba_pic BlisseyBackpic
+	dba_pic RaikouFrontpic
+	dba_pic RaikouBackpic
+	dba_pic EnteiFrontpic
+	dba_pic EnteiBackpic
+	dba_pic SuicuneFrontpic
+	dba_pic SuicuneBackpic
+	dba_pic LarvitarFrontpic
+	dba_pic LarvitarBackpic
+	dba_pic PupitarFrontpic
+	dba_pic PupitarBackpic
+	dba_pic TyranitarFrontpic
+	dba_pic TyranitarBackpic
+	dba_pic LugiaFrontpic
+	dba_pic LugiaBackpic
+	dba_pic HoOhFrontpic
+	dba_pic HoOhBackpic
+	dba_pic CelebiFrontpic
+	dba_pic CelebiBackpic
 	dbw -1, -1 ; unused
 	dbw -1, -1 ; unused
-	add_pic EggPic
+	dba_pic EggPic
 	dbw -1, -1 ; unused
--- a/gfx/pics/unown_pic_pointers.asm
+++ b/gfx/pics/unown_pic_pointers.asm
@@ -1,54 +1,54 @@
 UnownPicPointers::
 ; entries correspond to Unown letters, two apiece
-	add_pic UnownAFrontpic
-	add_pic UnownABackpic
-	add_pic UnownBFrontpic
-	add_pic UnownBBackpic
-	add_pic UnownCFrontpic
-	add_pic UnownCBackpic
-	add_pic UnownDFrontpic
-	add_pic UnownDBackpic
-	add_pic UnownEFrontpic
-	add_pic UnownEBackpic
-	add_pic UnownFFrontpic
-	add_pic UnownFBackpic
-	add_pic UnownGFrontpic
-	add_pic UnownGBackpic
-	add_pic UnownHFrontpic
-	add_pic UnownHBackpic
-	add_pic UnownIFrontpic
-	add_pic UnownIBackpic
-	add_pic UnownJFrontpic
-	add_pic UnownJBackpic
-	add_pic UnownKFrontpic
-	add_pic UnownKBackpic
-	add_pic UnownLFrontpic
-	add_pic UnownLBackpic
-	add_pic UnownMFrontpic
-	add_pic UnownMBackpic
-	add_pic UnownNFrontpic
-	add_pic UnownNBackpic
-	add_pic UnownOFrontpic
-	add_pic UnownOBackpic
-	add_pic UnownPFrontpic
-	add_pic UnownPBackpic
-	add_pic UnownQFrontpic
-	add_pic UnownQBackpic
-	add_pic UnownRFrontpic
-	add_pic UnownRBackpic
-	add_pic UnownSFrontpic
-	add_pic UnownSBackpic
-	add_pic UnownTFrontpic
-	add_pic UnownTBackpic
-	add_pic UnownUFrontpic
-	add_pic UnownUBackpic
-	add_pic UnownVFrontpic
-	add_pic UnownVBackpic
-	add_pic UnownWFrontpic
-	add_pic UnownWBackpic
-	add_pic UnownXFrontpic
-	add_pic UnownXBackpic
-	add_pic UnownYFrontpic
-	add_pic UnownYBackpic
-	add_pic UnownZFrontpic
-	add_pic UnownZBackpic
+	dba_pic UnownAFrontpic
+	dba_pic UnownABackpic
+	dba_pic UnownBFrontpic
+	dba_pic UnownBBackpic
+	dba_pic UnownCFrontpic
+	dba_pic UnownCBackpic
+	dba_pic UnownDFrontpic
+	dba_pic UnownDBackpic
+	dba_pic UnownEFrontpic
+	dba_pic UnownEBackpic
+	dba_pic UnownFFrontpic
+	dba_pic UnownFBackpic
+	dba_pic UnownGFrontpic
+	dba_pic UnownGBackpic
+	dba_pic UnownHFrontpic
+	dba_pic UnownHBackpic
+	dba_pic UnownIFrontpic
+	dba_pic UnownIBackpic
+	dba_pic UnownJFrontpic
+	dba_pic UnownJBackpic
+	dba_pic UnownKFrontpic
+	dba_pic UnownKBackpic
+	dba_pic UnownLFrontpic
+	dba_pic UnownLBackpic
+	dba_pic UnownMFrontpic
+	dba_pic UnownMBackpic
+	dba_pic UnownNFrontpic
+	dba_pic UnownNBackpic
+	dba_pic UnownOFrontpic
+	dba_pic UnownOBackpic
+	dba_pic UnownPFrontpic
+	dba_pic UnownPBackpic
+	dba_pic UnownQFrontpic
+	dba_pic UnownQBackpic
+	dba_pic UnownRFrontpic
+	dba_pic UnownRBackpic
+	dba_pic UnownSFrontpic
+	dba_pic UnownSBackpic
+	dba_pic UnownTFrontpic
+	dba_pic UnownTBackpic
+	dba_pic UnownUFrontpic
+	dba_pic UnownUBackpic
+	dba_pic UnownVFrontpic
+	dba_pic UnownVBackpic
+	dba_pic UnownWFrontpic
+	dba_pic UnownWBackpic
+	dba_pic UnownXFrontpic
+	dba_pic UnownXBackpic
+	dba_pic UnownYFrontpic
+	dba_pic UnownYBackpic
+	dba_pic UnownZFrontpic
+	dba_pic UnownZBackpic
--- a/gfx/trainer_pic_pointers.asm
+++ b/gfx/trainer_pic_pointers.asm
@@ -1,69 +1,69 @@
 TrainerPicPointers::
 ; entries correspond to trainer classes (see constants/trainer_constants.asm)
-	add_pic FalknerPic
-	add_pic WhitneyPic
-	add_pic BugsyPic
-	add_pic MortyPic
-	add_pic PrycePic
-	add_pic JasminePic
-	add_pic ChuckPic
-	add_pic ClairPic
-	add_pic Rival1Pic
-	add_pic PokemonProfPic
-	add_pic WillPic
-	add_pic CalPic
-	add_pic BrunoPic
-	add_pic KarenPic
-	add_pic KogaPic
-	add_pic ChampionPic
-	add_pic BrockPic
-	add_pic MistyPic
-	add_pic LtSurgePic
-	add_pic ScientistPic
-	add_pic ErikaPic
-	add_pic YoungsterPic
-	add_pic SchoolboyPic
-	add_pic BirdKeeperPic
-	add_pic LassPic
-	add_pic JaninePic
-	add_pic CooltrainermPic
-	add_pic CooltrainerfPic
-	add_pic BeautyPic
-	add_pic PokemaniacPic
-	add_pic GruntmPic
-	add_pic GentlemanPic
-	add_pic SkierPic
-	add_pic TeacherPic
-	add_pic SabrinaPic
-	add_pic BugCatcherPic
-	add_pic FisherPic
-	add_pic SwimmermPic
-	add_pic SwimmerfPic
-	add_pic SailorPic
-	add_pic SuperNerdPic
-	add_pic Rival2Pic
-	add_pic GuitaristPic
-	add_pic HikerPic
-	add_pic BikerPic
-	add_pic BlainePic
-	add_pic BurglarPic
-	add_pic FirebreatherPic
-	add_pic JugglerPic
-	add_pic BlackbeltTPic
-	add_pic ExecutivemPic
-	add_pic PsychicTPic
-	add_pic PicnickerPic
-	add_pic CamperPic
-	add_pic ExecutivefPic
-	add_pic SagePic
-	add_pic MediumPic
-	add_pic BoarderPic
-	add_pic PokefanmPic
-	add_pic KimonoGirlPic
-	add_pic TwinsPic
-	add_pic PokefanfPic
-	add_pic RedPic
-	add_pic BluePic
-	add_pic OfficerPic
-	add_pic GruntfPic
-	add_pic MysticalmanPic
+	dba_pic FalknerPic
+	dba_pic WhitneyPic
+	dba_pic BugsyPic
+	dba_pic MortyPic
+	dba_pic PrycePic
+	dba_pic JasminePic
+	dba_pic ChuckPic
+	dba_pic ClairPic
+	dba_pic Rival1Pic
+	dba_pic PokemonProfPic
+	dba_pic WillPic
+	dba_pic CalPic
+	dba_pic BrunoPic
+	dba_pic KarenPic
+	dba_pic KogaPic
+	dba_pic ChampionPic
+	dba_pic BrockPic
+	dba_pic MistyPic
+	dba_pic LtSurgePic
+	dba_pic ScientistPic
+	dba_pic ErikaPic
+	dba_pic YoungsterPic
+	dba_pic SchoolboyPic
+	dba_pic BirdKeeperPic
+	dba_pic LassPic
+	dba_pic JaninePic
+	dba_pic CooltrainermPic
+	dba_pic CooltrainerfPic
+	dba_pic BeautyPic
+	dba_pic PokemaniacPic
+	dba_pic GruntmPic
+	dba_pic GentlemanPic
+	dba_pic SkierPic
+	dba_pic TeacherPic
+	dba_pic SabrinaPic
+	dba_pic BugCatcherPic
+	dba_pic FisherPic
+	dba_pic SwimmermPic
+	dba_pic SwimmerfPic
+	dba_pic SailorPic
+	dba_pic SuperNerdPic
+	dba_pic Rival2Pic
+	dba_pic GuitaristPic
+	dba_pic HikerPic
+	dba_pic BikerPic
+	dba_pic BlainePic
+	dba_pic BurglarPic
+	dba_pic FirebreatherPic
+	dba_pic JugglerPic
+	dba_pic BlackbeltTPic
+	dba_pic ExecutivemPic
+	dba_pic PsychicTPic
+	dba_pic PicnickerPic
+	dba_pic CamperPic
+	dba_pic ExecutivefPic
+	dba_pic SagePic
+	dba_pic MediumPic
+	dba_pic BoarderPic
+	dba_pic PokefanmPic
+	dba_pic KimonoGirlPic
+	dba_pic TwinsPic
+	dba_pic PokefanfPic
+	dba_pic RedPic
+	dba_pic BluePic
+	dba_pic OfficerPic
+	dba_pic GruntfPic
+	dba_pic MysticalmanPic
--- a/home.asm
+++ b/home.asm
@@ -1035,13 +1035,8 @@
 	ret
 ; 34e7
 
-IsHMMove:: ; 34e7
-	ld hl, HMMoves
-	ld de, 1
-	jp IsInArray
 
-
-INCLUDE "data/hm_moves.asm"
+INCLUDE "home/hm_moves.asm"
 
 
 GetMoveName:: ; 34f8
--- /dev/null
+++ b/home/hm_moves.asm
@@ -1,0 +1,17 @@
+;  HM moves can't be forgotten
+
+IsHMMove:: ; 34e7
+	ld hl, .HMMoves
+	ld de, 1
+	jp IsInArray
+
+.HMMoves: ; 34f0
+	db CUT
+	db FLY
+	db SURF
+	db STRENGTH
+	db FLASH
+	db WATERFALL
+	db WHIRLPOOL
+	db -1 ; end
+; 34f8
--- a/home/text.asm
+++ b/home/text.asm
@@ -8,9 +8,6 @@
 TEXTBOX_Y      EQU SCREEN_HEIGHT - TEXTBOX_HEIGHT
 TEXTBOX_INNERY EQU TEXTBOX_Y + 2
 
-TEXTBOX_PAL EQU 7
-
-
 ClearBox:: ; fb6
 ; Fill a c*b box at hl with blank tiles.
 
@@ -51,7 +48,7 @@
 
 
 ClearScreen:: ; fdb
-	ld a, TEXTBOX_PAL
+	ld a, PAL_BG_TEXT
 	hlcoord 0, 0, AttrMap
 	ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
 	call ByteFill
@@ -133,7 +130,7 @@
 	inc b
 	inc c
 	inc c
-	ld a, TEXTBOX_PAL
+	ld a, PAL_BG_TEXT
 .col
 	push bc
 	push hl
--- a/home/time.asm
+++ b/home/time.asm
@@ -49,19 +49,16 @@
 	ld [hl], RTC_S
 	ld a, [de]
 	maskbits 60
-	and x
 	ld [hRTCSeconds], a
 
 	ld [hl], RTC_M
 	ld a, [de]
 	maskbits 60
-	and x
 	ld [hRTCMinutes], a
 
 	ld [hl], RTC_H
 	ld a, [de]
 	maskbits 24
-	and x
 	ld [hRTCHours], a
 
 	ld [hl], RTC_DL
--- a/macros.asm
+++ b/macros.asm
@@ -1,320 +1,25 @@
 INCLUDE "macros/enum.asm"
-INCLUDE "macros/basestats.asm"
-INCLUDE "macros/event.asm"
-INCLUDE "macros/sound.asm"
-INCLUDE "macros/text.asm"
 INCLUDE "macros/charmap.asm"
-INCLUDE "macros/move_anim.asm"
-INCLUDE "macros/movement.asm"
-INCLUDE "macros/map.asm"
-INCLUDE "macros/pic.asm"
 INCLUDE "macros/predef.asm"
 INCLUDE "macros/rst.asm"
-INCLUDE "macros/mobile.asm"
-INCLUDE "macros/trainer.asm"
-INCLUDE "macros/trade_anim.asm"
+INCLUDE "macros/data.asm"
+INCLUDE "macros/code.asm"
+INCLUDE "macros/coords.asm"
+INCLUDE "macros/color.asm"
+INCLUDE "macros/basestats.asm"
 INCLUDE "macros/tilesets.asm"
 
-RGB: MACRO
-rept _NARG / 3
-	dw ((\3) << 10) + ((\2) << 5) + (\1)
-	shift
-	shift
-	shift
-endr
-	ENDM
+INCLUDE "macros/scripts/audio.asm"
+INCLUDE "macros/scripts/maps.asm"
+INCLUDE "macros/scripts/event.asm"
+INCLUDE "macros/scripts/text.asm"
+INCLUDE "macros/scripts/movement.asm"
+INCLUDE "macros/scripts/move_anim.asm"
+INCLUDE "macros/scripts/trade_anim.asm"
+INCLUDE "macros/scripts/gfx_anim.asm"
 
 
 percent EQUS "* $ff / 100"
 
-
-dwb: MACRO
-	dw \1
-	db \2
-	ENDM
-
-dbw: MACRO
-	db \1
-	dw \2
-	ENDM
-
-dbbw: MACRO
-	db \1, \2
-	dw \3
-	ENDM
-
-dbww: MACRO
-	db \1
-	dw \2, \3
-	ENDM
-
-dbwww: MACRO
-	db \1
-	dw \2, \3, \4
-	ENDM
-
-dn: MACRO
-	rept _NARG / 2
-	db (\1) << 4 + (\2)
-	shift
-	shift
-	endr
-	ENDM
-
-dx: MACRO
-x = 8 * ((\1) - 1)
-	rept \1
-	db ((\2) >> x) & $ff
-x = x + -8
-	endr
-	ENDM
-
-dt: MACRO ; three-byte (big-endian)
-	dx 3, \1
-	ENDM
-
-dd: MACRO ; four-byte (big-endian)
-	dx 4, \1
-	ENDM
-
-bigdw: MACRO ; big-endian word
-	dx 2, \1
-	ENDM
-
-dba: MACRO ; dbw bank, address
-	rept _NARG
-	dbw BANK(\1), \1
-	shift
-	endr
-	ENDM
-
-dab: MACRO ; dwb address, bank
-	rept _NARG
-	dwb \1, BANK(\1)
-	shift
-	endr
-	ENDM
-
-lb: MACRO ; r, hi, lo
-	ld \1, (\2 & $ff) << 8 + (\3 & $ff)
-	ENDM
-
-ln: MACRO ; r, hi, lo
-	ld \1, (\2 & $f) << 4 + (\3 & $f)
-	ENDM
-
-bccoord equs "coord bc,"
-decoord equs "coord de,"
-hlcoord equs "coord hl,"
-
-coord: MACRO
-; register, x, y[, origin]
-	if _NARG < 4
-	ld \1, TileMap + SCREEN_WIDTH * (\3) + (\2)
-	else
-	ld \1, \4 + SCREEN_WIDTH * (\3) + (\2)
-	endc
-	ENDM
-
-dwcoord: MACRO
-	rept _NARG / 2
-	dw TileMap + SCREEN_WIDTH * (\2) + (\1)
-	shift
-	shift
-	endr
-	ENDM
-
-ldcoord_a: MACRO
-	if _NARG < 3
-	ld [TileMap + SCREEN_WIDTH * (\2) + (\1)], a
-	else
-	ld [\3 + SCREEN_WIDTH * (\2) + (\1)], a
-	endc
-	ENDM
-
-lda_coord: MACRO
-	if _NARG < 3
-	ld a, [TileMap + SCREEN_WIDTH * (\2) + (\1)]
-	else
-	ld a, [\3 + SCREEN_WIDTH * (\2) + (\1)]
-	endc
-	ENDM
-
-; pic animations
-frame: MACRO
-	db \1
-x = \2
-IF _NARG > 2
-rept _NARG +- 2
-x = x | (1 << (\3 + 1))
-	shift
-endr
-endc
-	db x
-	ENDM
-setrepeat: MACRO
-	db $fe
-	db \1
-	ENDM
-dorepeat: MACRO
-	db $fd
-	db \1
-	ENDM
-endanim: MACRO
-	db $ff
-	ENDM
-
-
-delanim: MACRO
-	db $fc
-	ENDM
-dorestart: MACRO
-	db $fe
-	ENDM
-
-sine_wave: MACRO
-; \1: amplitude
-
-x = 0
-	rept $20
-	; Round up.
-	dw (sin(x) + (sin(x) & $ff)) >> 8
-x = x + (\1) * $40000
-	endr
-ENDM
-
-
-bcd: MACRO
-	rept _NARG
-	dn ((\1) % 100) / 10, (\1) % 10
-	shift
-	endr
-ENDM
-
 tiles EQUS "* $10"
-tile EQUS "+ $10 *"
-
-partymon: MACRO
-	db \1
-	db \2
-	db \3, \4, \5, \6
-	dw \7
-	dt \8
-rept 8
-	shift
-endr
-rept 5
-	bigdw \1
-	shift
-endr
-	db \1, \2
-	db \3, \4, \5, \6
-rept 6
-	shift
-endr
-	db \1
-	db \2, \3, \4
-	db \5
-	db \6, \7
-rept 7
-	shift
-endr
-rept 7
-	bigdw \1
-	shift
-endr
-	db \1
-ENDM
-
-palettes EQUS "* 8"
-palette EQUS "+ 8 *"
-
-ldpixel: MACRO
-if _NARG >= 5
-	lb \1, \2 * 8 + \4, \3 * 8 + \5
-else
-	lb \1, \2 * 8, \3 * 8
-endc
-endm
-
-depixel EQUS "ldpixel de,"
-bcpixel EQUS "ldpixel bc,"
-
-dbpixel: MACRO
-if _NARG >= 4
-	db \1 * 8 + \3, \2 * 8 + \4
-else
-	db \1 * 8, \2 * 8
-endc
-endm
-
-bgcoord: MACRO
-IF _NARG >= 4
-	ld \1, \3 * $20 + \2 + \4
-ELSE
-	ld \1, \3 * $20 + \2 + VBGMap0
-ENDC
-ENDM
-
-hlbgcoord EQUS "bgcoord hl,"
-debgcoord EQUS "bgcoord de,"
-bcbgcoord EQUS "bgcoord bc,"
-bgrows EQUS "* $20"
-
-palred EQUS "$0001 *"
-palgreen EQUS "$0020 *"
-palblue EQUS "$0400 *"
-
-dsprite: MACRO
-; conditional segment is there because not every instance of
-; this macro is directly OAM
-if _NARG >= 7 ; y tile, y pxl, x tile, x pxl, vtile offset, flags, palette
-	db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, (\6 << 3) + (\7 & 7)
-else
-	db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, \6
-endc
-endm
-
-jumptable: MACRO
-	ld a, [\2]
-	ld e, a
-	ld d, 0
-	ld hl, \1
-	add hl, de
-	add hl, de
-	ld a, [hli]
-	ld h, [hl]
-	ld l, a
-	jp hl
-endm
-
-maskbits: macro
-; returns to x
-; usage in rejection sampling
-; .loop
-; 	call Random
-; 	maskbits 30
-; 	and x
-; 	cp 30
-; 	jr nc, .loop
-
-x = 1
-rept 8
-IF \1 > x
-x = (x + 1) * 2 +- 1
-ENDC
-endr
-endm
-
-homecall: MACRO
-	ld a, [hROMBank]
-	push af
-	ld a, BANK(\1)
-	rst Bankswitch
-
-	call \1
-
-	pop af
-	rst Bankswitch
-ENDM
-
+tile  EQUS "+ $10 *"
--- a/macros/basestats.asm
+++ b/macros/basestats.asm
@@ -1,3 +1,5 @@
+; Used in data/base_stats/*.asm
+
 define: macro
 if !def(\1)
 \1 equs \2
--- /dev/null
+++ b/macros/code.asm
@@ -1,0 +1,55 @@
+; Syntactic sugar macros
+
+lb: MACRO ; r, hi, lo
+	ld \1, (\2 & $ff) << 8 + (\3 & $ff)
+	ENDM
+
+ln: MACRO ; r, hi, lo
+	ld \1, (\2 & $f) << 4 + (\3 & $f)
+	ENDM
+
+ldpixel: MACRO
+if _NARG >= 5
+	lb \1, \2 * 8 + \4, \3 * 8 + \5
+else
+	lb \1, \2 * 8, \3 * 8
+endc
+endm
+
+depixel EQUS "ldpixel de,"
+bcpixel EQUS "ldpixel bc,"
+
+
+; Design patterns
+
+jumptable: MACRO
+	ld a, [\2]
+	ld e, a
+	ld d, 0
+	ld hl, \1
+	add hl, de
+	add hl, de
+	ld a, [hli]
+	ld h, [hl]
+	ld l, a
+	jp hl
+endm
+
+; Many mobile functions were dummied out in localization.
+mobile EQUS "ret"
+
+maskbits: macro
+; example usage in rejection sampling:
+; .loop
+; 	call Random
+; 	maskbits 30
+; 	cp 30
+; 	jr nc, .loop
+x = 1
+rept 8
+IF \1 > x
+x = (x + 1) * 2 +- 1
+ENDC
+endr
+	and x
+endm
--- /dev/null
+++ b/macros/color.asm
@@ -1,0 +1,15 @@
+RGB: MACRO
+rept _NARG / 3
+	dw ((\3) << 10) + ((\2) << 5) + (\1)
+	shift
+	shift
+	shift
+endr
+ENDM
+
+palettes EQUS "* 8"
+palette  EQUS "+ 8 *"
+
+palred   EQUS "$0001 *"
+palgreen EQUS "$0020 *"
+palblue  EQUS "$0400 *"
--- /dev/null
+++ b/macros/coords.asm
@@ -1,0 +1,51 @@
+bccoord equs "coord bc,"
+decoord equs "coord de,"
+hlcoord equs "coord hl,"
+
+coord: MACRO
+; register, x, y[, origin]
+	if _NARG < 4
+	ld \1, TileMap + SCREEN_WIDTH * (\3) + (\2)
+	else
+	ld \1, \4 + SCREEN_WIDTH * (\3) + (\2)
+	endc
+	ENDM
+
+dwcoord: MACRO
+	rept _NARG / 2
+	dw TileMap + SCREEN_WIDTH * (\2) + (\1)
+	shift
+	shift
+	endr
+	ENDM
+
+ldcoord_a: MACRO
+	if _NARG < 3
+	ld [TileMap + SCREEN_WIDTH * (\2) + (\1)], a
+	else
+	ld [\3 + SCREEN_WIDTH * (\2) + (\1)], a
+	endc
+	ENDM
+
+lda_coord: MACRO
+	if _NARG < 3
+	ld a, [TileMap + SCREEN_WIDTH * (\2) + (\1)]
+	else
+	ld a, [\3 + SCREEN_WIDTH * (\2) + (\1)]
+	endc
+	ENDM
+
+
+bgrows EQUS "* $20" ; SCREEN_WIDTH
+
+hlbgcoord EQUS "bgcoord hl,"
+debgcoord EQUS "bgcoord de,"
+bcbgcoord EQUS "bgcoord bc,"
+
+bgcoord: MACRO
+IF _NARG >= 4
+	ld \1, \3 bgrows + \2 + \4
+ELSE
+	ld \1, \3 bgrows + \2 + VBGMap0
+ENDC
+ENDM
--- /dev/null
+++ b/macros/data.asm
@@ -1,0 +1,121 @@
+; Constant data (db, dw, dl) macros
+
+dwb: MACRO
+	dw \1
+	db \2
+	ENDM
+
+dbw: MACRO
+	db \1
+	dw \2
+	ENDM
+
+dbbw: MACRO
+	db \1, \2
+	dw \3
+	ENDM
+
+dbww: MACRO
+	db \1
+	dw \2, \3
+	ENDM
+
+dbwww: MACRO
+	db \1
+	dw \2, \3, \4
+	ENDM
+
+dn: MACRO ; nybbles
+	rept _NARG / 2
+	db ((\1) << 4) | (\2)
+	shift
+	shift
+	endr
+	ENDM
+
+dc: MACRO ; "crumbs"
+	rept _NARG / 4
+	db ((\1) << 6) | ((\2) << 4) | ((\3) << 2) | (\4)
+	shift
+	shift
+	shift
+	shift
+	endr
+	ENDM
+
+dx: MACRO
+x = 8 * ((\1) - 1)
+	rept \1
+	db ((\2) >> x) & $ff
+x = x + -8
+	endr
+	ENDM
+
+dt: MACRO ; three-byte (big-endian)
+	dx 3, \1
+	ENDM
+
+dd: MACRO ; four-byte (big-endian)
+	dx 4, \1
+	ENDM
+
+bigdw: MACRO ; big-endian word
+	dx 2, \1
+	ENDM
+
+dba: MACRO ; dbw bank, address
+	rept _NARG
+	dbw BANK(\1), \1
+	shift
+	endr
+	ENDM
+
+dab: MACRO ; dwb address, bank
+	rept _NARG
+	dwb \1, BANK(\1)
+	shift
+	endr
+	ENDM
+
+dba_pic: MACRO ; dbw bank, address
+	db BANK(\1) - PICS_FIX
+	dw \1
+ENDM
+
+
+dbpixel: MACRO
+if _NARG >= 4
+	db \1 * 8 + \3, \2 * 8 + \4
+else
+	db \1 * 8, \2 * 8
+endc
+endm
+
+dsprite: MACRO
+; conditional segment is there because not every instance of
+; this macro is directly OAM
+if _NARG >= 7 ; y tile, y pxl, x tile, x pxl, vtile offset, flags, palette
+	db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, (\6 << 3) + (\7 & 7)
+else
+	db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, \6
+endc
+endm
+
+
+sine_wave: MACRO
+; \1: amplitude
+x = 0
+	rept $20
+	; Round up.
+	dw (sin(x) + (sin(x) & $ff)) >> 8
+x = x + (\1) * $40000
+	endr
+ENDM
+
+
+bcd: MACRO
+	rept _NARG
+	dn ((\1) % 100) / 10, (\1) % 10
+	shift
+	endr
+ENDM
--- a/macros/event.asm
+++ /dev/null
@@ -1,1069 +1,0 @@
-; ScriptCommandTable indexes (see engine/scripting.asm)
-	enum_start
-
-	enum scall_command
-scall: macro
-	db scall_command
-	dw \1 ; pointer
-	endm
-
-	enum farscall_command
-farscall: macro
-	db farscall_command
-	dba \1
-	endm
-
-	enum ptcall_command
-ptcall: macro
-	db ptcall_command
-	dw \1 ; pointer
-	endm
-
-	enum jump_command
-jump: macro
-	db jump_command
-	dw \1 ; pointer
-	endm
-
-	enum farjump_command
-farjump: macro
-	db farjump_command
-	dba \1
-	endm
-
-	enum ptjump_command
-ptjump: macro
-	db ptjump_command
-	dw \1 ; pointer
-	endm
-
-	enum if_equal_command
-if_equal: macro
-	db if_equal_command
-	db \1 ; byte
-	dw \2 ; pointer
-	endm
-
-	enum if_not_equal_command
-if_not_equal: macro
-	db if_not_equal_command
-	db \1 ; byte
-	dw \2 ; pointer
-	endm
-
-	enum iffalse_command
-iffalse: macro
-	db iffalse_command
-	dw \1 ; pointer
-	endm
-
-	enum iftrue_command
-iftrue: macro
-	db iftrue_command
-	dw \1 ; pointer
-	endm
-
-	enum if_greater_than_command
-if_greater_than: macro
-	db if_greater_than_command
-	db \1 ; byte
-	dw \2 ; pointer
-	endm
-
-	enum if_less_than_command
-if_less_than: macro
-	db if_less_than_command
-	db \1 ; byte
-	dw \2 ; pointer
-	endm
-
-	enum jumpstd_command
-jumpstd: macro
-	db jumpstd_command
-	dw \1 ; predefined_script
-	endm
-
-	enum callstd_command
-callstd: macro
-	db callstd_command
-	dw \1 ; predefined_script
-	endm
-
-	enum callasm_command
-callasm: macro
-	db callasm_command
-	dba \1
-	endm
-
-	enum special_command
-special: macro
-	db special_command
-	dw (\1Special - SpecialsPointers) / 3
-	endm
-
-add_special: MACRO
-\1Special::
-	dba \1
-ENDM
-
-	enum ptcallasm_command
-ptcallasm: macro
-	db ptcallasm_command
-	dw \1 ; asm
-	endm
-
-	enum checkmaptriggers_command
-checkmaptriggers: macro
-	db checkmaptriggers_command
-	map \1 ; map
-	endm
-
-	enum domaptrigger_command
-domaptrigger: macro
-	db domaptrigger_command
-	map \1 ; map
-	db \2 ; trigger_id
-	endm
-
-	enum checktriggers_command
-checktriggers: macro
-	db checktriggers_command
-	endm
-
-	enum dotrigger_command
-dotrigger: macro
-	db dotrigger_command
-	db \1 ; trigger_id
-	endm
-
-	enum writebyte_command
-writebyte: macro
-	db writebyte_command
-	db \1 ; value
-	endm
-
-	enum addvar_command
-addvar: macro
-	db addvar_command
-	db \1 ; value
-	endm
-
-	enum random_command
-random: macro
-	db random_command
-	db \1 ; input
-	endm
-
-	enum checkver_command
-checkver: macro
-	db checkver_command
-	endm
-
-	enum copybytetovar_command
-copybytetovar: macro
-	db copybytetovar_command
-	dw \1 ; address
-	endm
-
-	enum copyvartobyte_command
-copyvartobyte: macro
-	db copyvartobyte_command
-	dw \1 ; address
-	endm
-
-	enum loadvar_command
-loadvar: macro
-	db loadvar_command
-	dw \1 ; address
-	db \2 ; value
-	endm
-
-	enum checkcode_command
-checkcode: macro
-	db checkcode_command
-	db \1 ; variable_id
-	endm
-
-	enum writevarcode_command
-writevarcode: macro
-	db writevarcode_command
-	db \1 ; variable_id
-	endm
-
-	enum writecode_command
-writecode: macro
-	db writecode_command
-	db \1 ; variable_id
-	db \2 ; value
-	endm
-
-	enum giveitem_command
-giveitem: macro
-	db giveitem_command
-	db \1 ; item
-if _NARG == 2
-	db \2 ; quantity
-else
-	db 1
-endc
-	endm
-
-	enum takeitem_command
-takeitem: macro
-	db takeitem_command
-	db \1 ; item
-if _NARG == 2
-	db \2 ; quantity
-else
-	db 1
-endc
-	endm
-
-	enum checkitem_command
-checkitem: macro
-	db checkitem_command
-	db \1 ; item
-	endm
-
-	enum givemoney_command
-givemoney: macro
-	db givemoney_command
-	db \1 ; account
-	dt \2 ; money
-	endm
-
-	enum takemoney_command
-takemoney: macro
-	db takemoney_command
-	db \1 ; account
-	dt \2 ; money
-	endm
-
-	enum checkmoney_command
-checkmoney: macro
-	db checkmoney_command
-	db \1 ; account
-	dt \2 ; money
-	endm
-
-	enum givecoins_command
-givecoins: macro
-	db givecoins_command
-	dw \1 ; coins
-	endm
-
-	enum takecoins_command
-takecoins: macro
-	db takecoins_command
-	dw \1 ; coins
-	endm
-
-	enum checkcoins_command
-checkcoins: macro
-	db checkcoins_command
-	dw \1 ; coins
-	endm
-
-	enum addcellnum_command
-addcellnum: macro
-	db addcellnum_command
-	db \1 ; person
-	endm
-
-	enum delcellnum_command
-delcellnum: macro
-	db delcellnum_command
-	db \1 ; person
-	endm
-
-	enum checkcellnum_command
-checkcellnum: macro
-	db checkcellnum_command
-	db \1 ; person
-	endm
-
-	enum checktime_command
-checktime: macro
-	db checktime_command
-	db \1 ; time
-	endm
-
-checkmorn EQUS "checktime MORN"
-checkday  EQUS "checktime DAY"
-checknite EQUS "checktime NITE"
-
-	enum checkpoke_command
-checkpoke: macro
-	db checkpoke_command
-	db \1 ; pkmn
-	endm
-
-	enum givepoke_command
-givepoke: macro
-	db givepoke_command
-	db \1 ; pokemon
-	db \2 ; level
-	if _NARG >= 3
-	db \3 ; item
-	if _NARG >= 4
-	db \4 ; trainer
-	if \4
-	dw \5 ; trainer_name_pointer
-	dw \6 ; pkmn_nickname
-	endc
-	else
-	db 0
-	endc
-	else
-	db 0, 0
-	endc
-	endm
-
-	enum giveegg_command
-giveegg: macro
-	db giveegg_command
-	db \1 ; pkmn
-	db \2 ; level
-	endm
-
-	enum givepokeitem_command
-givepokeitem: macro
-	db givepokeitem_command
-	dw \1 ; pointer
-	endm
-
-	enum checkpokeitem_command
-checkpokeitem: macro
-	db checkpokeitem_command
-	dw \1 ; pointer
-	endm
-
-	enum checkevent_command
-checkevent: macro
-	db checkevent_command
-	dw \1 ; event_flag
-	endm
-
-	enum clearevent_command
-clearevent: macro
-	db clearevent_command
-	dw \1 ; event_flag
-	endm
-
-	enum setevent_command
-setevent: macro
-	db setevent_command
-	dw \1 ; event_flag
-	endm
-
-	enum checkflag_command
-checkflag: macro
-	db checkflag_command
-	dw \1 ; engine_flag
-	endm
-
-	enum clearflag_command
-clearflag: macro
-	db clearflag_command
-	dw \1 ; engine_flag
-	endm
-
-	enum setflag_command
-setflag: macro
-	db setflag_command
-	dw \1 ; engine_flag
-	endm
-
-	enum wildon_command
-wildon: macro
-	db wildon_command
-	endm
-
-	enum wildoff_command
-wildoff: macro
-	db wildoff_command
-	endm
-
-	enum xycompare_command
-xycompare: macro
-	db xycompare_command
-	dw \1 ; pointer
-	endm
-
-	enum warpmod_command
-warpmod: macro
-	db warpmod_command
-	db \1 ; warp_id
-	map \2 ; map
-	endm
-
-	enum blackoutmod_command
-blackoutmod: macro
-	db blackoutmod_command
-	map \1 ; map
-	endm
-
-	enum warp_command
-warp: macro
-	db warp_command
-	map \1 ; map
-	db \2 ; x
-	db \3 ; y
-	endm
-
-	enum readmoney_command
-readmoney: macro
-	db readmoney_command
-	db \1 ; account
-	db \2 ; memory
-	endm
-
-	enum readcoins_command
-readcoins: macro
-	db readcoins_command
-	db \1 ; memory
-	endm
-
-	enum RAM2MEM_command
-RAM2MEM: macro
-	db RAM2MEM_command
-	db \1 ; memory
-	endm
-
-	enum pokenamemem_command
-pokenamemem: macro
-	db pokenamemem_command
-	db \1 ; pokemon
-	db \2 ; memory
-	endm
-
-	enum itemtotext_command
-itemtotext: macro
-	db itemtotext_command
-	db \1 ; item
-	db \2 ; memory
-	endm
-
-	enum mapnametotext_command
-mapnametotext: macro
-	db mapnametotext_command
-	db \1 ; memory
-	endm
-
-	enum trainertotext_command
-trainertotext: macro
-	db trainertotext_command
-	db \1 ; trainer_id
-	db \2 ; trainer_group
-	db \3 ; memory
-	endm
-
-	enum stringtotext_command
-stringtotext: macro
-	db stringtotext_command
-	dw \1 ; text_pointer
-	db \2 ; memory
-	endm
-
-	enum itemnotify_command
-itemnotify: macro
-	db itemnotify_command
-	endm
-
-	enum pocketisfull_command
-pocketisfull: macro
-	db pocketisfull_command
-	endm
-
-	enum opentext_command
-opentext: macro
-	db opentext_command
-	endm
-
-	enum refreshscreen_command
-refreshscreen: macro
-	db refreshscreen_command
-	db \1 ; dummy
-	endm
-
-	enum closetext_command
-closetext: macro
-	db closetext_command
-	endm
-
-	enum loadbytec2cf_command
-loadbytec2cf: macro
-	db loadbytec2cf_command
-	db \1 ; byte
-	endm
-
-	enum farwritetext_command
-farwritetext: macro
-	db farwritetext_command
-	dba \1
-	endm
-
-	enum writetext_command
-writetext: macro
-	db writetext_command
-	dw \1 ; text_pointer
-	endm
-
-	enum repeattext_command
-repeattext: macro
-	db repeattext_command
-	db \1 ; byte
-	db \2 ; byte
-	endm
-
-	enum yesorno_command
-yesorno: macro
-	db yesorno_command
-	endm
-
-	enum loadmenudata_command
-loadmenudata: macro
-	db loadmenudata_command
-	dw \1 ; data
-	endm
-
-	enum closewindow_command
-closewindow: macro
-	db closewindow_command
-	endm
-
-	enum jumptextfaceplayer_command
-jumptextfaceplayer: macro
-	db jumptextfaceplayer_command
-	dw \1 ; text_pointer
-	endm
-
-; IF _CRYSTAL
-	enum farjumptext_command
-farjumptext: macro
-	db farjumptext_command
-	dba \1
-	endm
-; ENDC
-
-	enum jumptext_command
-jumptext: macro
-	db jumptext_command
-	dw \1 ; text_pointer
-	endm
-
-	enum waitbutton_command
-waitbutton: macro
-	db waitbutton_command
-	endm
-
-	enum buttonsound_command
-buttonsound: macro
-	db buttonsound_command
-	endm
-
-	enum pokepic_command
-pokepic: macro
-	db pokepic_command
-	db \1 ; pokemon
-	endm
-
-	enum closepokepic_command
-closepokepic: macro
-	db closepokepic_command
-	endm
-
-	enum _2dmenu_command
-_2dmenu: macro
-	db _2dmenu_command
-	endm
-
-	enum verticalmenu_command
-verticalmenu: macro
-	db verticalmenu_command
-	endm
-
-	enum loadpikachudata_command
-loadpikachudata: macro
-	db loadpikachudata_command
-	endm
-
-	enum randomwildmon_command
-randomwildmon: macro
-	db randomwildmon_command
-	endm
-
-	enum loadmemtrainer_command
-loadmemtrainer: macro
-	db loadmemtrainer_command
-	endm
-
-	enum loadwildmon_command
-loadwildmon: macro
-	db loadwildmon_command
-	db \1 ; pokemon
-	db \2 ; level
-	endm
-
-	enum loadtrainer_command
-loadtrainer: macro
-	db loadtrainer_command
-	db \1 ; trainer_group
-	db \2 ; trainer_id
-	endm
-
-	enum startbattle_command
-startbattle: macro
-	db startbattle_command
-	endm
-
-	enum reloadmapafterbattle_command
-reloadmapafterbattle: macro
-	db reloadmapafterbattle_command
-	endm
-
-	enum catchtutorial_command
-catchtutorial: macro
-	db catchtutorial_command
-	db \1 ; byte
-	endm
-
-	enum trainertext_command
-trainertext: macro
-	db trainertext_command
-	db \1 ; which_text
-	endm
-
-	enum trainerflagaction_command
-trainerflagaction: macro
-	db trainerflagaction_command
-	db \1 ; action
-	endm
-
-	enum winlosstext_command
-winlosstext: macro
-	db winlosstext_command
-	dw \1 ; win_text_pointer
-	dw \2 ; loss_text_pointer
-	endm
-
-	enum scripttalkafter_command
-scripttalkafter: macro
-	db scripttalkafter_command
-	endm
-
-	enum end_if_just_battled_command
-end_if_just_battled: macro
-	db end_if_just_battled_command
-	endm
-
-	enum check_just_battled_command
-check_just_battled: macro
-	db check_just_battled_command
-	endm
-
-	enum setlasttalked_command
-setlasttalked: macro
-	db setlasttalked_command
-	db \1 ; person
-	endm
-
-	enum applymovement_command
-applymovement: macro
-	db applymovement_command
-	db \1 ; person
-	dw \2 ; data
-	endm
-
-	enum applymovement2_command
-applymovement2: macro
-	db applymovement2_command
-	dw \1 ; data
-	endm
-
-	enum faceplayer_command
-faceplayer: macro
-	db faceplayer_command
-	endm
-
-	enum faceperson_command
-faceperson: macro
-	db faceperson_command
-	db \1 ; person1
-	db \2 ; person2
-	endm
-
-	enum variablesprite_command
-variablesprite: macro
-	db variablesprite_command
-	db \1 - SPRITE_VARS ; byte
-	db \2 ; sprite
-	endm
-
-	enum disappear_command
-disappear: macro
-	db disappear_command
-	db \1 ; person
-	endm
-
-	enum appear_command
-appear: macro
-	db appear_command
-	db \1 ; person
-	endm
-
-	enum follow_command
-follow: macro
-	db follow_command
-	db \1 ; person2
-	db \2 ; person1
-	endm
-
-	enum stopfollow_command
-stopfollow: macro
-	db stopfollow_command
-	endm
-
-	enum moveperson_command
-moveperson: macro
-	db moveperson_command
-	db \1 ; person
-	db \2 ; x
-	db \3 ; y
-	endm
-
-	enum writepersonxy_command
-writepersonxy: macro
-	db writepersonxy_command
-	db \1 ; person
-	endm
-
-	enum loademote_command
-loademote: macro
-	db loademote_command
-	db \1 ; bubble
-	endm
-
-	enum showemote_command
-showemote: macro
-	db showemote_command
-	db \1 ; bubble
-	db \2 ; person
-	db \3 ; time
-	endm
-
-	enum spriteface_command
-spriteface: macro
-	db spriteface_command
-	db \1 ; person
-	db \2 ; facing
-	endm
-
-	enum follownotexact_command
-follownotexact: macro
-	db follownotexact_command
-	db \1 ; person2
-	db \2 ; person1
-	endm
-
-	enum earthquake_command
-earthquake: macro
-	db earthquake_command
-	db \1 ; param
-	endm
-
-	enum changemap_command
-changemap: macro
-	db changemap_command
-	db \1 ; map_bank
-	dw \2 ; map_data_pointer
-	endm
-
-	enum changeblock_command
-changeblock: macro
-	db changeblock_command
-	db \1 ; x
-	db \2 ; y
-	db \3 ; block
-	endm
-
-	enum reloadmap_command
-reloadmap: macro
-	db reloadmap_command
-	endm
-
-	enum reloadmappart_command
-reloadmappart: macro
-	db reloadmappart_command
-	endm
-
-	enum writecmdqueue_command
-writecmdqueue: macro
-	db writecmdqueue_command
-	dw \1 ; queue_pointer
-	endm
-
-	enum delcmdqueue_command
-delcmdqueue: macro
-	db delcmdqueue_command
-	db \1 ; byte
-	endm
-
-	enum playmusic_command
-playmusic: macro
-	db playmusic_command
-	dw \1 ; music_pointer
-	endm
-
-	enum encountermusic_command
-encountermusic: macro
-	db encountermusic_command
-	endm
-
-	enum musicfadeout_command
-musicfadeout: macro
-	db musicfadeout_command
-	dw \1 ; music
-	db \2 ; fadetime
-	endm
-
-	enum playmapmusic_command
-playmapmusic: macro
-	db playmapmusic_command
-	endm
-
-	enum dontrestartmapmusic_command
-dontrestartmapmusic: macro
-	db dontrestartmapmusic_command
-	endm
-
-	enum cry_command
-cry: macro
-	db cry_command
-	dw \1 ; cry_id
-	endm
-
-	enum playsound_command
-playsound: macro
-	db playsound_command
-	dw \1 ; sound_pointer
-	endm
-
-	enum waitsfx_command
-waitsfx: macro
-	db waitsfx_command
-	endm
-
-	enum warpsound_command
-warpsound: macro
-	db warpsound_command
-	endm
-
-	enum specialsound_command
-specialsound: macro
-	db specialsound_command
-	endm
-
-	enum passtoengine_command
-passtoengine: macro
-	db passtoengine_command
-	db \1 ; data_pointer
-	endm
-
-	enum newloadmap_command
-newloadmap: macro
-	db newloadmap_command
-	db \1 ; which_method
-	endm
-
-	enum pause_command
-pause: macro
-	db pause_command
-	db \1 ; length
-	endm
-
-	enum deactivatefacing_command
-deactivatefacing: macro
-	db deactivatefacing_command
-	db \1 ; time
-	endm
-
-	enum priorityjump_command
-priorityjump: macro
-	db priorityjump_command
-	dw \1 ; pointer
-	endm
-
-	enum warpcheck_command
-warpcheck: macro
-	db warpcheck_command
-	endm
-
-	enum ptpriorityjump_command
-ptpriorityjump: macro
-	db ptpriorityjump_command
-	dw \1 ; pointer
-	endm
-
-	enum return_command
-return: macro
-	db return_command
-	endm
-
-	enum end_command
-end: macro
-	db end_command
-	endm
-
-	enum reloadandreturn_command
-reloadandreturn: macro
-	db reloadandreturn_command
-	db \1 ; which_method
-	endm
-
-	enum end_all_command
-end_all: macro
-	db end_all_command
-	endm
-
-	enum pokemart_command
-pokemart: macro
-	db pokemart_command
-	db \1 ; dialog_id
-	dw \2 ; mart_id
-	endm
-
-	enum elevator_command
-elevator: macro
-	db elevator_command
-	dw \1 ; floor_list_pointer
-	endm
-
-	enum trade_command
-trade: macro
-	db trade_command
-	db \1 ; trade_id
-	endm
-
-	enum askforphonenumber_command
-askforphonenumber: macro
-	db askforphonenumber_command
-	db \1 ; number
-	endm
-
-	enum phonecall_command
-phonecall: macro
-	db phonecall_command
-	dw \1 ; caller_name
-	endm
-
-	enum hangup_command
-hangup: macro
-	db hangup_command
-	endm
-
-	enum describedecoration_command
-describedecoration: macro
-	db describedecoration_command
-	db \1 ; byte
-	endm
-
-	enum fruittree_command
-fruittree: macro
-	db fruittree_command
-	db \1 ; tree_id
-	endm
-
-	enum specialphonecall_command
-specialphonecall: macro
-	db specialphonecall_command
-	dw \1 ; call_id
-	endm
-
-	enum checkphonecall_command
-checkphonecall: macro
-	db checkphonecall_command
-	endm
-
-	enum verbosegiveitem_command
-verbosegiveitem: macro
-	db verbosegiveitem_command
-	db \1 ; item
-if _NARG == 2
-	db \2 ; quantity
-else
-	db 1
-endc
-	endm
-
-	enum verbosegiveitem2_command
-verbosegiveitem2: macro
-	db verbosegiveitem2_command
-	db \1 ; item
-	db \2 ; var
-	endm
-
-	enum swarm_command
-swarm: macro
-	db swarm_command
-	db \1 ; flag
-	map \2 ; map
-	endm
-
-	enum halloffame_command
-halloffame: macro
-	db halloffame_command
-	endm
-
-	enum credits_command
-credits: macro
-	db credits_command
-	endm
-
-	enum warpfacing_command
-warpfacing: macro
-	db warpfacing_command
-	db \1 ; facing
-	map \2 ; map
-	db \3 ; x
-	db \4 ; y
-	endm
-
-	enum battletowertext_command
-battletowertext: macro
-	db battletowertext_command
-	db \1 ; memory
-	endm
-
-	enum landmarktotext_command
-landmarktotext: macro
-	db landmarktotext_command
-	db \1 ; id
-	db \2 ; memory
-	endm
-
-	enum trainerclassname_command
-trainerclassname: macro
-	db trainerclassname_command
-	db \1 ; id
-	db \2 ; memory
-	endm
-
-	enum name_command
-name: macro
-	db name_command
-	db \1 ; type
-	db \2 ; id
-	db \3 ; memory
-	endm
-
-	enum wait_command
-wait: macro
-	db wait_command
-	db \1 ; duration
-	endm
-
-	enum check_save_command
-check_save: macro
-	db check_save_command
-	endm
--- a/macros/map.asm
+++ /dev/null
@@ -1,211 +1,0 @@
-map: macro
-;\1: map id
-	db GROUP_\1, MAP_\1
-endm
-
-maptrigger: macro
-;\1: script pointer
-	dw \1, 0
-endm
-
-warp_def: macro
-;\1: y: top to bottom, starts at 0
-;\2: x: left to right, starts at 0
-;\3: warp destination: starts at 1
-;\4: map id: from constants/map_constants.asm
-	db \1, \2, \3
-	map \4
-endm
-
-xy_trigger: macro
-;\1: number: controlled by dotrigger/domaptrigger
-;\2: y: top to bottom, starts at 0
-;\3: x: left to right, starts at 0
-;\4: script pointer
-	db \1, \2, \3, $0
-	dw \4
-	db $0, $0
-endm
-
-signpost: macro
-;\1: y: top to bottom, starts at 0
-;\2: x: left to right, starts at 0
-;\3: function: a SIGNPOST_* constant
-;\4: script pointer
-	db \1, \2, \3
-	dw \4
-endm
-
-person_event: macro
-;\1: sprite: a SPRITE_* constant
-;\2: y: top to bottom, starts at 0
-;\3: x: left to right, starts at 0
-;\4: movement function: a SPRITEMOVEDATA_* constant
-;\5, \6: movement radius: y, x
-;\7: clock hour: ???
-;\8: clock daytime: sum of MORN, DAY, and/or NITE, or 0 for always
-;\9: color: a PAL_NPC_* constant, or 0 for sprite default
-;\10: function: a PERSONTYPE_* constant
-;\11: sight range: applies to PERSONTYPE_TRAINER
-;\12: script pointer
-;\13: event flag: an EVENT_* constant, or 0 for always
-	db \1, \2 + 4, \3 + 4, \4
-	dn \5, \6
-	db \7, \8
-	shift
-	dn \8, \9
-	shift
-	db \9
-	shift
-	dw \9
-	shift
-	dw \9
-endm
-
-
-newgroup: macro
-const_value = const_value + 1
-	enum_start 1
-endm
-
-mapgroup: macro
-;\1: map id
-;\2: height: in blocks
-;\3: width: in blocks
-GROUP_\1 EQU const_value
-	enum MAP_\1
-\1_HEIGHT EQU \2
-\1_WIDTH EQU \3
-endm
-
-
-map_header: macro
-;\1: map label
-;\2: tileset: a TILESET_* constant
-;\3: permission: TOWN, ROUTE, INDOOR, CAVE, PERM_5, GATE, or DUNGEON
-;\4: location: from constants/landmark_constants.asm
-;\5: music: a MUSIC_* constant
-;\6: phone service flag: 1 to prevent phone calls
-;\7: time of day: a PALETTE_* constant
-;\8: fishing group: a FISHGROUP_* constant
-\1_MapHeader:
-	db BANK(\1_SecondMapHeader), \2, \3
-	dw \1_SecondMapHeader
-	db \4, \5
-	dn \6, \7
-	db \8
-endm
-
-
-map_header_2: macro
-;\1: map label
-;\2: map id
-;\3: border block
-;\4: connections: sum of NORTH, SOUTH, WEST, and/or EAST, or 0 for none
-\1_SecondMapHeader::
-	db \3
-	db \2_HEIGHT, \2_WIDTH
-	db BANK(\1_BlockData)
-	dw \1_BlockData
-	db BANK(\1_MapScriptHeader)
-	dw \1_MapScriptHeader
-	dw \1_MapEventHeader
-	db \4
-endm
-
-connection: macro
-if "\1" == "north"
-;\2: map id
-;\3: map label (eventually will be rolled into map id)
-;\4: x
-;\5: offset?
-;\6: strip length
-;\7: this map id
-	map \2
-	dw \3_BlockData + \2_WIDTH * (\2_HEIGHT - 3) + \5
-	dw OverworldMap + \4 + 3
-	db \6
-	db \2_WIDTH
-	db \2_HEIGHT * 2 - 1
-	db (\4 - \5) * -2
-	dw OverworldMap + \2_HEIGHT * (\2_WIDTH + 6) + 1
-endc
-
-if "\1" == "south"
-;\2: map id
-;\3: map label (eventually will be rolled into map id)
-;\4: x
-;\5: offset?
-;\6: strip length
-;\7: this map id
-	map \2
-	dw \3_BlockData + \5
-	dw OverworldMap + (\7_HEIGHT + 3) * (\7_WIDTH + 6) + \4 + 3
-	db \6
-	db \2_WIDTH
-	db 0
-	db (\4 - \5) * -2
-	dw OverworldMap + \2_WIDTH + 7
-endc
-
-if "\1" == "west"
-;\2: map id
-;\3: map label (eventually will be rolled into map id)
-;\4: y
-;\5: offset?
-;\6: strip length
-;\7: this map id
-	map \2
-	dw \3_BlockData + (\2_WIDTH * \5) + \2_WIDTH - 3
-	dw OverworldMap + (\7_WIDTH + 6) * (\4 + 3)
-	db \6
-	db \2_WIDTH
-	db (\4 - \5) * -2
-	db \2_WIDTH * 2 - 1
-	dw OverworldMap + \2_WIDTH * 2 + 6
-endc
-
-if "\1" == "east"
-;\2: map id
-;\3: map label (eventually will be rolled into map id)
-;\4: y
-;\5: offset?
-;\6: strip length
-;\7: this map id
-	map \2
-	dw \3_BlockData + (\2_WIDTH * \5)
-	dw OverworldMap + (\7_WIDTH + 6) * (\4 + 3 + 1) - 3
-	db \6
-	db \2_WIDTH
-	db (\4 - \5) * -2
-	db 0
-	dw OverworldMap + \2_WIDTH + 7
-endc
-endm
-
-
-itemball: macro
-;\1: item: from constants/item_constants.asm
-;\2: quantity: default 1
-if _NARG == 2
-	db \1, \2
-else
-	db \1, 1
-endc
-endm
-
-elevfloor: macro
-;\1: floor: a FLOOR_* constant
-;\2: warp destination: starts at 1
-;\3: map id
-	db \1, \2
-	map \3
-ENDM
-
-stonetable: macro
-;\1: warp id
-;\2: person_event id
-;\3: script pointer
-	db \1, \2
-	dw \3
-endm
--- a/macros/mobile.asm
+++ /dev/null
@@ -1,2 +1,0 @@
-; Many mobile functions were dummied out in localization.
-mobile EQUS "ret"
--- a/macros/move_anim.asm
+++ /dev/null
@@ -1,294 +1,0 @@
-anim_wait: macro
-if \1 >= $d0
-	flip out
-endc
-	db \1
-	endm
-
-; BattleAnimCommands indexes (see battle/anim_commands.asm)
-	enum_start $d0
-
-	enum anim_obj_command ; d0
-anim_obj: macro
-	db anim_obj_command
-	db \1 ; obj
-	db (\2 << 3) + \3 ; x
-	db (\4 << 3) + \5 ; y
-	db \6 ; param
-	endm
-
-	enum anim_1gfx_command ; d1
-anim_1gfx: macro
-	db anim_1gfx_command
-	db \1 ; gfx1
-	endm
-
-	enum anim_2gfx_command ; d2
-anim_2gfx: macro
-	db anim_2gfx_command
-	db \1 ; gfx1
-	db \2 ; gfx2
-	endm
-
-	enum anim_3gfx_command ; d3
-anim_3gfx: macro
-	db anim_3gfx_command
-	db \1 ; gfx1
-	db \2 ; gfx2
-	db \3 ; gfx3
-	endm
-
-	enum anim_4gfx_command ; d4
-anim_4gfx: macro
-	db anim_4gfx_command
-	db \1 ; gfx1
-	db \2 ; gfx2
-	db \3 ; gfx3
-	db \4 ; gfx4
-	endm
-
-	enum anim_5gfx_command ; d5
-anim_5gfx: macro
-	db anim_5gfx_command
-	db \1 ; gfx1
-	db \2 ; gfx2
-	db \3 ; gfx3
-	db \4 ; gfx4
-	db \5 ; gfx5
-	endm
-
-	enum anim_incobj_command ; d6
-anim_incobj: macro
-	db anim_incobj_command
-	db \1 ; id
-	endm
-
-	enum anim_setobj_command ; d7
-anim_setobj: macro
-	db anim_setobj_command
-	db \1 ; id
-	db \2 ; obj
-	endm
-
-	enum anim_incbgeffect_command ; d8
-anim_incbgeffect: macro
-	db anim_incbgeffect_command
-	db \1 ; effect
-	endm
-
-	enum anim_enemyfeetobj_command ; d9
-anim_enemyfeetobj: macro
-	db anim_enemyfeetobj_command
-	endm
-
-	enum anim_playerheadobj_command ; da
-anim_playerheadobj: macro
-	db anim_playerheadobj_command
-	endm
-
-	enum anim_checkpokeball_command ; db
-anim_checkpokeball: macro
-	db anim_checkpokeball_command
-	endm
-
-	enum anim_transform_command ; dc
-anim_transform: macro
-	db anim_transform_command
-	endm
-
-	enum anim_raisesub_command ; dd
-anim_raisesub: macro
-	db anim_raisesub_command
-	endm
-
-	enum anim_dropsub_command ; de
-anim_dropsub: macro
-	db anim_dropsub_command
-	endm
-
-	enum anim_resetobp0_command ; df
-anim_resetobp0: macro
-	db anim_resetobp0_command
-	endm
-
-	enum anim_sound_command ; e0
-anim_sound: macro
-	db anim_sound_command
-	db (\1 << 2) | \2 ; duration, tracks
-	db \3 ; id
-	endm
-
-	enum anim_cry_command ; e1
-anim_cry: macro
-	db anim_cry_command
-	db \1 ; pitch
-	endm
-
-	enum anim_minimizeopp_command ; e2
-anim_minimizeopp: macro
-	db anim_minimizeopp_command
-	endm
-
-	enum anim_oamon_command ; e3
-anim_oamon: macro
-	db anim_oamon_command
-	endm
-
-	enum anim_oamoff_command ; e4
-anim_oamoff: macro
-	db anim_oamoff_command
-	endm
-
-	enum anim_clearobjs_command ; e5
-anim_clearobjs: macro
-	db anim_clearobjs_command
-	endm
-
-	enum anim_beatup_command ; e6
-anim_beatup: macro
-	db anim_beatup_command
-	endm
-
-	enum anim_0xe7_command ; e7
-anim_0xe7: macro
-	db anim_0xe7_command
-	endm
-
-	enum anim_updateactorpic_command ; e8
-anim_updateactorpic: macro
-	db anim_updateactorpic_command
-	endm
-
-	enum anim_minimize_command ; e9
-anim_minimize: macro
-	db anim_minimize_command
-	endm
-
-	enum anim_0xea_command ; ea
-anim_0xea: macro
-	db anim_0xea_command
-	endm
-
-	enum anim_0xeb_command ; eb
-anim_0xeb: macro
-	db anim_0xeb_command
-	endm
-
-	enum anim_0xec_command ; ec
-anim_0xec: macro
-	db anim_0xec_command
-	endm
-
-	enum anim_0xed_command ; ed
-anim_0xed: macro
-	db anim_0xed_command
-	endm
-
-	enum anim_if_param_and_command ; ee
-anim_if_param_and: macro
-	db anim_if_param_and_command
-	db \1 ; value
-	dw \2 ; address
-	endm
-
-	enum anim_jumpuntil_command ; ef
-anim_jumpuntil: macro
-	db anim_jumpuntil_command
-	dw \1 ; address
-	endm
-
-	enum anim_bgeffect_command ; f0
-anim_bgeffect: macro
-	db anim_bgeffect_command
-	db \1 ; effect
-	db \2 ; unknown
-	db \3 ; unknown
-	db \4 ; unknown
-	endm
-
-	enum anim_bgp_command ; f1
-anim_bgp: macro
-	db anim_bgp_command
-	db \1 ; colors
-	endm
-
-	enum anim_obp0_command ; f2
-anim_obp0: macro
-	db anim_obp0_command
-	db \1 ; colors
-	endm
-
-	enum anim_obp1_command ; f3
-anim_obp1: macro
-	db anim_obp1_command
-	db \1 ; colors
-	endm
-
-	enum anim_clearsprites_command ; f4
-anim_clearsprites: macro
-	db anim_clearsprites_command
-	endm
-
-	enum anim_0xf5_command ; f5
-anim_0xf5: macro
-	db anim_0xf5_command
-	endm
-
-	enum anim_0xf6_command ; f6
-anim_0xf6: macro
-	db anim_0xf6_command
-	endm
-
-	enum anim_0xf7_command ; f7
-anim_0xf7: macro
-	db anim_0xf7_command
-	endm
-
-	enum anim_if_param_equal_command ; f8
-anim_if_param_equal: macro
-	db anim_if_param_equal_command
-	db \1 ; value
-	dw \2 ; address
-	endm
-
-	enum anim_setvar_command ; f9
-anim_setvar: macro
-	db anim_setvar_command
-	db \1 ; value
-	endm
-
-	enum anim_incvar_command ; fa
-anim_incvar: macro
-	db anim_incvar_command
-	endm
-
-	enum anim_if_var_equal_command ; fb
-anim_if_var_equal: macro
-	db anim_if_var_equal_command
-	db \1 ; value
-	dw \2 ; address
-	endm
-
-	enum anim_jump_command ; fc
-anim_jump: macro
-	db anim_jump_command
-	dw \1 ; address
-	endm
-
-	enum anim_loop_command ; fd
-anim_loop: macro
-	db anim_loop_command
-	db \1 ; count
-	dw \2 ; address
-	endm
-
-	enum anim_call_command ; fe
-anim_call: macro
-	db anim_call_command
-	dw \1 ; address
-	endm
-
-	enum anim_ret_command ; ff
-anim_ret: macro
-	db anim_ret_command
-	endm
--- a/macros/movement.asm
+++ /dev/null
@@ -1,247 +1,0 @@
-; MovementPointers indexes (see engine/movement.asm)
-	enum_start
-
-; Directional movements
-
-	enum movement_turn_head
-turn_head: macro
-	db movement_turn_head | \1 ; $00
-	endm
-
-__enum__ = __enum__ + 3
-
-	enum movement_turn_step
-turn_step: macro
-	db movement_turn_step | \1 ; $04
-	endm
-
-__enum__ = __enum__ + 3
-
-	enum movement_slow_step
-slow_step: macro
-	db movement_slow_step | \1; $08
-	endm
-
-__enum__ = __enum__ + 3
-
-	enum movement_step
-step: macro
-	db movement_step | \1 ; $0c
-	endm
-
-__enum__ = __enum__ + 3
-
-	enum movement_big_step
-big_step: macro
-	db movement_big_step | \1 ; $10
-	endm
-
-__enum__ = __enum__ + 3
-
-	enum movement_slow_slide_step
-slow_slide_step: macro
-	db movement_slow_slide_step | \1 ; $14
-	endm
-
-__enum__ = __enum__ + 3
-
-	enum movement_slide_step
-slide_step: macro
-	db movement_slide_step | \1 ; $18
-	endm
-
-__enum__ = __enum__ + 3
-
-	enum movement_fast_slide_step
-fast_slide_step: macro
-	db movement_fast_slide_step | \1 ; $1c
-	endm
-
-__enum__ = __enum__ + 3
-
-	enum movement_turn_away
-turn_away: macro
-	db movement_turn_away | \1 ; $20
-	endm
-
-__enum__ = __enum__ + 3
-
-	enum movement_turn_in
-turn_in: macro
-	db movement_turn_in | \1 ; $24
-	endm
-
-__enum__ = __enum__ + 3
-
-	enum movement_turn_waterfall
-turn_waterfall: macro
-	db movement_turn_waterfall | \1 ; $28
-	endm
-
-__enum__ = __enum__ + 3
-
-	enum movement_slow_jump_step
-slow_jump_step: macro
-	db movement_slow_jump_step | \1 ; $2c
-	endm
-
-__enum__ = __enum__ + 3
-
-	enum movement_jump_step
-jump_step: macro
-	db movement_jump_step | \1 ; $30
-	endm
-
-__enum__ = __enum__ + 3
-
-	enum movement_fast_jump_step
-fast_jump_step: macro
-	db movement_fast_jump_step | \1 ; $34
-	endm
-
-__enum__ = __enum__ + 3
-
-; Control
-	enum movement_remove_sliding
-remove_sliding: macro
-	db movement_remove_sliding ; $38
-	endm
-
-	enum movement_set_sliding
-set_sliding: macro
-	db movement_set_sliding ; $39
-	endm
-
-	enum movement_remove_fixed_facing
-remove_fixed_facing: macro
-	db movement_remove_fixed_facing ; $3a
-	endm
-
-	enum movement_fix_facing
-fix_facing: macro
-	db movement_fix_facing ; $3b
-	endm
-
-	enum movement_show_person
-show_person: macro
-	db movement_show_person ; $3c
-	endm
-
-	enum movement_hide_person
-hide_person: macro
-	db movement_hide_person ; $3d
-	endm
-
-; Sleep
-
-	enum movement_step_sleep
-step_sleep: macro
-if \1 <= 8
-	db movement_step_sleep + \1 - 1
-else
-	db movement_step_sleep + 8, \1
-endc
-endm
-
-__enum__ = __enum__ + 8
-
-	enum movement_step_end
-step_end: macro
-	db movement_step_end ; $47
-	endm
-
-; Whatever Movement_48 is, it takes a one-byte parameter
-	enum movement_step_48
-step_48: macro
-	db movement_step_48
-	db \1
-	endm
-
-	enum movement_remove_person
-remove_person: macro
-	db movement_remove_person ; $49
-	endm
-
-	enum movement_step_loop
-step_loop: macro
-	db movement_step_loop ; $4a
-	endm
-
-	enum movement_step_4b
-step_4b: macro
-	db movement_step_4b ; $4b
-	endm
-
-	enum movement_teleport_from
-teleport_from: macro
-	db movement_teleport_from ; $4c
-	endm
-
-	enum movement_teleport_to
-teleport_to: macro
-	db movement_teleport_to ; $4d
-	endm
-
-	enum movement_skyfall
-skyfall: macro
-	db movement_skyfall ; $4e
-	endm
-
-	enum movement_step_dig
-step_dig: macro
-	db movement_step_dig ; $4f
-	db \1
-	endm
-
-	enum movement_step_bump
-step_bump: macro
-	db movement_step_bump ; $50
-	endm
-
-	enum movement_fish_got_bite
-fish_got_bite: macro
-	db movement_fish_got_bite ; $51
-	endm
-
-	enum movement_fish_cast_rod
-fish_cast_rod: macro
-	db movement_fish_cast_rod ; $52
-	endm
-
-	enum movement_hide_emote
-hide_emote: macro
-	db movement_hide_emote ; $53
-	endm
-
-	enum movement_show_emote
-show_emote: macro
-	db movement_show_emote ; $54
-	endm
-
-	enum movement_step_shake
-step_shake: macro
-	db movement_step_shake ; $55
-	db \1 ; displacement
-	endm
-
-	enum movement_tree_shake
-tree_shake: macro
-	db movement_tree_shake
-	endm
-
-	enum movement_rock_smash
-rock_smash: macro
-	db movement_rock_smash ; $57
-	db \1
-	endm
-
-	enum movement_return_dig
-return_dig: macro
-	db movement_return_dig ; $58
-	db \1
-	endm
-
-	enum movement_skyfall_top
-skyfall_top: macro
-	db movement_skyfall_top ; $59
-	endm
--- a/macros/pic.asm
+++ /dev/null
@@ -1,4 +1,0 @@
-add_pic: MACRO
-	db BANK(\1) - PICS_FIX
-	dw \1
-ENDM
--- a/macros/rst.asm
+++ b/macros/rst.asm
@@ -15,3 +15,15 @@
 	ld a, BANK(\1)
 	rst FarCall
 	ENDM
+
+homecall: MACRO
+	ld a, [hROMBank]
+	push af
+	ld a, BANK(\1)
+	rst Bankswitch
+
+	call \1
+
+	pop af
+	rst Bankswitch
+ENDM
--- /dev/null
+++ b/macros/scripts/audio.asm
@@ -1,0 +1,265 @@
+note: MACRO
+	dn (\1), (\2) - 1
+	ENDM
+
+sound: macro
+	note \1, \2
+	db \3 ; intensity
+	dw \4 ; frequency
+	endm
+
+noise: macro
+	note \1, \2 ; duration
+	db \3 ; intensity
+	db \4 ; frequency
+	endm
+
+musicheader: macro
+	; number of tracks, track idx, address
+	dbw ((\1 - 1) << 6) + (\2 - 1), \3
+	endm
+
+cry_header: macro
+	dw \1, \2, \3
+	endm
+
+; MusicCommands indexes (see audio/engine.asm)
+	enum_start $d8
+
+	enum notetype_cmd
+octave: macro
+	db notetype_cmd - (\1)
+	endm
+
+notetype: macro
+	db notetype_cmd
+	db \1 ; note_length
+	if _NARG >= 2
+	db \2 ; intensity
+	endc
+	endm
+
+	enum pitchoffset_cmd
+pitchoffset: macro
+	db pitchoffset_cmd
+	dn \1, \2 - 1 ; octave, key
+	endm
+
+	enum tempo_cmd
+tempo: macro
+	db tempo_cmd
+	bigdw \1 ; tempo
+	endm
+
+	enum dutycycle_cmd
+dutycycle: macro
+	db dutycycle_cmd
+	db \1 ; duty_cycle
+	endm
+
+	enum intensity_cmd
+intensity: macro
+	db intensity_cmd
+	db \1 ; intensity
+	endm
+
+	enum soundinput_cmd
+soundinput: macro
+	db soundinput_cmd
+	db \1 ; input
+	endm
+
+	enum sound_duty_cmd
+sound_duty: macro
+	db sound_duty_cmd
+	db \1 | (\2 << 2) | (\3 << 4) | (\4 << 6) ; duty sequence
+	endm
+
+	enum togglesfx_cmd
+togglesfx: macro
+	db togglesfx_cmd
+	endm
+
+	enum slidepitchto_cmd
+slidepitchto: macro
+	db slidepitchto_cmd
+	db \1 - 1 ; duration
+	dn \2, \3 ; octave, pitch
+	endm
+
+	enum vibrato_cmd
+vibrato: macro
+	db vibrato_cmd
+	db \1 ; delay
+	db \2 ; extent
+	endm
+
+	enum unknownmusic0xe2_cmd
+unknownmusic0xe2: macro
+	db unknownmusic0xe2_cmd
+	db \1 ; unknown
+	endm
+
+	enum togglenoise_cmd
+togglenoise: macro
+	db togglenoise_cmd
+	db \1 ; id
+	endm
+
+	enum panning_cmd
+panning: macro
+	db panning_cmd
+	db \1 ; tracks
+	endm
+
+	enum volume_cmd
+volume: macro
+	db volume_cmd
+	db \1 ; volume
+	endm
+
+	enum tone_cmd
+tone: macro
+	db tone_cmd
+	bigdw \1 ; tone
+	endm
+
+	enum unknownmusic0xe7_cmd
+unknownmusic0xe7: macro
+	db unknownmusic0xe7_cmd
+	db \1 ; unknown
+	endm
+
+	enum unknownmusic0xe8_cmd
+unknownmusic0xe8: macro
+	db unknownmusic0xe8_cmd
+	db \1 ; unknown
+	endm
+
+	enum tempo_relative_cmd
+tempo_relative: macro
+	db tempo_relative_cmd
+	bigdw \1 ; value
+	endm
+
+	enum restartchannel_cmd
+restartchannel: macro
+	db restartchannel_cmd
+	dw \1 ; address
+	endm
+
+	enum newsong_cmd
+newsong: macro
+	db newsong_cmd
+	bigdw \1 ; id
+	endm
+
+	enum sfxpriorityon_cmd
+sfxpriorityon: macro
+	db sfxpriorityon_cmd
+	endm
+
+	enum sfxpriorityoff_cmd
+sfxpriorityoff: macro
+	db sfxpriorityoff_cmd
+	endm
+
+	enum unknownmusic0xee_cmd
+unknownmusic0xee: macro
+	db unknownmusic0xee_cmd
+	dw \1 ; address
+	endm
+
+	enum stereopanning_cmd
+stereopanning: macro
+	db stereopanning_cmd
+	db \1 ; tracks
+	endm
+
+	enum sfxtogglenoise_cmd
+sfxtogglenoise: macro
+	db sfxtogglenoise_cmd
+	db \1 ; id
+	endm
+
+	enum music0xf1_cmd
+music0xf1: macro
+	db music0xf1_cmd
+	endm
+
+	enum music0xf2_cmd
+music0xf2: macro
+	db music0xf2_cmd
+	endm
+
+	enum music0xf3_cmd
+music0xf3: macro
+	db music0xf3_cmd
+	endm
+
+	enum music0xf4_cmd
+music0xf4: macro
+	db music0xf4_cmd
+	endm
+
+	enum music0xf5_cmd
+music0xf5: macro
+	db music0xf5_cmd
+	endm
+
+	enum music0xf6_cmd
+music0xf6: macro
+	db music0xf6_cmd
+	endm
+
+	enum music0xf7_cmd
+music0xf7: macro
+	db music0xf7_cmd
+	endm
+
+	enum music0xf8_cmd
+music0xf8: macro
+	db music0xf8_cmd
+	endm
+
+	enum unknownmusic0xf9_cmd
+unknownmusic0xf9: macro
+	db unknownmusic0xf9_cmd
+	endm
+
+	enum setcondition_cmd
+setcondition: macro
+	db setcondition_cmd
+	db \1 ; condition
+	endm
+
+	enum jumpif_cmd
+jumpif: macro
+	db jumpif_cmd
+	db \1 ; condition
+	dw \2 ; address
+	endm
+
+	enum jumpchannel_cmd
+jumpchannel: macro
+	db jumpchannel_cmd
+	dw \1 ; address
+	endm
+
+	enum loopchannel_cmd
+loopchannel: macro
+	db loopchannel_cmd
+	db \1 ; count
+	dw \2 ; address
+	endm
+
+	enum callchannel_cmd
+callchannel: macro
+	db callchannel_cmd
+	dw \1 ; address
+	endm
+
+	enum endchannel_cmd
+endchannel: macro
+	db endchannel_cmd
+	endm
--- /dev/null
+++ b/macros/scripts/event.asm
@@ -1,0 +1,1069 @@
+; ScriptCommandTable indexes (see engine/scripting.asm)
+	enum_start
+
+	enum scall_command
+scall: macro
+	db scall_command
+	dw \1 ; pointer
+	endm
+
+	enum farscall_command
+farscall: macro
+	db farscall_command
+	dba \1
+	endm
+
+	enum ptcall_command
+ptcall: macro
+	db ptcall_command
+	dw \1 ; pointer
+	endm
+
+	enum jump_command
+jump: macro
+	db jump_command
+	dw \1 ; pointer
+	endm
+
+	enum farjump_command
+farjump: macro
+	db farjump_command
+	dba \1
+	endm
+
+	enum ptjump_command
+ptjump: macro
+	db ptjump_command
+	dw \1 ; pointer
+	endm
+
+	enum if_equal_command
+if_equal: macro
+	db if_equal_command
+	db \1 ; byte
+	dw \2 ; pointer
+	endm
+
+	enum if_not_equal_command
+if_not_equal: macro
+	db if_not_equal_command
+	db \1 ; byte
+	dw \2 ; pointer
+	endm
+
+	enum iffalse_command
+iffalse: macro
+	db iffalse_command
+	dw \1 ; pointer
+	endm
+
+	enum iftrue_command
+iftrue: macro
+	db iftrue_command
+	dw \1 ; pointer
+	endm
+
+	enum if_greater_than_command
+if_greater_than: macro
+	db if_greater_than_command
+	db \1 ; byte
+	dw \2 ; pointer
+	endm
+
+	enum if_less_than_command
+if_less_than: macro
+	db if_less_than_command
+	db \1 ; byte
+	dw \2 ; pointer
+	endm
+
+	enum jumpstd_command
+jumpstd: macro
+	db jumpstd_command
+	dw \1 ; predefined_script
+	endm
+
+	enum callstd_command
+callstd: macro
+	db callstd_command
+	dw \1 ; predefined_script
+	endm
+
+	enum callasm_command
+callasm: macro
+	db callasm_command
+	dba \1
+	endm
+
+	enum special_command
+special: macro
+	db special_command
+	dw (\1Special - SpecialsPointers) / 3
+	endm
+
+add_special: MACRO
+\1Special::
+	dba \1
+ENDM
+
+	enum ptcallasm_command
+ptcallasm: macro
+	db ptcallasm_command
+	dw \1 ; asm
+	endm
+
+	enum checkmaptriggers_command
+checkmaptriggers: macro
+	db checkmaptriggers_command
+	map \1 ; map
+	endm
+
+	enum domaptrigger_command
+domaptrigger: macro
+	db domaptrigger_command
+	map \1 ; map
+	db \2 ; trigger_id
+	endm
+
+	enum checktriggers_command
+checktriggers: macro
+	db checktriggers_command
+	endm
+
+	enum dotrigger_command
+dotrigger: macro
+	db dotrigger_command
+	db \1 ; trigger_id
+	endm
+
+	enum writebyte_command
+writebyte: macro
+	db writebyte_command
+	db \1 ; value
+	endm
+
+	enum addvar_command
+addvar: macro
+	db addvar_command
+	db \1 ; value
+	endm
+
+	enum random_command
+random: macro
+	db random_command
+	db \1 ; input
+	endm
+
+	enum checkver_command
+checkver: macro
+	db checkver_command
+	endm
+
+	enum copybytetovar_command
+copybytetovar: macro
+	db copybytetovar_command
+	dw \1 ; address
+	endm
+
+	enum copyvartobyte_command
+copyvartobyte: macro
+	db copyvartobyte_command
+	dw \1 ; address
+	endm
+
+	enum loadvar_command
+loadvar: macro
+	db loadvar_command
+	dw \1 ; address
+	db \2 ; value
+	endm
+
+	enum checkcode_command
+checkcode: macro
+	db checkcode_command
+	db \1 ; variable_id
+	endm
+
+	enum writevarcode_command
+writevarcode: macro
+	db writevarcode_command
+	db \1 ; variable_id
+	endm
+
+	enum writecode_command
+writecode: macro
+	db writecode_command
+	db \1 ; variable_id
+	db \2 ; value
+	endm
+
+	enum giveitem_command
+giveitem: macro
+	db giveitem_command
+	db \1 ; item
+if _NARG == 2
+	db \2 ; quantity
+else
+	db 1
+endc
+	endm
+
+	enum takeitem_command
+takeitem: macro
+	db takeitem_command
+	db \1 ; item
+if _NARG == 2
+	db \2 ; quantity
+else
+	db 1
+endc
+	endm
+
+	enum checkitem_command
+checkitem: macro
+	db checkitem_command
+	db \1 ; item
+	endm
+
+	enum givemoney_command
+givemoney: macro
+	db givemoney_command
+	db \1 ; account
+	dt \2 ; money
+	endm
+
+	enum takemoney_command
+takemoney: macro
+	db takemoney_command
+	db \1 ; account
+	dt \2 ; money
+	endm
+
+	enum checkmoney_command
+checkmoney: macro
+	db checkmoney_command
+	db \1 ; account
+	dt \2 ; money
+	endm
+
+	enum givecoins_command
+givecoins: macro
+	db givecoins_command
+	dw \1 ; coins
+	endm
+
+	enum takecoins_command
+takecoins: macro
+	db takecoins_command
+	dw \1 ; coins
+	endm
+
+	enum checkcoins_command
+checkcoins: macro
+	db checkcoins_command
+	dw \1 ; coins
+	endm
+
+	enum addcellnum_command
+addcellnum: macro
+	db addcellnum_command
+	db \1 ; person
+	endm
+
+	enum delcellnum_command
+delcellnum: macro
+	db delcellnum_command
+	db \1 ; person
+	endm
+
+	enum checkcellnum_command
+checkcellnum: macro
+	db checkcellnum_command
+	db \1 ; person
+	endm
+
+	enum checktime_command
+checktime: macro
+	db checktime_command
+	db \1 ; time
+	endm
+
+checkmorn EQUS "checktime MORN"
+checkday  EQUS "checktime DAY"
+checknite EQUS "checktime NITE"
+
+	enum checkpoke_command
+checkpoke: macro
+	db checkpoke_command
+	db \1 ; pkmn
+	endm
+
+	enum givepoke_command
+givepoke: macro
+	db givepoke_command
+	db \1 ; pokemon
+	db \2 ; level
+	if _NARG >= 3
+	db \3 ; item
+	if _NARG >= 4
+	db \4 ; trainer
+	if \4
+	dw \5 ; trainer_name_pointer
+	dw \6 ; pkmn_nickname
+	endc
+	else
+	db 0
+	endc
+	else
+	db 0, 0
+	endc
+	endm
+
+	enum giveegg_command
+giveegg: macro
+	db giveegg_command
+	db \1 ; pkmn
+	db \2 ; level
+	endm
+
+	enum givepokeitem_command
+givepokeitem: macro
+	db givepokeitem_command
+	dw \1 ; pointer
+	endm
+
+	enum checkpokeitem_command
+checkpokeitem: macro
+	db checkpokeitem_command
+	dw \1 ; pointer
+	endm
+
+	enum checkevent_command
+checkevent: macro
+	db checkevent_command
+	dw \1 ; event_flag
+	endm
+
+	enum clearevent_command
+clearevent: macro
+	db clearevent_command
+	dw \1 ; event_flag
+	endm
+
+	enum setevent_command
+setevent: macro
+	db setevent_command
+	dw \1 ; event_flag
+	endm
+
+	enum checkflag_command
+checkflag: macro
+	db checkflag_command
+	dw \1 ; engine_flag
+	endm
+
+	enum clearflag_command
+clearflag: macro
+	db clearflag_command
+	dw \1 ; engine_flag
+	endm
+
+	enum setflag_command
+setflag: macro
+	db setflag_command
+	dw \1 ; engine_flag
+	endm
+
+	enum wildon_command
+wildon: macro
+	db wildon_command
+	endm
+
+	enum wildoff_command
+wildoff: macro
+	db wildoff_command
+	endm
+
+	enum xycompare_command
+xycompare: macro
+	db xycompare_command
+	dw \1 ; pointer
+	endm
+
+	enum warpmod_command
+warpmod: macro
+	db warpmod_command
+	db \1 ; warp_id
+	map \2 ; map
+	endm
+
+	enum blackoutmod_command
+blackoutmod: macro
+	db blackoutmod_command
+	map \1 ; map
+	endm
+
+	enum warp_command
+warp: macro
+	db warp_command
+	map \1 ; map
+	db \2 ; x
+	db \3 ; y
+	endm
+
+	enum readmoney_command
+readmoney: macro
+	db readmoney_command
+	db \1 ; account
+	db \2 ; memory
+	endm
+
+	enum readcoins_command
+readcoins: macro
+	db readcoins_command
+	db \1 ; memory
+	endm
+
+	enum RAM2MEM_command
+RAM2MEM: macro
+	db RAM2MEM_command
+	db \1 ; memory
+	endm
+
+	enum pokenamemem_command
+pokenamemem: macro
+	db pokenamemem_command
+	db \1 ; pokemon
+	db \2 ; memory
+	endm
+
+	enum itemtotext_command
+itemtotext: macro
+	db itemtotext_command
+	db \1 ; item
+	db \2 ; memory
+	endm
+
+	enum mapnametotext_command
+mapnametotext: macro
+	db mapnametotext_command
+	db \1 ; memory
+	endm
+
+	enum trainertotext_command
+trainertotext: macro
+	db trainertotext_command
+	db \1 ; trainer_id
+	db \2 ; trainer_group
+	db \3 ; memory
+	endm
+
+	enum stringtotext_command
+stringtotext: macro
+	db stringtotext_command
+	dw \1 ; text_pointer
+	db \2 ; memory
+	endm
+
+	enum itemnotify_command
+itemnotify: macro
+	db itemnotify_command
+	endm
+
+	enum pocketisfull_command
+pocketisfull: macro
+	db pocketisfull_command
+	endm
+
+	enum opentext_command
+opentext: macro
+	db opentext_command
+	endm
+
+	enum refreshscreen_command
+refreshscreen: macro
+	db refreshscreen_command
+	db \1 ; dummy
+	endm
+
+	enum closetext_command
+closetext: macro
+	db closetext_command
+	endm
+
+	enum loadbytec2cf_command
+loadbytec2cf: macro
+	db loadbytec2cf_command
+	db \1 ; byte
+	endm
+
+	enum farwritetext_command
+farwritetext: macro
+	db farwritetext_command
+	dba \1
+	endm
+
+	enum writetext_command
+writetext: macro
+	db writetext_command
+	dw \1 ; text_pointer
+	endm
+
+	enum repeattext_command
+repeattext: macro
+	db repeattext_command
+	db \1 ; byte
+	db \2 ; byte
+	endm
+
+	enum yesorno_command
+yesorno: macro
+	db yesorno_command
+	endm
+
+	enum loadmenudata_command
+loadmenudata: macro
+	db loadmenudata_command
+	dw \1 ; data
+	endm
+
+	enum closewindow_command
+closewindow: macro
+	db closewindow_command
+	endm
+
+	enum jumptextfaceplayer_command
+jumptextfaceplayer: macro
+	db jumptextfaceplayer_command
+	dw \1 ; text_pointer
+	endm
+
+; IF _CRYSTAL
+	enum farjumptext_command
+farjumptext: macro
+	db farjumptext_command
+	dba \1
+	endm
+; ENDC
+
+	enum jumptext_command
+jumptext: macro
+	db jumptext_command
+	dw \1 ; text_pointer
+	endm
+
+	enum waitbutton_command
+waitbutton: macro
+	db waitbutton_command
+	endm
+
+	enum buttonsound_command
+buttonsound: macro
+	db buttonsound_command
+	endm
+
+	enum pokepic_command
+pokepic: macro
+	db pokepic_command
+	db \1 ; pokemon
+	endm
+
+	enum closepokepic_command
+closepokepic: macro
+	db closepokepic_command
+	endm
+
+	enum _2dmenu_command
+_2dmenu: macro
+	db _2dmenu_command
+	endm
+
+	enum verticalmenu_command
+verticalmenu: macro
+	db verticalmenu_command
+	endm
+
+	enum loadpikachudata_command
+loadpikachudata: macro
+	db loadpikachudata_command
+	endm
+
+	enum randomwildmon_command
+randomwildmon: macro
+	db randomwildmon_command
+	endm
+
+	enum loadmemtrainer_command
+loadmemtrainer: macro
+	db loadmemtrainer_command
+	endm
+
+	enum loadwildmon_command
+loadwildmon: macro
+	db loadwildmon_command
+	db \1 ; pokemon
+	db \2 ; level
+	endm
+
+	enum loadtrainer_command
+loadtrainer: macro
+	db loadtrainer_command
+	db \1 ; trainer_group
+	db \2 ; trainer_id
+	endm
+
+	enum startbattle_command
+startbattle: macro
+	db startbattle_command
+	endm
+
+	enum reloadmapafterbattle_command
+reloadmapafterbattle: macro
+	db reloadmapafterbattle_command
+	endm
+
+	enum catchtutorial_command
+catchtutorial: macro
+	db catchtutorial_command
+	db \1 ; byte
+	endm
+
+	enum trainertext_command
+trainertext: macro
+	db trainertext_command
+	db \1 ; which_text
+	endm
+
+	enum trainerflagaction_command
+trainerflagaction: macro
+	db trainerflagaction_command
+	db \1 ; action
+	endm
+
+	enum winlosstext_command
+winlosstext: macro
+	db winlosstext_command
+	dw \1 ; win_text_pointer
+	dw \2 ; loss_text_pointer
+	endm
+
+	enum scripttalkafter_command
+scripttalkafter: macro
+	db scripttalkafter_command
+	endm
+
+	enum end_if_just_battled_command
+end_if_just_battled: macro
+	db end_if_just_battled_command
+	endm
+
+	enum check_just_battled_command
+check_just_battled: macro
+	db check_just_battled_command
+	endm
+
+	enum setlasttalked_command
+setlasttalked: macro
+	db setlasttalked_command
+	db \1 ; person
+	endm
+
+	enum applymovement_command
+applymovement: macro
+	db applymovement_command
+	db \1 ; person
+	dw \2 ; data
+	endm
+
+	enum applymovement2_command
+applymovement2: macro
+	db applymovement2_command
+	dw \1 ; data
+	endm
+
+	enum faceplayer_command
+faceplayer: macro
+	db faceplayer_command
+	endm
+
+	enum faceperson_command
+faceperson: macro
+	db faceperson_command
+	db \1 ; person1
+	db \2 ; person2
+	endm
+
+	enum variablesprite_command
+variablesprite: macro
+	db variablesprite_command
+	db \1 - SPRITE_VARS ; byte
+	db \2 ; sprite
+	endm
+
+	enum disappear_command
+disappear: macro
+	db disappear_command
+	db \1 ; person
+	endm
+
+	enum appear_command
+appear: macro
+	db appear_command
+	db \1 ; person
+	endm
+
+	enum follow_command
+follow: macro
+	db follow_command
+	db \1 ; person2
+	db \2 ; person1
+	endm
+
+	enum stopfollow_command
+stopfollow: macro
+	db stopfollow_command
+	endm
+
+	enum moveperson_command
+moveperson: macro
+	db moveperson_command
+	db \1 ; person
+	db \2 ; x
+	db \3 ; y
+	endm
+
+	enum writepersonxy_command
+writepersonxy: macro
+	db writepersonxy_command
+	db \1 ; person
+	endm
+
+	enum loademote_command
+loademote: macro
+	db loademote_command
+	db \1 ; bubble
+	endm
+
+	enum showemote_command
+showemote: macro
+	db showemote_command
+	db \1 ; bubble
+	db \2 ; person
+	db \3 ; time
+	endm
+
+	enum spriteface_command
+spriteface: macro
+	db spriteface_command
+	db \1 ; person
+	db \2 ; facing
+	endm
+
+	enum follownotexact_command
+follownotexact: macro
+	db follownotexact_command
+	db \1 ; person2
+	db \2 ; person1
+	endm
+
+	enum earthquake_command
+earthquake: macro
+	db earthquake_command
+	db \1 ; param
+	endm
+
+	enum changemap_command
+changemap: macro
+	db changemap_command
+	db \1 ; map_bank
+	dw \2 ; map_data_pointer
+	endm
+
+	enum changeblock_command
+changeblock: macro
+	db changeblock_command
+	db \1 ; x
+	db \2 ; y
+	db \3 ; block
+	endm
+
+	enum reloadmap_command
+reloadmap: macro
+	db reloadmap_command
+	endm
+
+	enum reloadmappart_command
+reloadmappart: macro
+	db reloadmappart_command
+	endm
+
+	enum writecmdqueue_command
+writecmdqueue: macro
+	db writecmdqueue_command
+	dw \1 ; queue_pointer
+	endm
+
+	enum delcmdqueue_command
+delcmdqueue: macro
+	db delcmdqueue_command
+	db \1 ; byte
+	endm
+
+	enum playmusic_command
+playmusic: macro
+	db playmusic_command
+	dw \1 ; music_pointer
+	endm
+
+	enum encountermusic_command
+encountermusic: macro
+	db encountermusic_command
+	endm
+
+	enum musicfadeout_command
+musicfadeout: macro
+	db musicfadeout_command
+	dw \1 ; music
+	db \2 ; fadetime
+	endm
+
+	enum playmapmusic_command
+playmapmusic: macro
+	db playmapmusic_command
+	endm
+
+	enum dontrestartmapmusic_command
+dontrestartmapmusic: macro
+	db dontrestartmapmusic_command
+	endm
+
+	enum cry_command
+cry: macro
+	db cry_command
+	dw \1 ; cry_id
+	endm
+
+	enum playsound_command
+playsound: macro
+	db playsound_command
+	dw \1 ; sound_pointer
+	endm
+
+	enum waitsfx_command
+waitsfx: macro
+	db waitsfx_command
+	endm
+
+	enum warpsound_command
+warpsound: macro
+	db warpsound_command
+	endm
+
+	enum specialsound_command
+specialsound: macro
+	db specialsound_command
+	endm
+
+	enum passtoengine_command
+passtoengine: macro
+	db passtoengine_command
+	db \1 ; data_pointer
+	endm
+
+	enum newloadmap_command
+newloadmap: macro
+	db newloadmap_command
+	db \1 ; which_method
+	endm
+
+	enum pause_command
+pause: macro
+	db pause_command
+	db \1 ; length
+	endm
+
+	enum deactivatefacing_command
+deactivatefacing: macro
+	db deactivatefacing_command
+	db \1 ; time
+	endm
+
+	enum priorityjump_command
+priorityjump: macro
+	db priorityjump_command
+	dw \1 ; pointer
+	endm
+
+	enum warpcheck_command
+warpcheck: macro
+	db warpcheck_command
+	endm
+
+	enum ptpriorityjump_command
+ptpriorityjump: macro
+	db ptpriorityjump_command
+	dw \1 ; pointer
+	endm
+
+	enum return_command
+return: macro
+	db return_command
+	endm
+
+	enum end_command
+end: macro
+	db end_command
+	endm
+
+	enum reloadandreturn_command
+reloadandreturn: macro
+	db reloadandreturn_command
+	db \1 ; which_method
+	endm
+
+	enum end_all_command
+end_all: macro
+	db end_all_command
+	endm
+
+	enum pokemart_command
+pokemart: macro
+	db pokemart_command
+	db \1 ; dialog_id
+	dw \2 ; mart_id
+	endm
+
+	enum elevator_command
+elevator: macro
+	db elevator_command
+	dw \1 ; floor_list_pointer
+	endm
+
+	enum trade_command
+trade: macro
+	db trade_command
+	db \1 ; trade_id
+	endm
+
+	enum askforphonenumber_command
+askforphonenumber: macro
+	db askforphonenumber_command
+	db \1 ; number
+	endm
+
+	enum phonecall_command
+phonecall: macro
+	db phonecall_command
+	dw \1 ; caller_name
+	endm
+
+	enum hangup_command
+hangup: macro
+	db hangup_command
+	endm
+
+	enum describedecoration_command
+describedecoration: macro
+	db describedecoration_command
+	db \1 ; byte
+	endm
+
+	enum fruittree_command
+fruittree: macro
+	db fruittree_command
+	db \1 ; tree_id
+	endm
+
+	enum specialphonecall_command
+specialphonecall: macro
+	db specialphonecall_command
+	dw \1 ; call_id
+	endm
+
+	enum checkphonecall_command
+checkphonecall: macro
+	db checkphonecall_command
+	endm
+
+	enum verbosegiveitem_command
+verbosegiveitem: macro
+	db verbosegiveitem_command
+	db \1 ; item
+if _NARG == 2
+	db \2 ; quantity
+else
+	db 1
+endc
+	endm
+
+	enum verbosegiveitem2_command
+verbosegiveitem2: macro
+	db verbosegiveitem2_command
+	db \1 ; item
+	db \2 ; var
+	endm
+
+	enum swarm_command
+swarm: macro
+	db swarm_command
+	db \1 ; flag
+	map \2 ; map
+	endm
+
+	enum halloffame_command
+halloffame: macro
+	db halloffame_command
+	endm
+
+	enum credits_command
+credits: macro
+	db credits_command
+	endm
+
+	enum warpfacing_command
+warpfacing: macro
+	db warpfacing_command
+	db \1 ; facing
+	map \2 ; map
+	db \3 ; x
+	db \4 ; y
+	endm
+
+	enum battletowertext_command
+battletowertext: macro
+	db battletowertext_command
+	db \1 ; memory
+	endm
+
+	enum landmarktotext_command
+landmarktotext: macro
+	db landmarktotext_command
+	db \1 ; id
+	db \2 ; memory
+	endm
+
+	enum trainerclassname_command
+trainerclassname: macro
+	db trainerclassname_command
+	db \1 ; id
+	db \2 ; memory
+	endm
+
+	enum name_command
+name: macro
+	db name_command
+	db \1 ; type
+	db \2 ; id
+	db \3 ; memory
+	endm
+
+	enum wait_command
+wait: macro
+	db wait_command
+	db \1 ; duration
+	endm
+
+	enum check_save_command
+check_save: macro
+	db check_save_command
+	endm
--- /dev/null
+++ b/macros/scripts/gfx_anim.asm
@@ -1,0 +1,46 @@
+; pic+sprite animations
+
+frame: macro
+	db \1
+x = \2
+if _NARG > 2
+rept _NARG +- 2
+x = x | (1 << (\3 + 1))
+	shift
+endr
+endc
+	db x
+	endm
+
+	enum_start $fc
+
+; used for sprites
+	enum delanim_command ; fc
+delanim: macro
+	db delanim_command
+	endm
+
+	enum dorepeat_command ; fd
+dorepeat: macro
+	db dorepeat_command
+	db \1 ; #
+	endm
+
+	enum setrepeat_command ; fe
+setrepeat: macro
+	db setrepeat_command
+	db \1 ; #
+	endm
+
+	enum endanim_command ; ff
+endanim: macro
+	db endanim_command
+	endm
+
+__enum__ = $fe
+
+; used for sprites
+	enum dorestart_command ; fe
+dorestart: macro
+	db dorestart_command
+	endm
--- /dev/null
+++ b/macros/scripts/maps.asm
@@ -1,0 +1,104 @@
+map: macro
+;\1: map id
+	db GROUP_\1, MAP_\1
+endm
+
+
+maptrigger: macro
+;\1: script pointer
+	dw \1, 0
+endm
+
+warp_def: macro
+;\1: y: top to bottom, starts at 0
+;\2: x: left to right, starts at 0
+;\3: warp destination: starts at 1
+;\4: map id: from constants/map_constants.asm
+	db \1, \2, \3
+	map \4
+endm
+
+xy_trigger: macro
+;\1: number: controlled by dotrigger/domaptrigger
+;\2: y: top to bottom, starts at 0
+;\3: x: left to right, starts at 0
+;\4: script pointer
+	db \1, \2, \3, $0
+	dw \4
+	db $0, $0
+endm
+
+signpost: macro
+;\1: y: top to bottom, starts at 0
+;\2: x: left to right, starts at 0
+;\3: function: a SIGNPOST_* constant
+;\4: script pointer
+	db \1, \2, \3
+	dw \4
+endm
+
+person_event: macro
+;\1: sprite: a SPRITE_* constant
+;\2: y: top to bottom, starts at 0
+;\3: x: left to right, starts at 0
+;\4: movement function: a SPRITEMOVEDATA_* constant
+;\5, \6: movement radius: y, x
+;\7: clock hour: ???
+;\8: clock daytime: sum of MORN, DAY, and/or NITE, or 0 for always
+;\9: color: a PAL_NPC_* constant, or 0 for sprite default
+;\10: function: a PERSONTYPE_* constant
+;\11: sight range: applies to PERSONTYPE_TRAINER
+;\12: script pointer
+;\13: event flag: an EVENT_* constant, or 0 for always
+	db \1, \2 + 4, \3 + 4, \4
+	dn \5, \6
+	db \7, \8
+	shift
+	dn \8, \9
+	shift
+	db \9
+	shift
+	dw \9
+	shift
+	dw \9
+endm
+
+
+trainer: macro
+;\1: flag: an EVENT_BEAT_* constant
+;\2: trainer group
+;\3: trainer id
+;\4: seen text
+;\5: win text
+;\6: loss text
+;\7: after-battle text
+	dw \1
+	db \2, \3
+	dw \4, \5, \6, \7
+endm
+
+itemball: macro
+;\1: item: from constants/item_constants.asm
+;\2: quantity: default 1
+if _NARG == 2
+	db \1, \2
+else
+	db \1, 1
+endc
+endm
+
+elevfloor: macro
+;\1: floor: a FLOOR_* constant
+;\2: warp destination: starts at 1
+;\3: map id
+	db \1, \2
+	map \3
+ENDM
+
+stonetable: macro
+;\1: warp id
+;\2: person_event id
+;\3: script pointer
+	db \1, \2
+	dw \3
+endm
--- /dev/null
+++ b/macros/scripts/move_anim.asm
@@ -1,0 +1,294 @@
+anim_wait: macro
+if \1 >= $d0
+	flip out
+endc
+	db \1
+	endm
+
+; BattleAnimCommands indexes (see battle/anim_commands.asm)
+	enum_start $d0
+
+	enum anim_obj_command ; d0
+anim_obj: macro
+	db anim_obj_command
+	db \1 ; obj
+	db (\2 << 3) + \3 ; x
+	db (\4 << 3) + \5 ; y
+	db \6 ; param
+	endm
+
+	enum anim_1gfx_command ; d1
+anim_1gfx: macro
+	db anim_1gfx_command
+	db \1 ; gfx1
+	endm
+
+	enum anim_2gfx_command ; d2
+anim_2gfx: macro
+	db anim_2gfx_command
+	db \1 ; gfx1
+	db \2 ; gfx2
+	endm
+
+	enum anim_3gfx_command ; d3
+anim_3gfx: macro
+	db anim_3gfx_command
+	db \1 ; gfx1
+	db \2 ; gfx2
+	db \3 ; gfx3
+	endm
+
+	enum anim_4gfx_command ; d4
+anim_4gfx: macro
+	db anim_4gfx_command
+	db \1 ; gfx1
+	db \2 ; gfx2
+	db \3 ; gfx3
+	db \4 ; gfx4
+	endm
+
+	enum anim_5gfx_command ; d5
+anim_5gfx: macro
+	db anim_5gfx_command
+	db \1 ; gfx1
+	db \2 ; gfx2
+	db \3 ; gfx3
+	db \4 ; gfx4
+	db \5 ; gfx5
+	endm
+
+	enum anim_incobj_command ; d6
+anim_incobj: macro
+	db anim_incobj_command
+	db \1 ; id
+	endm
+
+	enum anim_setobj_command ; d7
+anim_setobj: macro
+	db anim_setobj_command
+	db \1 ; id
+	db \2 ; obj
+	endm
+
+	enum anim_incbgeffect_command ; d8
+anim_incbgeffect: macro
+	db anim_incbgeffect_command
+	db \1 ; effect
+	endm
+
+	enum anim_enemyfeetobj_command ; d9
+anim_enemyfeetobj: macro
+	db anim_enemyfeetobj_command
+	endm
+
+	enum anim_playerheadobj_command ; da
+anim_playerheadobj: macro
+	db anim_playerheadobj_command
+	endm
+
+	enum anim_checkpokeball_command ; db
+anim_checkpokeball: macro
+	db anim_checkpokeball_command
+	endm
+
+	enum anim_transform_command ; dc
+anim_transform: macro
+	db anim_transform_command
+	endm
+
+	enum anim_raisesub_command ; dd
+anim_raisesub: macro
+	db anim_raisesub_command
+	endm
+
+	enum anim_dropsub_command ; de
+anim_dropsub: macro
+	db anim_dropsub_command
+	endm
+
+	enum anim_resetobp0_command ; df
+anim_resetobp0: macro
+	db anim_resetobp0_command
+	endm
+
+	enum anim_sound_command ; e0
+anim_sound: macro
+	db anim_sound_command
+	db (\1 << 2) | \2 ; duration, tracks
+	db \3 ; id
+	endm
+
+	enum anim_cry_command ; e1
+anim_cry: macro
+	db anim_cry_command
+	db \1 ; pitch
+	endm
+
+	enum anim_minimizeopp_command ; e2
+anim_minimizeopp: macro
+	db anim_minimizeopp_command
+	endm
+
+	enum anim_oamon_command ; e3
+anim_oamon: macro
+	db anim_oamon_command
+	endm
+
+	enum anim_oamoff_command ; e4
+anim_oamoff: macro
+	db anim_oamoff_command
+	endm
+
+	enum anim_clearobjs_command ; e5
+anim_clearobjs: macro
+	db anim_clearobjs_command
+	endm
+
+	enum anim_beatup_command ; e6
+anim_beatup: macro
+	db anim_beatup_command
+	endm
+
+	enum anim_0xe7_command ; e7
+anim_0xe7: macro
+	db anim_0xe7_command
+	endm
+
+	enum anim_updateactorpic_command ; e8
+anim_updateactorpic: macro
+	db anim_updateactorpic_command
+	endm
+
+	enum anim_minimize_command ; e9
+anim_minimize: macro
+	db anim_minimize_command
+	endm
+
+	enum anim_0xea_command ; ea
+anim_0xea: macro
+	db anim_0xea_command
+	endm
+
+	enum anim_0xeb_command ; eb
+anim_0xeb: macro
+	db anim_0xeb_command
+	endm
+
+	enum anim_0xec_command ; ec
+anim_0xec: macro
+	db anim_0xec_command
+	endm
+
+	enum anim_0xed_command ; ed
+anim_0xed: macro
+	db anim_0xed_command
+	endm
+
+	enum anim_if_param_and_command ; ee
+anim_if_param_and: macro
+	db anim_if_param_and_command
+	db \1 ; value
+	dw \2 ; address
+	endm
+
+	enum anim_jumpuntil_command ; ef
+anim_jumpuntil: macro
+	db anim_jumpuntil_command
+	dw \1 ; address
+	endm
+
+	enum anim_bgeffect_command ; f0
+anim_bgeffect: macro
+	db anim_bgeffect_command
+	db \1 ; effect
+	db \2 ; unknown
+	db \3 ; unknown
+	db \4 ; unknown
+	endm
+
+	enum anim_bgp_command ; f1
+anim_bgp: macro
+	db anim_bgp_command
+	db \1 ; colors
+	endm
+
+	enum anim_obp0_command ; f2
+anim_obp0: macro
+	db anim_obp0_command
+	db \1 ; colors
+	endm
+
+	enum anim_obp1_command ; f3
+anim_obp1: macro
+	db anim_obp1_command
+	db \1 ; colors
+	endm
+
+	enum anim_clearsprites_command ; f4
+anim_clearsprites: macro
+	db anim_clearsprites_command
+	endm
+
+	enum anim_0xf5_command ; f5
+anim_0xf5: macro
+	db anim_0xf5_command
+	endm
+
+	enum anim_0xf6_command ; f6
+anim_0xf6: macro
+	db anim_0xf6_command
+	endm
+
+	enum anim_0xf7_command ; f7
+anim_0xf7: macro
+	db anim_0xf7_command
+	endm
+
+	enum anim_if_param_equal_command ; f8
+anim_if_param_equal: macro
+	db anim_if_param_equal_command
+	db \1 ; value
+	dw \2 ; address
+	endm
+
+	enum anim_setvar_command ; f9
+anim_setvar: macro
+	db anim_setvar_command
+	db \1 ; value
+	endm
+
+	enum anim_incvar_command ; fa
+anim_incvar: macro
+	db anim_incvar_command
+	endm
+
+	enum anim_if_var_equal_command ; fb
+anim_if_var_equal: macro
+	db anim_if_var_equal_command
+	db \1 ; value
+	dw \2 ; address
+	endm
+
+	enum anim_jump_command ; fc
+anim_jump: macro
+	db anim_jump_command
+	dw \1 ; address
+	endm
+
+	enum anim_loop_command ; fd
+anim_loop: macro
+	db anim_loop_command
+	db \1 ; count
+	dw \2 ; address
+	endm
+
+	enum anim_call_command ; fe
+anim_call: macro
+	db anim_call_command
+	dw \1 ; address
+	endm
+
+	enum anim_ret_command ; ff
+anim_ret: macro
+	db anim_ret_command
+	endm
--- /dev/null
+++ b/macros/scripts/movement.asm
@@ -1,0 +1,247 @@
+; MovementPointers indexes (see engine/movement.asm)
+	enum_start
+
+; Directional movements
+
+	enum movement_turn_head
+turn_head: macro
+	db movement_turn_head | \1 ; $00
+	endm
+
+__enum__ = __enum__ + 3
+
+	enum movement_turn_step
+turn_step: macro
+	db movement_turn_step | \1 ; $04
+	endm
+
+__enum__ = __enum__ + 3
+
+	enum movement_slow_step
+slow_step: macro
+	db movement_slow_step | \1; $08
+	endm
+
+__enum__ = __enum__ + 3
+
+	enum movement_step
+step: macro
+	db movement_step | \1 ; $0c
+	endm
+
+__enum__ = __enum__ + 3
+
+	enum movement_big_step
+big_step: macro
+	db movement_big_step | \1 ; $10
+	endm
+
+__enum__ = __enum__ + 3
+
+	enum movement_slow_slide_step
+slow_slide_step: macro
+	db movement_slow_slide_step | \1 ; $14
+	endm
+
+__enum__ = __enum__ + 3
+
+	enum movement_slide_step
+slide_step: macro
+	db movement_slide_step | \1 ; $18
+	endm
+
+__enum__ = __enum__ + 3
+
+	enum movement_fast_slide_step
+fast_slide_step: macro
+	db movement_fast_slide_step | \1 ; $1c
+	endm
+
+__enum__ = __enum__ + 3
+
+	enum movement_turn_away
+turn_away: macro
+	db movement_turn_away | \1 ; $20
+	endm
+
+__enum__ = __enum__ + 3
+
+	enum movement_turn_in
+turn_in: macro
+	db movement_turn_in | \1 ; $24
+	endm
+
+__enum__ = __enum__ + 3
+
+	enum movement_turn_waterfall
+turn_waterfall: macro
+	db movement_turn_waterfall | \1 ; $28
+	endm
+
+__enum__ = __enum__ + 3
+
+	enum movement_slow_jump_step
+slow_jump_step: macro
+	db movement_slow_jump_step | \1 ; $2c
+	endm
+
+__enum__ = __enum__ + 3
+
+	enum movement_jump_step
+jump_step: macro
+	db movement_jump_step | \1 ; $30
+	endm
+
+__enum__ = __enum__ + 3
+
+	enum movement_fast_jump_step
+fast_jump_step: macro
+	db movement_fast_jump_step | \1 ; $34
+	endm
+
+__enum__ = __enum__ + 3
+
+; Control
+	enum movement_remove_sliding
+remove_sliding: macro
+	db movement_remove_sliding ; $38
+	endm
+
+	enum movement_set_sliding
+set_sliding: macro
+	db movement_set_sliding ; $39
+	endm
+
+	enum movement_remove_fixed_facing
+remove_fixed_facing: macro
+	db movement_remove_fixed_facing ; $3a
+	endm
+
+	enum movement_fix_facing
+fix_facing: macro
+	db movement_fix_facing ; $3b
+	endm
+
+	enum movement_show_person
+show_person: macro
+	db movement_show_person ; $3c
+	endm
+
+	enum movement_hide_person
+hide_person: macro
+	db movement_hide_person ; $3d
+	endm
+
+; Sleep
+
+	enum movement_step_sleep
+step_sleep: macro
+if \1 <= 8
+	db movement_step_sleep + \1 - 1
+else
+	db movement_step_sleep + 8, \1
+endc
+endm
+
+__enum__ = __enum__ + 8
+
+	enum movement_step_end
+step_end: macro
+	db movement_step_end ; $47
+	endm
+
+; Whatever Movement_48 is, it takes a one-byte parameter
+	enum movement_step_48
+step_48: macro
+	db movement_step_48
+	db \1
+	endm
+
+	enum movement_remove_person
+remove_person: macro
+	db movement_remove_person ; $49
+	endm
+
+	enum movement_step_loop
+step_loop: macro
+	db movement_step_loop ; $4a
+	endm
+
+	enum movement_step_4b
+step_4b: macro
+	db movement_step_4b ; $4b
+	endm
+
+	enum movement_teleport_from
+teleport_from: macro
+	db movement_teleport_from ; $4c
+	endm
+
+	enum movement_teleport_to
+teleport_to: macro
+	db movement_teleport_to ; $4d
+	endm
+
+	enum movement_skyfall
+skyfall: macro
+	db movement_skyfall ; $4e
+	endm
+
+	enum movement_step_dig
+step_dig: macro
+	db movement_step_dig ; $4f
+	db \1
+	endm
+
+	enum movement_step_bump
+step_bump: macro
+	db movement_step_bump ; $50
+	endm
+
+	enum movement_fish_got_bite
+fish_got_bite: macro
+	db movement_fish_got_bite ; $51
+	endm
+
+	enum movement_fish_cast_rod
+fish_cast_rod: macro
+	db movement_fish_cast_rod ; $52
+	endm
+
+	enum movement_hide_emote
+hide_emote: macro
+	db movement_hide_emote ; $53
+	endm
+
+	enum movement_show_emote
+show_emote: macro
+	db movement_show_emote ; $54
+	endm
+
+	enum movement_step_shake
+step_shake: macro
+	db movement_step_shake ; $55
+	db \1 ; displacement
+	endm
+
+	enum movement_tree_shake
+tree_shake: macro
+	db movement_tree_shake
+	endm
+
+	enum movement_rock_smash
+rock_smash: macro
+	db movement_rock_smash ; $57
+	db \1
+	endm
+
+	enum movement_return_dig
+return_dig: macro
+	db movement_return_dig ; $58
+	db \1
+	endm
+
+	enum movement_skyfall_top
+skyfall_top: macro
+	db movement_skyfall_top ; $59
+	endm
--- /dev/null
+++ b/macros/scripts/text.asm
@@ -1,0 +1,133 @@
+text   EQUS "db $00," ; Start writing text.
+next   EQUS "db $4e," ; Move a line down.
+line   EQUS "db $4f," ; Start writing at the bottom line.
+page   EQUS "db $50," ; Start a new Pokédex page.
+para   EQUS "db $51," ; Start a new paragraph.
+cont   EQUS "db $55," ; Scroll to the next line.
+done   EQUS "db $57"  ; End a text box.
+prompt EQUS "db $58"  ; Prompt the player to end a text box (initiating some other event).
+
+; TextCommands indexes (see home/text.asm)
+	enum_start $01
+
+	enum TX_RAM
+text_from_ram: MACRO
+	db TX_RAM
+	dw \1
+	ENDM
+
+	enum TX_BCD
+text_bcd: macro
+	db TX_BCD
+	dw \1
+	db \2
+	ENDM
+
+	enum TX_MOVE
+text_move: macro
+	db TX_MOVE
+	dw \1
+	ENDM
+
+	enum TX_BOX
+text_box: macro
+	db TX_BOX
+	dw \1
+	db \2, \3
+	ENDM
+
+	enum TX_LOW
+text_low: macro
+	db TX_LOW
+	endm
+
+	enum WAIT_BUTTON
+text_waitbutton: macro
+	db WAIT_BUTTON
+	endm
+
+	enum TX_SCROLL
+text_scroll: macro
+	db TX_SCROLL
+	endm
+
+	enum START_ASM
+start_asm: macro
+	db START_ASM
+	endm
+
+	enum TX_NUM
+deciram: macro
+	db TX_NUM
+	dw \1 ; address
+	dn \2, \3 ; bytes, digits
+	endm
+
+	enum TX_EXIT
+interpret_data: macro
+	db TX_EXIT
+	endm
+
+	enum TX_SOUND_0B
+sound_dex_fanfare_50_79: macro
+	db TX_SOUND_0B
+	endm
+
+	enum TX_DOTS
+limited_interpret_data: macro
+	db TX_DOTS
+	db \1
+	endm
+
+	enum TX_LINK_WAIT_BUTTON
+link_wait_button: macro
+	db TX_LINK_WAIT_BUTTON
+	endm
+
+	enum TX_SOUND_0E
+sound_dex_fanfare_20_49: macro
+	db TX_SOUND_0E
+	endm
+
+	enum TX_SOUND_0F
+sound_item: macro
+	db TX_SOUND_0F
+	endm
+
+	enum TX_SOUND_10
+sound_caught_mon: macro
+	db TX_SOUND_10
+	endm
+
+	enum TX_SOUND_11
+sound_dex_fanfare_80_109: macro
+	db TX_SOUND_11
+	endm
+
+	enum TX_SOUND_12
+sound_fanfare: macro
+	db TX_SOUND_12
+	endm
+
+	enum TX_SOUND_13
+sound_slot_machine_start: macro
+	db TX_SOUND_13
+	endm
+
+	enum TX_STRINGBUFFER
+text_buffer: macro
+	db TX_STRINGBUFFER
+	db \1
+	endm
+
+	enum TX_DAY
+current_day: macro
+	db TX_DAY
+	endm
+
+	enum TX_FAR
+text_jump: MACRO
+	db TX_FAR
+	dw \1
+	db BANK(\1)
+	ENDM
--- /dev/null
+++ b/macros/scripts/trade_anim.asm
@@ -1,0 +1,255 @@
+; DoTradeAnimation.JumpTable indexes (see engine/trade/animation.asm)
+	enum_start
+
+	enum tradeanim_next_command
+tradeanim_next: macro
+	db tradeanim_next_command ; 00
+endm
+
+	enum tradeanim_show_givemon_data_command
+tradeanim_show_givemon_data: macro
+	db tradeanim_show_givemon_data_command ; 01
+endm
+
+	enum tradeanim_show_getmon_data_command
+tradeanim_show_getmon_data: macro
+	db tradeanim_show_getmon_data_command ; 02
+endm
+
+	enum tradeanim_enter_link_tube_command
+tradeanim_enter_link_tube: macro
+	db tradeanim_enter_link_tube_command ; 03
+endm
+
+__enum__ set $5
+
+	enum tradeanim_exit_link_tube_command
+tradeanim_exit_link_tube: macro
+	db tradeanim_exit_link_tube_command ; 05
+endm
+
+	enum tradeanim_tube_to_ot_command
+tradeanim_tube_to_ot: macro
+	db tradeanim_tube_to_ot_command ; 06
+endm
+
+__enum__ set $e
+
+	enum tradeanim_tube_to_player_command
+tradeanim_tube_to_player: macro
+	db tradeanim_tube_to_player_command ; 0e
+endm
+
+__enum__ set $16
+
+	enum tradeanim_sent_to_ot_text_command
+tradeanim_sent_to_ot_text: macro
+	db tradeanim_sent_to_ot_text_command ; 16
+endm
+
+	enum tradeanim_ot_bids_farewell_command
+tradeanim_ot_bids_farewell: macro
+	db tradeanim_ot_bids_farewell_command ; 17
+endm
+
+	enum tradeanim_take_care_of_text_command
+tradeanim_take_care_of_text: macro
+	db tradeanim_take_care_of_text_command ; 18
+endm
+
+	enum tradeanim_ot_sends_text_1_command
+tradeanim_ot_sends_text_1: macro
+	db tradeanim_ot_sends_text_1_command ; 19
+endm
+
+	enum tradeanim_ot_sends_text_2_command
+tradeanim_ot_sends_text_2: macro
+	db tradeanim_ot_sends_text_2_command ; 1a
+endm
+
+	enum tradeanim_setup_givemon_scroll_command
+tradeanim_setup_givemon_scroll: macro
+	db tradeanim_setup_givemon_scroll_command ; 1b
+endm
+
+	enum tradeanim_do_givemon_scroll_command
+tradeanim_do_givemon_scroll: macro
+	db tradeanim_do_givemon_scroll_command ; 1c
+endm
+
+	enum tradeanim_frontpic_scroll_command
+tradeanim_frontpic_scroll: macro
+	db tradeanim_frontpic_scroll_command ; 1d
+endm
+
+	enum tradeanim_textbox_scroll_command
+tradeanim_textbox_scroll: macro
+	db tradeanim_textbox_scroll_command ; 1e
+endm
+
+	enum tradeanim_scroll_out_right_command
+tradeanim_scroll_out_right: macro
+	db tradeanim_scroll_out_right_command ; 1f
+endm
+
+__enum__ set $21
+
+	enum tradeanim_wait_80_command
+tradeanim_wait_80: macro
+	db tradeanim_wait_80_command ; 21
+endm
+
+	enum tradeanim_wait_40_command
+tradeanim_wait_40: macro
+	db tradeanim_wait_40_command ; 22
+endm
+
+	enum tradeanim_rocking_ball_command
+tradeanim_rocking_ball: macro
+	db tradeanim_rocking_ball_command ; 23
+endm
+
+	enum tradeanim_drop_ball_command
+tradeanim_drop_ball: macro
+	db tradeanim_drop_ball_command ; 24
+endm
+
+	enum tradeanim_wait_anim_command
+tradeanim_wait_anim: macro
+	db tradeanim_wait_anim_command ; 25
+endm
+
+__enum__ set $27
+
+	enum tradeanim_poof_command
+tradeanim_poof: macro
+	db tradeanim_poof_command ; 27
+endm
+
+	enum tradeanim_bulge_through_tube_command
+tradeanim_bulge_through_tube: macro
+	db tradeanim_bulge_through_tube_command ; 28
+endm
+
+	enum tradeanim_give_trademon_sfx_command
+tradeanim_give_trademon_sfx: macro
+	db tradeanim_give_trademon_sfx_command ; 29
+endm
+
+	enum tradeanim_get_trademon_sfx_command
+tradeanim_get_trademon_sfx: macro
+	db tradeanim_get_trademon_sfx_command ; 2a
+endm
+
+	enum tradeanim_end_command
+tradeanim_end: macro
+	db tradeanim_end_command ; 2b
+endm
+
+	enum tradeanim_animate_frontpic_command
+tradeanim_animate_frontpic: macro
+	db tradeanim_animate_frontpic_command ; 2c
+endm
+
+	enum tradeanim_wait_96_command
+tradeanim_wait_96: macro
+	db tradeanim_wait_96_command ; 2d
+endm
+
+	enum tradeanim_wait_80_if_ot_egg_command
+tradeanim_wait_80_if_ot_egg: macro
+	db tradeanim_wait_80_if_ot_egg_command ; 2e
+endm
+
+	enum tradeanim_wait_180_if_ot_egg_command
+tradeanim_wait_180_if_ot_egg: macro
+	db tradeanim_wait_180_if_ot_egg_command ; 2f
+endm
+
+
+; Mobile
+	enum_start 1
+
+	enum mobiletradeanim_showgivemon_command
+mobiletradeanim_showgivemon: macro
+	db mobiletradeanim_showgivemon_command ; 01
+endm
+
+	enum mobiletradeanim_02_command
+mobiletradeanim_02: macro
+	db mobiletradeanim_02_command ; 02
+endm
+
+	enum mobiletradeanim_sendmon_command
+mobiletradeanim_sendmon: macro
+	db mobiletradeanim_sendmon_command ; 03
+endm
+
+__enum__ set $05
+
+	enum mobiletradeanim_05_command
+mobiletradeanim_05: macro
+	db mobiletradeanim_05_command ; 05
+endm
+
+	enum mobiletradeanim_06_command
+mobiletradeanim_06: macro
+	db mobiletradeanim_06_command ; 06
+endm
+
+	enum mobiletradeanim_07_command
+mobiletradeanim_07: macro
+	db mobiletradeanim_07_command ; 07
+endm
+
+	enum mobiletradeanim_receivemon_command
+mobiletradeanim_receivemon: macro
+	db mobiletradeanim_receivemon_command ; 08
+endm
+
+__enum__ set $0b
+
+	enum mobiletradeanim_showgetmon_command
+mobiletradeanim_showgetmon: macro
+	db mobiletradeanim_showgetmon_command ; 0b
+endm
+
+	enum mobiletradeanim_end_command
+mobiletradeanim_end: macro
+	db mobiletradeanim_end_command ; 0c
+endm
+
+	enum mobiletradeanim_showgtsgivemon_command
+mobiletradeanim_showgtsgivemon: macro
+	db mobiletradeanim_showgtsgivemon_command ; 0d
+endm
+
+	enum mobiletradeanim_showgtsgetmon_command
+mobiletradeanim_showgtsgetmon: macro
+	db mobiletradeanim_showgtsgetmon_command ; 0e
+endm
+
+	enum mobiletradeanim_0f_command
+mobiletradeanim_0f: macro
+	db mobiletradeanim_0f_command ; 0f
+endm
+
+	enum mobiletradeanim_10_command
+mobiletradeanim_10: macro
+	db mobiletradeanim_10_command ; 10
+endm
+
+	enum mobiletradeanim_11_command
+mobiletradeanim_11: macro
+	db mobiletradeanim_11_command ; 11
+endm
+
+	enum mobiletradeanim_12_command
+mobiletradeanim_12: macro
+	db mobiletradeanim_12_command ; 12
+endm
+
+	enum mobiletradeanim_showoddegg_command
+mobiletradeanim_showoddegg: macro
+	db mobiletradeanim_showoddegg_command ; 13
+endm
--- a/macros/sound.asm
+++ /dev/null
@@ -1,265 +1,0 @@
-note: MACRO
-	dn (\1), (\2) - 1
-	ENDM
-
-sound: macro
-	note \1, \2
-	db \3 ; intensity
-	dw \4 ; frequency
-	endm
-
-noise: macro
-	note \1, \2 ; duration
-	db \3 ; intensity
-	db \4 ; frequency
-	endm
-
-musicheader: macro
-	; number of tracks, track idx, address
-	dbw ((\1 - 1) << 6) + (\2 - 1), \3
-	endm
-
-cry_header: macro
-	dw \1, \2, \3
-	endm
-
-; MusicCommands indexes (see audio/engine.asm)
-	enum_start $d8
-
-	enum notetype_cmd
-octave: macro
-	db notetype_cmd - (\1)
-	endm
-
-notetype: macro
-	db notetype_cmd
-	db \1 ; note_length
-	if _NARG >= 2
-	db \2 ; intensity
-	endc
-	endm
-
-	enum pitchoffset_cmd
-pitchoffset: macro
-	db pitchoffset_cmd
-	dn \1, \2 - 1 ; octave, key
-	endm
-
-	enum tempo_cmd
-tempo: macro
-	db tempo_cmd
-	bigdw \1 ; tempo
-	endm
-
-	enum dutycycle_cmd
-dutycycle: macro
-	db dutycycle_cmd
-	db \1 ; duty_cycle
-	endm
-
-	enum intensity_cmd
-intensity: macro
-	db intensity_cmd
-	db \1 ; intensity
-	endm
-
-	enum soundinput_cmd
-soundinput: macro
-	db soundinput_cmd
-	db \1 ; input
-	endm
-
-	enum sound_duty_cmd
-sound_duty: macro
-	db sound_duty_cmd
-	db \1 | (\2 << 2) | (\3 << 4) | (\4 << 6) ; duty sequence
-	endm
-
-	enum togglesfx_cmd
-togglesfx: macro
-	db togglesfx_cmd
-	endm
-
-	enum slidepitchto_cmd
-slidepitchto: macro
-	db slidepitchto_cmd
-	db \1 - 1 ; duration
-	dn \2, \3 ; octave, pitch
-	endm
-
-	enum vibrato_cmd
-vibrato: macro
-	db vibrato_cmd
-	db \1 ; delay
-	db \2 ; extent
-	endm
-
-	enum unknownmusic0xe2_cmd
-unknownmusic0xe2: macro
-	db unknownmusic0xe2_cmd
-	db \1 ; unknown
-	endm
-
-	enum togglenoise_cmd
-togglenoise: macro
-	db togglenoise_cmd
-	db \1 ; id
-	endm
-
-	enum panning_cmd
-panning: macro
-	db panning_cmd
-	db \1 ; tracks
-	endm
-
-	enum volume_cmd
-volume: macro
-	db volume_cmd
-	db \1 ; volume
-	endm
-
-	enum tone_cmd
-tone: macro
-	db tone_cmd
-	bigdw \1 ; tone
-	endm
-
-	enum unknownmusic0xe7_cmd
-unknownmusic0xe7: macro
-	db unknownmusic0xe7_cmd
-	db \1 ; unknown
-	endm
-
-	enum unknownmusic0xe8_cmd
-unknownmusic0xe8: macro
-	db unknownmusic0xe8_cmd
-	db \1 ; unknown
-	endm
-
-	enum tempo_relative_cmd
-tempo_relative: macro
-	db tempo_relative_cmd
-	bigdw \1 ; value
-	endm
-
-	enum restartchannel_cmd
-restartchannel: macro
-	db restartchannel_cmd
-	dw \1 ; address
-	endm
-
-	enum newsong_cmd
-newsong: macro
-	db newsong_cmd
-	bigdw \1 ; id
-	endm
-
-	enum sfxpriorityon_cmd
-sfxpriorityon: macro
-	db sfxpriorityon_cmd
-	endm
-
-	enum sfxpriorityoff_cmd
-sfxpriorityoff: macro
-	db sfxpriorityoff_cmd
-	endm
-
-	enum unknownmusic0xee_cmd
-unknownmusic0xee: macro
-	db unknownmusic0xee_cmd
-	dw \1 ; address
-	endm
-
-	enum stereopanning_cmd
-stereopanning: macro
-	db stereopanning_cmd
-	db \1 ; tracks
-	endm
-
-	enum sfxtogglenoise_cmd
-sfxtogglenoise: macro
-	db sfxtogglenoise_cmd
-	db \1 ; id
-	endm
-
-	enum music0xf1_cmd
-music0xf1: macro
-	db music0xf1_cmd
-	endm
-
-	enum music0xf2_cmd
-music0xf2: macro
-	db music0xf2_cmd
-	endm
-
-	enum music0xf3_cmd
-music0xf3: macro
-	db music0xf3_cmd
-	endm
-
-	enum music0xf4_cmd
-music0xf4: macro
-	db music0xf4_cmd
-	endm
-
-	enum music0xf5_cmd
-music0xf5: macro
-	db music0xf5_cmd
-	endm
-
-	enum music0xf6_cmd
-music0xf6: macro
-	db music0xf6_cmd
-	endm
-
-	enum music0xf7_cmd
-music0xf7: macro
-	db music0xf7_cmd
-	endm
-
-	enum music0xf8_cmd
-music0xf8: macro
-	db music0xf8_cmd
-	endm
-
-	enum unknownmusic0xf9_cmd
-unknownmusic0xf9: macro
-	db unknownmusic0xf9_cmd
-	endm
-
-	enum setcondition_cmd
-setcondition: macro
-	db setcondition_cmd
-	db \1 ; condition
-	endm
-
-	enum jumpif_cmd
-jumpif: macro
-	db jumpif_cmd
-	db \1 ; condition
-	dw \2 ; address
-	endm
-
-	enum jumpchannel_cmd
-jumpchannel: macro
-	db jumpchannel_cmd
-	dw \1 ; address
-	endm
-
-	enum loopchannel_cmd
-loopchannel: macro
-	db loopchannel_cmd
-	db \1 ; count
-	dw \2 ; address
-	endm
-
-	enum callchannel_cmd
-callchannel: macro
-	db callchannel_cmd
-	dw \1 ; address
-	endm
-
-	enum endchannel_cmd
-endchannel: macro
-	db endchannel_cmd
-	endm
--- a/macros/text.asm
+++ /dev/null
@@ -1,133 +1,0 @@
-text   EQUS "db $00," ; Start writing text.
-next   EQUS "db $4e," ; Move a line down.
-line   EQUS "db $4f," ; Start writing at the bottom line.
-page   EQUS "db $50," ; Start a new Pokédex page.
-para   EQUS "db $51," ; Start a new paragraph.
-cont   EQUS "db $55," ; Scroll to the next line.
-done   EQUS "db $57"  ; End a text box.
-prompt EQUS "db $58"  ; Prompt the player to end a text box (initiating some other event).
-
-; TextCommands indexes (see home/text.asm)
-	enum_start $01
-
-	enum TX_RAM
-text_from_ram: MACRO
-	db TX_RAM
-	dw \1
-	ENDM
-
-	enum TX_BCD
-text_bcd: macro
-	db TX_BCD
-	dw \1
-	db \2
-	ENDM
-
-	enum TX_MOVE
-text_move: macro
-	db TX_MOVE
-	dw \1
-	ENDM
-
-	enum TX_BOX
-text_box: macro
-	db TX_BOX
-	dw \1
-	db \2, \3
-	ENDM
-
-	enum TX_LOW
-text_low: macro
-	db TX_LOW
-	endm
-
-	enum WAIT_BUTTON
-text_waitbutton: macro
-	db WAIT_BUTTON
-	endm
-
-	enum TX_SCROLL
-text_scroll: macro
-	db TX_SCROLL
-	endm
-
-	enum START_ASM
-start_asm: macro
-	db START_ASM
-	endm
-
-	enum TX_NUM
-deciram: macro
-	db TX_NUM
-	dw \1 ; address
-	dn \2, \3 ; bytes, digits
-	endm
-
-	enum TX_EXIT
-interpret_data: macro
-	db TX_EXIT
-	endm
-
-	enum TX_SOUND_0B
-sound_dex_fanfare_50_79: macro
-	db TX_SOUND_0B
-	endm
-
-	enum TX_DOTS
-limited_interpret_data: macro
-	db TX_DOTS
-	db \1
-	endm
-
-	enum TX_LINK_WAIT_BUTTON
-link_wait_button: macro
-	db TX_LINK_WAIT_BUTTON
-	endm
-
-	enum TX_SOUND_0E
-sound_dex_fanfare_20_49: macro
-	db TX_SOUND_0E
-	endm
-
-	enum TX_SOUND_0F
-sound_item: macro
-	db TX_SOUND_0F
-	endm
-
-	enum TX_SOUND_10
-sound_caught_mon: macro
-	db TX_SOUND_10
-	endm
-
-	enum TX_SOUND_11
-sound_dex_fanfare_80_109: macro
-	db TX_SOUND_11
-	endm
-
-	enum TX_SOUND_12
-sound_fanfare: macro
-	db TX_SOUND_12
-	endm
-
-	enum TX_SOUND_13
-sound_slot_machine_start: macro
-	db TX_SOUND_13
-	endm
-
-	enum TX_STRINGBUFFER
-text_buffer: macro
-	db TX_STRINGBUFFER
-	db \1
-	endm
-
-	enum TX_DAY
-current_day: macro
-	db TX_DAY
-	endm
-
-	enum TX_FAR
-text_jump: MACRO
-	db TX_FAR
-	dw \1
-	db BANK(\1)
-	ENDM
--- a/macros/tilesets.asm
+++ b/macros/tilesets.asm
@@ -1,3 +1,5 @@
+; Used in tilesets/*.asm
+
 tilepal: MACRO
 ; vram bank, pals
 x = \1 << OAM_TILE_BANK
--- a/macros/trade_anim.asm
+++ /dev/null
@@ -1,255 +1,0 @@
-; DoTradeAnimation.JumpTable indexes (see engine/trade/animation.asm)
-	enum_start
-
-	enum tradeanim_next_command
-tradeanim_next: macro
-	db tradeanim_next_command ; 00
-endm
-
-	enum tradeanim_show_givemon_data_command
-tradeanim_show_givemon_data: macro
-	db tradeanim_show_givemon_data_command ; 01
-endm
-
-	enum tradeanim_show_getmon_data_command
-tradeanim_show_getmon_data: macro
-	db tradeanim_show_getmon_data_command ; 02
-endm
-
-	enum tradeanim_enter_link_tube_command
-tradeanim_enter_link_tube: macro
-	db tradeanim_enter_link_tube_command ; 03
-endm
-
-__enum__ set $5
-
-	enum tradeanim_exit_link_tube_command
-tradeanim_exit_link_tube: macro
-	db tradeanim_exit_link_tube_command ; 05
-endm
-
-	enum tradeanim_tube_to_ot_command
-tradeanim_tube_to_ot: macro
-	db tradeanim_tube_to_ot_command ; 06
-endm
-
-__enum__ set $e
-
-	enum tradeanim_tube_to_player_command
-tradeanim_tube_to_player: macro
-	db tradeanim_tube_to_player_command ; 0e
-endm
-
-__enum__ set $16
-
-	enum tradeanim_sent_to_ot_text_command
-tradeanim_sent_to_ot_text: macro
-	db tradeanim_sent_to_ot_text_command ; 16
-endm
-
-	enum tradeanim_ot_bids_farewell_command
-tradeanim_ot_bids_farewell: macro
-	db tradeanim_ot_bids_farewell_command ; 17
-endm
-
-	enum tradeanim_take_care_of_text_command
-tradeanim_take_care_of_text: macro
-	db tradeanim_take_care_of_text_command ; 18
-endm
-
-	enum tradeanim_ot_sends_text_1_command
-tradeanim_ot_sends_text_1: macro
-	db tradeanim_ot_sends_text_1_command ; 19
-endm
-
-	enum tradeanim_ot_sends_text_2_command
-tradeanim_ot_sends_text_2: macro
-	db tradeanim_ot_sends_text_2_command ; 1a
-endm
-
-	enum tradeanim_setup_givemon_scroll_command
-tradeanim_setup_givemon_scroll: macro
-	db tradeanim_setup_givemon_scroll_command ; 1b
-endm
-
-	enum tradeanim_do_givemon_scroll_command
-tradeanim_do_givemon_scroll: macro
-	db tradeanim_do_givemon_scroll_command ; 1c
-endm
-
-	enum tradeanim_frontpic_scroll_command
-tradeanim_frontpic_scroll: macro
-	db tradeanim_frontpic_scroll_command ; 1d
-endm
-
-	enum tradeanim_textbox_scroll_command
-tradeanim_textbox_scroll: macro
-	db tradeanim_textbox_scroll_command ; 1e
-endm
-
-	enum tradeanim_scroll_out_right_command
-tradeanim_scroll_out_right: macro
-	db tradeanim_scroll_out_right_command ; 1f
-endm
-
-__enum__ set $21
-
-	enum tradeanim_wait_80_command
-tradeanim_wait_80: macro
-	db tradeanim_wait_80_command ; 21
-endm
-
-	enum tradeanim_wait_40_command
-tradeanim_wait_40: macro
-	db tradeanim_wait_40_command ; 22
-endm
-
-	enum tradeanim_rocking_ball_command
-tradeanim_rocking_ball: macro
-	db tradeanim_rocking_ball_command ; 23
-endm
-
-	enum tradeanim_drop_ball_command
-tradeanim_drop_ball: macro
-	db tradeanim_drop_ball_command ; 24
-endm
-
-	enum tradeanim_wait_anim_command
-tradeanim_wait_anim: macro
-	db tradeanim_wait_anim_command ; 25
-endm
-
-__enum__ set $27
-
-	enum tradeanim_poof_command
-tradeanim_poof: macro
-	db tradeanim_poof_command ; 27
-endm
-
-	enum tradeanim_bulge_through_tube_command
-tradeanim_bulge_through_tube: macro
-	db tradeanim_bulge_through_tube_command ; 28
-endm
-
-	enum tradeanim_give_trademon_sfx_command
-tradeanim_give_trademon_sfx: macro
-	db tradeanim_give_trademon_sfx_command ; 29
-endm
-
-	enum tradeanim_get_trademon_sfx_command
-tradeanim_get_trademon_sfx: macro
-	db tradeanim_get_trademon_sfx_command ; 2a
-endm
-
-	enum tradeanim_end_command
-tradeanim_end: macro
-	db tradeanim_end_command ; 2b
-endm
-
-	enum tradeanim_animate_frontpic_command
-tradeanim_animate_frontpic: macro
-	db tradeanim_animate_frontpic_command ; 2c
-endm
-
-	enum tradeanim_wait_96_command
-tradeanim_wait_96: macro
-	db tradeanim_wait_96_command ; 2d
-endm
-
-	enum tradeanim_wait_80_if_ot_egg_command
-tradeanim_wait_80_if_ot_egg: macro
-	db tradeanim_wait_80_if_ot_egg_command ; 2e
-endm
-
-	enum tradeanim_wait_180_if_ot_egg_command
-tradeanim_wait_180_if_ot_egg: macro
-	db tradeanim_wait_180_if_ot_egg_command ; 2f
-endm
-
-
-; Mobile
-	enum_start 1
-
-	enum mobiletradeanim_showgivemon_command
-mobiletradeanim_showgivemon: macro
-	db mobiletradeanim_showgivemon_command ; 01
-endm
-
-	enum mobiletradeanim_02_command
-mobiletradeanim_02: macro
-	db mobiletradeanim_02_command ; 02
-endm
-
-	enum mobiletradeanim_sendmon_command
-mobiletradeanim_sendmon: macro
-	db mobiletradeanim_sendmon_command ; 03
-endm
-
-__enum__ set $05
-
-	enum mobiletradeanim_05_command
-mobiletradeanim_05: macro
-	db mobiletradeanim_05_command ; 05
-endm
-
-	enum mobiletradeanim_06_command
-mobiletradeanim_06: macro
-	db mobiletradeanim_06_command ; 06
-endm
-
-	enum mobiletradeanim_07_command
-mobiletradeanim_07: macro
-	db mobiletradeanim_07_command ; 07
-endm
-
-	enum mobiletradeanim_receivemon_command
-mobiletradeanim_receivemon: macro
-	db mobiletradeanim_receivemon_command ; 08
-endm
-
-__enum__ set $0b
-
-	enum mobiletradeanim_showgetmon_command
-mobiletradeanim_showgetmon: macro
-	db mobiletradeanim_showgetmon_command ; 0b
-endm
-
-	enum mobiletradeanim_end_command
-mobiletradeanim_end: macro
-	db mobiletradeanim_end_command ; 0c
-endm
-
-	enum mobiletradeanim_showgtsgivemon_command
-mobiletradeanim_showgtsgivemon: macro
-	db mobiletradeanim_showgtsgivemon_command ; 0d
-endm
-
-	enum mobiletradeanim_showgtsgetmon_command
-mobiletradeanim_showgtsgetmon: macro
-	db mobiletradeanim_showgtsgetmon_command ; 0e
-endm
-
-	enum mobiletradeanim_0f_command
-mobiletradeanim_0f: macro
-	db mobiletradeanim_0f_command ; 0f
-endm
-
-	enum mobiletradeanim_10_command
-mobiletradeanim_10: macro
-	db mobiletradeanim_10_command ; 10
-endm
-
-	enum mobiletradeanim_11_command
-mobiletradeanim_11: macro
-	db mobiletradeanim_11_command ; 11
-endm
-
-	enum mobiletradeanim_12_command
-mobiletradeanim_12: macro
-	db mobiletradeanim_12_command ; 12
-endm
-
-	enum mobiletradeanim_showoddegg_command
-mobiletradeanim_showoddegg: macro
-	db mobiletradeanim_showoddegg_command ; 13
-endm
--- a/macros/trainer.asm
+++ /dev/null
@@ -1,11 +1,0 @@
-trainerclass: MACRO
-	enum \1
-const_value = 1
-ENDM
-
-trainer: MACRO
-	; flag, group, id, seen text, win text, lost text, talk-again text
-	dw \1
-	db \2, \3
-	dw \4, \5, \6, \7
-ENDM
--- a/macros/wram.asm
+++ b/macros/wram.asm
@@ -1,3 +1,4 @@
+; Used in wram.asm
 
 flag_array: MACRO
 	ds ((\1) + 7) / 8
@@ -15,7 +16,7 @@
 \1DefExp::         dw
 \1SpdExp::         dw
 \1SpcExp::         dw
-\1DVs::            ds 2
+\1DVs::            dw
 \1PP::             ds NUM_MOVES
 \1Happiness::      db
 \1PokerusStatus::  db
@@ -60,7 +61,7 @@
 \1DefenseExp:: dw
 \1SpeedExp::   dw
 \1SpecialExp:: dw
-\1DVs::        ds 2
+\1DVs::        dw
 \1PP::         ds NUM_MOVES
 ENDM
 
@@ -81,7 +82,7 @@
 \1Item::      db
 \1Moves::     ds NUM_MOVES
 \1MovesEnd::
-\1DVs::       ds 2
+\1DVs::       dw
 \1PP::        ds NUM_MOVES
 \1Happiness:: db
 \1Level::     db
@@ -103,7 +104,7 @@
 
 box: MACRO
 \1::
-\1Count::           ds 1
+\1Count::           db
 \1Species::         ds MONS_PER_BOX + 1
 \1Mons::
 \1Mon1::            box_struct \1Mon1
@@ -134,7 +135,7 @@
 \1FrequencyHi::       db
 \1Pitch::             db ; 0:rest 1-c:note
 \1Octave::            db ; 7-0 (0 is highest)
-\1PitchOffset::    db ; raises existing octaves (to repeat phrases)
+\1PitchOffset::       db ; raises existing octaves (to repeat phrases)
 \1NoteDuration::      db ; frames remaining for the current note
 \1Field0x16::         ds 1 ; c117
                       ds 1 ; c118
@@ -141,7 +142,7 @@
 \1LoopCount::         db
 \1Tempo::             dw
 \1Tracks::            db ; hi:left lo:right
-\1SFXDutyLoop::         ds 1 ; c11d
+\1SFXDutyLoop::       db ; c11d
 \1VibratoDelayCount:: db ; initialized by \1VibratoDelay
 \1VibratoDelay::      db ; number of frames a note plays until vibrato starts
 \1VibratoExtent::     db
@@ -149,7 +150,7 @@
 \1PitchWheelTarget::  dw ; frequency endpoint for pitch wheel
 \1PitchWheelAmount::  db ; c124
 \1PitchWheelAmountFraction::   db ; c125
-\1Field0x25::         ds 1 ; c126
+\1Field0x25::         db ; c126
                       ds 1 ; c127
 \1CryPitch::          dw
 \1Field0x29::         ds 1
@@ -179,43 +180,43 @@
 endm
 
 mailmsg: MACRO
-\1Message:: ds MAIL_MSG_LENGTH
+\1Message::    ds MAIL_MSG_LENGTH
 \1MessageEnd:: ds 1
-\1Author:: ds PLAYER_NAME_LENGTH
+\1Author::     ds PLAYER_NAME_LENGTH
 \1AuthorNationality:: ds 2
-\1AuthorID:: ds 2
-\1Species:: ds 1
-\1Type:: ds 1
+\1AuthorID::   dw
+\1Species::    db
+\1Type::       db
 \1End::
 endm
 
-hof_mon: MACRO
-\1Species:: ds 1
-\1ID:: ds 2
-\1DVs:: ds 2
-\1Level:: ds 1
-\1Nickname:: ds PKMN_NAME_LENGTH +- 1
-\1End::
-endm
-
 roam_struct: MACRO
 \1Species::   db
 \1Level::     db
 \1MapGroup::  db
 \1MapNumber:: db
-\1HP::        ds 1
-\1DVs::       ds 2
+\1HP::        db
+\1DVs::       dw
 ENDM
 
 bugcontestwinner: macro
-\1PersonID:: ds 1
-\1Mon:: ds 1
-\1Score:: ds 2
+\1PersonID:: db
+\1Mon::      db
+\1Score::    dw
 endm
 
+hof_mon: MACRO
+\1Species::  db
+\1ID::       dw
+\1DVs::      dw
+\1Level::    db
+\1Nickname:: ds PKMN_NAME_LENGTH +- 1
+\1End::
+endm
+
 hall_of_fame: MACRO
 \1::
-\1WinCount:: ds 1
+\1WinCount:: db
 \1Mon1:: hof_mon \1Mon1
 \1Mon2:: hof_mon \1Mon2
 \1Mon3:: hof_mon \1Mon3
@@ -225,26 +226,34 @@
 \1End:: ds 1
 ENDM
 
+link_battle_record: MACRO
+\1Name::   ds NAME_LENGTH +- 1
+\1ID::     dw
+\1Wins::   dw
+\1Losses:: dw
+\1Draws::  dw
+ENDM
+
 trademon: MACRO
-\1Species:: ds 1 ; wc6d0 | wc702
+\1Species::     db ; wc6d0 | wc702
 \1SpeciesName:: ds PKMN_NAME_LENGTH ; wc6d1 | wc703
-\1Nickname:: ds PKMN_NAME_LENGTH ; wc6dc | wc70e
-\1SenderName:: ds NAME_LENGTH ; wc6e7 | wc719
-\1OTName:: ds NAME_LENGTH ; wc6f2 | wc724
-\1DVs:: ds 2 ; wc6fd | wc72f
-\1ID:: ds 2 ; wc6ff | wc731
-\1CaughtData:: ds 1 ; wc701 | wc733
+\1Nickname::    ds PKMN_NAME_LENGTH ; wc6dc | wc70e
+\1SenderName::  ds NAME_LENGTH ; wc6e7 | wc719
+\1OTName::      ds NAME_LENGTH ; wc6f2 | wc724
+\1DVs::         dw ; wc6fd | wc72f
+\1ID::          dw ; wc6ff | wc731
+\1CaughtData::  db ; wc701 | wc733
 \1End::
 ENDM
 
 move_struct: MACRO
-\1Animation:: ds 1
-\1Effect:: ds 1
-\1Power:: ds 1
-\1Type:: ds 1
-\1Accuracy:: ds 1
-\1PP:: ds 1
-\1EffectChance:: ds 1
+\1Animation::    db
+\1Effect::       db
+\1Power::        db
+\1Type::         db
+\1Accuracy::     db
+\1PP::           db
+\1EffectChance:: db
 endm
 
 slot_reel: MACRO
@@ -266,38 +275,38 @@
 
 object_struct: MACRO
 \1Struct::
-\1Sprite:: ds 1
-\1MapObjectIndex:: ds 1
-\1SpriteTile:: ds 1
-\1MovementType:: ds 1
-\1Flags:: ds 2
-\1Palette:: ds 1
-\1Walking:: ds 1
-\1Direction:: ds 1
-\1StepType:: ds 1
-\1StepDuration:: ds 1
-\1Action:: ds 1
-\1ObjectStepFrame:: ds 1
-\1Facing:: ds 1
-\1StandingTile:: ds 1 ; collision
-\1LastTile:: ds 1     ; collision
-\1StandingMapX:: ds 1
-\1StandingMapY:: ds 1
-\1LastMapX:: ds 1
-\1LastMapY:: ds 1
-\1ObjectInitX:: ds 1
-\1ObjectInitY:: ds 1
-\1Radius:: ds 1
-\1SpriteX:: ds 1
-\1SpriteY:: ds 1
-\1SpriteXOffset:: ds 1
-\1SpriteYOffset:: ds 1
-\1MovementByteIndex:: ds 1
-\1Object28:: ds 1
-\1Object29:: ds 1
-\1Object30:: ds 1
-\1Object31:: ds 1
-\1Range:: ds 1
+\1Sprite::            db
+\1MapObjectIndex::    db
+\1SpriteTile::        db
+\1MovementType::      db
+\1Flags::             dw
+\1Palette::           db
+\1Walking::           db
+\1Direction::         db
+\1StepType::          db
+\1StepDuration::      db
+\1Action::            db
+\1ObjectStepFrame::   db
+\1Facing::            db
+\1StandingTile::      db ; collision
+\1LastTile::          db ; collision
+\1StandingMapX::      db
+\1StandingMapY::      db
+\1LastMapX::          db
+\1LastMapY::          db
+\1ObjectInitX::       db
+\1ObjectInitY::       db
+\1Radius::            db
+\1SpriteX::           db
+\1SpriteY::           db
+\1SpriteXOffset::     db
+\1SpriteYOffset::     db
+\1MovementByteIndex:: db
+\1Object28::          ds 1
+\1Object29::          ds 1
+\1Object30::          ds 1
+\1Object31::          ds 1
+\1Range::             db
 	ds 7
 \1StructEnd::
 ENDM
@@ -304,71 +313,71 @@
 
 map_object: MACRO
 \1Object::
-\1ObjectStructID::  ds 1
-\1ObjectSprite::    ds 1
-\1ObjectYCoord::    ds 1
-\1ObjectXCoord::    ds 1
-\1ObjectMovement::  ds 1
-\1ObjectRadius::    ds 1
-\1ObjectHour::      ds 1
-\1ObjectTimeOfDay:: ds 1
-\1ObjectColor::     ds 1
-\1ObjectRange::     ds 1
-\1ObjectScript::    ds 2
-\1ObjectEventFlag:: ds 2
+\1ObjectStructID::  db
+\1ObjectSprite::    db
+\1ObjectYCoord::    db
+\1ObjectXCoord::    db
+\1ObjectMovement::  db
+\1ObjectRadius::    db
+\1ObjectHour::      db
+\1ObjectTimeOfDay:: db
+\1ObjectColor::     db
+\1ObjectRange::     db
+\1ObjectScript::    dw
+\1ObjectEventFlag:: dw
 	ds 2
 endm
 
 sprite_anim_struct: MACRO
-\1Index:: ds 1          ; 0
-\1FramesetID:: ds 1     ; 1
-\1AnimSeqID:: ds 1      ; 2
-\1TileID:: ds 1         ; 3
-\1XCoord:: ds 1         ; 4
-\1YCoord:: ds 1         ; 5
-\1XOffset:: ds 1        ; 6
-\1YOffset:: ds 1        ; 7
-\1Duration:: ds 1       ; 8
-\1DurationOffset:: ds 1 ; 9
-\1FrameIndex:: ds 1     ; a
-\1Sprite0b:: ds 1
-\1Sprite0c:: ds 1
-\1Sprite0d:: ds 1
-\1Sprite0e:: ds 1
-\1Sprite0f:: ds 1
+\1Index::          db
+\1FramesetID::     db
+\1AnimSeqID::      db
+\1TileID::         db
+\1XCoord::         db
+\1YCoord::         db
+\1XOffset::        db
+\1YOffset::        db
+\1Duration::       db
+\1DurationOffset:: db
+\1FrameIndex::     db
+\1Sprite0b::       ds 1
+\1Sprite0c::       ds 1
+\1Sprite0d::       ds 1
+\1Sprite0e::       ds 1
+\1Sprite0f::       ds 1
 ENDM
 
 battle_anim_struct: MACRO
 ; Placeholder until we can figure out what it all means
-\1_Index::  ds 1
-\1_Anim01:: ds 1
-\1_Anim02:: ds 1
-\1_FramesetIndex:: ds 1
-\1_FunctionIndex:: ds 1
-\1_Anim05:: ds 1
-\1_TileID:: ds 1
-\1_XCoord:: ds 1
-\1_YCoord:: ds 1
-\1_XOffset:: ds 1
-\1_YOffset:: ds 1
-\1_Anim0b:: ds 1
-\1_Anim0c:: ds 1
-\1_Anim0d:: ds 1
-\1_AnonJumptableIndex:: ds 1
-\1_Anim0f:: ds 1
-\1_Anim10:: ds 1
-\1_Anim11:: ds 1
-\1_Anim12:: ds 1
-\1_Anim13:: ds 1
-\1_Anim14:: ds 1
-\1_Anim15:: ds 1
-\1_Anim16:: ds 1
-\1_Anim17:: ds 1
+\1_Index::              db
+\1_Anim01::             ds 1
+\1_Anim02::             ds 1
+\1_FramesetIndex::      db
+\1_FunctionIndex::      db
+\1_Anim05::             ds 1
+\1_TileID::             db
+\1_XCoord::             db
+\1_YCoord::             db
+\1_XOffset::            db
+\1_YOffset::            db
+\1_Anim0b::             ds 1
+\1_Anim0c::             ds 1
+\1_Anim0d::             ds 1
+\1_AnonJumptableIndex:: db
+\1_Anim0f::             ds 1
+\1_Anim10::             ds 1
+\1_Anim11::             ds 1
+\1_Anim12::             ds 1
+\1_Anim13::             ds 1
+\1_Anim14::             ds 1
+\1_Anim15::             ds 1
+\1_Anim16::             ds 1
+\1_Anim17::             ds 1
 endm
 
 battle_bg_effect: MACRO
-\1_Function:: ds 1
-\1_01:: ds 1
-\1_02:: ds 1
-\1_03:: ds 1
+\1_Function:: db
+\1_01::       ds 1
+\1_02::       ds 1
+\1_03::       ds 1
 endm
--- a/maps/map_headers.asm
+++ b/maps/map_headers.asm
@@ -1,3 +1,20 @@
+map_header: macro
+;\1: map label
+;\2: tileset: a TILESET_* constant
+;\3: permission: TOWN, ROUTE, INDOOR, CAVE, PERM_5, GATE, or DUNGEON
+;\4: location: from constants/landmark_constants.asm
+;\5: music: a MUSIC_* constant
+;\6: phone service flag: 1 to prevent phone calls
+;\7: time of day: a PALETTE_* constant
+;\8: fishing group: a FISHGROUP_* constant
+\1_MapHeader:
+	db BANK(\1_SecondMapHeader), \2, \3
+	dw \1_SecondMapHeader
+	db \4, \5
+	dn \6, \7
+	db \8
+endm
+
 MapGroupPointers::
 ; pointers to the first map header of each map group
 	dw MapGroup_Olivine     ;  1
@@ -26,7 +43,6 @@
 	dw MapGroup_NewBark     ; 24
 	dw MapGroup_Saffron     ; 25
 	dw MapGroup_Cherrygrove ; 26
-
 
 MapGroup_Olivine:
 	map_header OlivinePokecenter1F, TILESET_POKECENTER, INDOOR, OLIVINE_CITY, MUSIC_POKEMON_CENTER, 0, PALETTE_DAY, FISHGROUP_SHORE
--- a/maps/second_map_headers.asm
+++ b/maps/second_map_headers.asm
@@ -1,3 +1,90 @@
+map_header_2: macro
+;\1: map label
+;\2: map id
+;\3: border block
+;\4: connections: sum of NORTH, SOUTH, WEST, and/or EAST, or 0 for none
+\1_SecondMapHeader::
+	db \3
+	db \2_HEIGHT, \2_WIDTH
+	db BANK(\1_BlockData)
+	dw \1_BlockData
+	db BANK(\1_MapScriptHeader)
+	dw \1_MapScriptHeader
+	dw \1_MapEventHeader
+	db \4
+endm
+
+connection: macro
+if "\1" == "north"
+;\2: map id
+;\3: map label (eventually will be rolled into map id)
+;\4: x
+;\5: offset?
+;\6: strip length
+;\7: this map id
+	map \2
+	dw \3_BlockData + \2_WIDTH * (\2_HEIGHT - 3) + \5
+	dw OverworldMap + \4 + 3
+	db \6
+	db \2_WIDTH
+	db \2_HEIGHT * 2 - 1
+	db (\4 - \5) * -2
+	dw OverworldMap + \2_HEIGHT * (\2_WIDTH + 6) + 1
+endc
+
+if "\1" == "south"
+;\2: map id
+;\3: map label (eventually will be rolled into map id)
+;\4: x
+;\5: offset?
+;\6: strip length
+;\7: this map id
+	map \2
+	dw \3_BlockData + \5
+	dw OverworldMap + (\7_HEIGHT + 3) * (\7_WIDTH + 6) + \4 + 3
+	db \6
+	db \2_WIDTH
+	db 0
+	db (\4 - \5) * -2
+	dw OverworldMap + \2_WIDTH + 7
+endc
+
+if "\1" == "west"
+;\2: map id
+;\3: map label (eventually will be rolled into map id)
+;\4: y
+;\5: offset?
+;\6: strip length
+;\7: this map id
+	map \2
+	dw \3_BlockData + (\2_WIDTH * \5) + \2_WIDTH - 3
+	dw OverworldMap + (\7_WIDTH + 6) * (\4 + 3)
+	db \6
+	db \2_WIDTH
+	db (\4 - \5) * -2
+	db \2_WIDTH * 2 - 1
+	dw OverworldMap + \2_WIDTH * 2 + 6
+endc
+
+if "\1" == "east"
+;\2: map id
+;\3: map label (eventually will be rolled into map id)
+;\4: y
+;\5: offset?
+;\6: strip length
+;\7: this map id
+	map \2
+	dw \3_BlockData + (\2_WIDTH * \5)
+	dw OverworldMap + (\7_WIDTH + 6) * (\4 + 3 + 1) - 3
+	db \6
+	db \2_WIDTH
+	db (\4 - \5) * -2
+	db 0
+	dw OverworldMap + \2_WIDTH + 7
+endc
+endm
+
+
 	map_header_2 NewBarkTown, NEW_BARK_TOWN, $5, WEST | EAST
 	connection west, ROUTE_29, Route29, 0, 0, 9, NEW_BARK_TOWN
 	connection east, ROUTE_27, Route27, 0, 0, 9, NEW_BARK_TOWN
--- a/sram.asm
+++ b/sram.asm
@@ -130,13 +130,7 @@
 sLinkBattleWins::   ds 2
 sLinkBattleLosses:: ds 2 ; b262
 sLinkBattleDraws::  ds 2 ; b264
-link_battle_record: MACRO
-\1Name:: ds NAME_LENGTH +- 1
-\1ID:: ds 2
-\1Wins:: ds 2
-\1Losses:: ds 2
-\1Draws:: ds 2
-endm
+
 sLinkBattleRecord::
 sLinkBattleRecord1:: link_battle_record sLinkBattleRecord1
 sLinkBattleRecord2:: link_battle_record sLinkBattleRecord2