shithub: pokecrystal

Download patch

ref: 1ecfe6bd23bb9b4e1886342c082bd5c3a108abbb
parent: 1fbe471b74908be6e89777857bf7407ef427225b
parent: d6fbdfb8decf6231d6b43fbfcba63f9ce60308dc
author: Bryan Bishop <kanzure@gmail.com>
date: Fri Jun 27 17:33:08 EDT 2014

Merge pull request #256 from yenatch/master

Fix predefs and battle code.

--- a/Makefile
+++ b/Makefile
@@ -5,14 +5,13 @@
 .PHONY: all clean crystal pngs
 .SECONDEXPANSION:
 
-POKEMONTOOLS := extras/pokemontools
-GFX          := $(PYTHON) $(POKEMONTOOLS)/gfx.py
-INCLUDES     := $(PYTHON) $(POKEMONTOOLS)/scan_includes.py
-PREPROCESS   := $(PYTHON) prequeue.py
+poketools := extras/pokemontools
+gfx       := $(PYTHON) $(poketools)/gfx.py
+includes  := $(PYTHON) $(poketools)/scan_includes.py
+pre       := $(PYTHON) prequeue.py
 
-TEXTQUEUE :=
 
-CRYSTAL_OBJS := \
+crystal_obj := \
 wram.o \
 main.o \
 lib/mobile/main.o \
@@ -29,20 +28,21 @@
 misc/crystal_misc.o \
 gfx/pics.o
 
-OBJS := $(CRYSTAL_OBJS)
+all_obj := $(crystal_obj)
 
-ROMS := pokecrystal.gbc
-
 # object dependencies
-$(shell $(foreach obj, $(OBJS), $(eval $(obj:.o=)_DEPENDENCIES := $(shell $(INCLUDES) $(obj:.o=.asm)))))
+$(foreach obj, $(all_obj), \
+	$(eval $(obj:.o=)_dep := $(shell $(includes) $(obj:.o=.asm))) \
+)
 
-all: $(ROMS)
 
+roms := pokecrystal.gbc
+
+all: $(roms)
 crystal: pokecrystal.gbc
 
 clean:
-	rm -f $(ROMS)
-	rm -f $(OBJS)
+	rm -f $(roms) $(all_obj)
 	find -iname '*.tx' -exec rm {} +
 
 baserom.gbc: ;
@@ -50,16 +50,16 @@
 
 
 %.asm: ;
-.asm.tx:
-	$(eval TEXTQUEUE += $<)
-	@rm -f $@
+%.tx: %.asm ; $(eval txq += $<) @rm -f $@
 
-$(OBJS): $$*.tx $$(patsubst %.asm, %.tx, $$($$*_DEPENDENCIES))
-	@$(PREPROCESS) $(TEXTQUEUE)
-	$(eval TEXTQUEUE :=)
+$(all_obj): $$*.tx $$(patsubst %.asm, %.tx, $$($$*_dep))
+	@$(pre) $(txq);        $(eval txq :=)
+	@$(gfx) 2bpp $(2bppq); $(eval 2bppq :=)
+	@$(gfx) 1bpp $(1bppq); $(eval 1bppq :=)
+	@$(gfx) lz $(lzq);     $(eval lzq   :=)
 	rgbasm -o $@ $*.tx
 
-pokecrystal.gbc: $(CRYSTAL_OBJS)
+pokecrystal.gbc: $(crystal_obj)
 	rgblink -n $*.sym -m $*.map -o $@ $^
 	rgbfix -Cjv -i BYTE -k 01 -l 0x33 -m 0x10 -p 0 -r 3 -t PM_CRYSTAL $@
 	cmp baserom.gbc $@
@@ -66,14 +66,15 @@
 
 
 pngs:
-	find . -iname "*.lz"      -exec $(GFX) unlz {} +
-	find . -iname "*.[12]bpp" -exec $(GFX) png  {} +
-	find . -iname "*.[12]bpp" -exec touch {} +
+	find . -iname "*.lz"      -exec $(gfx) unlz {} +
+	find . -iname "*.[12]bpp" -exec $(gfx) png  {} +
 	find . -iname "*.lz"      -exec touch {} +
+	find . -iname "*.[12]bpp" -exec touch {} +
 
-%.2bpp: %.png ; $(GFX) 2bpp $<
-%.1bpp: %.png ; $(GFX) 1bpp $<
-%.lz:   %     ; $(GFX) lz   $<
+%.2bpp: %.png ; $(eval 2bppq += $<) @rm -f $@
+%.1bpp: %.png ; $(eval 1bppq += $<) @rm -f $@
+%.lz:   %     ; $(eval lzq   += $<) @rm -f $@
+
 
 %.pal: ;
 %.bin: ;
--- /dev/null
+++ b/battle/ai/items.asm
@@ -1,0 +1,847 @@
+Function38000: ; 38000
+	and a
+	ld a, [IsInBattle]
+	dec a
+	ret z
+	ld a, [InLinkBattle]
+	and a
+	ret nz
+	callba Function3e8d1
+	ret nz
+	ld a, [PlayerSubStatus5]
+	bit SUBSTATUS_CANT_RUN, a
+	jr nz, Function38041
+	ld a, [$c731]
+	and a
+	jr nz, Function38041
+	ld hl, TrainerClassAttributes + 5
+	ld a, [$cfc0]
+	and a
+	jr nz, .asm_38032
+	ld a, [TrainerClass]
+	dec a
+	ld bc, 7
+	call AddNTimes
+
+.asm_38032
+	bit 0, [hl]
+	jp nz, Function38045
+	bit 1, [hl]
+	jp nz, Function38083
+	bit 2, [hl]
+	jp nz, Function380c1
+	; fallthrough
+; 38041
+
+Function38041: ; 38041
+	call Function38105
+	ret
+; 38045
+
+Function38045: ; 38045
+	callab Function34941
+	ld a, [$c717]
+	and $f0
+	jp z, Function38041
+	cp $10
+	jr nz, .asm_38061
+	call Random
+	cp $80
+	jr c, .asm_38077
+	jp Function38041
+
+.asm_38061
+	cp $20
+	jr nz, .asm_3806f
+	call Random
+	cp $c8
+	jr c, .asm_38077
+	jp Function38041
+
+.asm_3806f
+	call Random
+	cp $a
+	jp c, Function38041
+
+.asm_38077
+	ld a, [$c717]
+	and $f
+	inc a
+	ld [$c718], a
+	jp Function3844b
+; 38083
+
+Function38083: ; 38083
+	callab Function34941
+	ld a, [$c717]
+	and $f0
+	jp z, Function38041
+	cp $10
+	jr nz, .asm_3809f
+	call Random
+	cp $14
+	jr c, .asm_380b5
+	jp Function38041
+
+.asm_3809f
+	cp $20
+	jr nz, .asm_380ad
+	call Random
+	cp $1e
+	jr c, .asm_380b5
+	jp Function38041
+
+.asm_380ad
+	call Random
+	cp $c8
+	jp c, Function38041
+
+.asm_380b5
+	ld a, [$c717]
+	and $f
+	inc a
+	ld [$c718], a
+	jp Function3844b
+; 380c1
+
+Function380c1: ; 380c1
+	callab Function34941
+	ld a, [$c717]
+	and $f0
+	jp z, Function38041
+	cp $10
+	jr nz, .asm_380dd
+	call Random
+	cp $32
+	jr c, .asm_380f3
+	jp Function38041
+
+.asm_380dd
+	cp $20
+	jr nz, .asm_380eb
+	call Random
+	cp $80
+	jr c, .asm_380f3
+	jp Function38041
+
+.asm_380eb
+	call Random
+	cp $32
+	jp c, Function38041
+
+.asm_380f3
+	ld a, [$c717]
+	and $f
+	inc a
+	ld [$c718], a
+	jp Function3844b
+; 380ff
+
+
+Function380ff: ; 380ff
+	ld a, [EnemySubStatus5]
+	bit SUBSTATUS_CANT_RUN, a
+	ret
+; 38105
+
+
+Function38105: ; 38105
+	ld a, [$cfc0]
+	and a
+	ret nz
+	ld a, [$c650]
+	ld b, a
+	ld a, [$c651]
+	or b
+	ret z
+	call Function38170
+	ret nc
+	ld a, [TrainerClass]
+	dec a
+	ld hl, TrainerClassAttributes + 5
+	ld bc, 7
+	call AddNTimes
+	ld b, h
+	ld c, l
+	ld hl, Unknown_38196
+	ld de, $c650
+.asm_3812c
+	ld a, [hl]
+	and a
+	inc a
+	ret z
+	ld a, [de]
+	cp [hl]
+	jr z, .asm_3813f
+	inc de
+	ld a, [de]
+	cp [hl]
+	jr z, .asm_3813f
+	dec de
+	inc hl
+	inc hl
+	inc hl
+	jr .asm_3812c
+
+.asm_3813f
+	inc hl
+	push hl
+	push de
+	ld de, .asm_3814a
+	push de
+	ld a, [hli]
+	ld h, [hl]
+	ld l, a
+	jp [hl]
+
+.asm_3814a
+	pop de
+	pop hl
+	inc hl
+	inc hl
+	jr c, .asm_3812c
+	xor a
+	ld [de], a
+	inc a
+	ld [$c70f], a
+	ld hl, EnemySubStatus3 ; $c66f
+	res SUBSTATUS_BIDE, [hl]
+	xor a
+	ld [EnemyFuryCutterCount], a ; $c680
+	ld [$c681], a
+	ld [$c72c], a
+	ld hl, EnemySubStatus4 ; $c670
+	res SUBSTATUS_RAGE, [hl]
+	xor a
+	ld [LastPlayerCounterMove], a ; $c6f9
+	scf
+	ret
+
+
+Function38170: ; 38170
+	ld a, [OTPartyCount]
+	ld d, a
+	ld e, 0
+	ld hl, OTPartyMon1Level
+	ld bc, OTPartyMon2 - OTPartyMon1
+.asm_3817c
+	ld a, [hl]
+	cp e
+	jr c, .asm_38181
+	ld e, a
+.asm_38181
+	add hl, bc
+	dec d
+	jr nz, .asm_3817c
+
+	ld a, [CurOTMon]
+	ld hl, OTPartyMon1Level
+	call AddNTimes
+	ld a, [hl]
+	cp e
+	jr nc, .asm_38194
+	and a
+	ret
+
+.asm_38194
+	scf
+	ret
+; 38196
+
+Unknown_38196: ; 39196
+	dbw FULL_RESTORE, Function38208
+	dbw MAX_POTION,   Function38220
+	dbw HYPER_POTION, Function38284
+	dbw SUPER_POTION, Function38292
+	dbw POTION,       Function382a0
+	dbw X_ACCURACY,   Function382f9
+	dbw FULL_HEAL,    Function381be
+	dbw GUARD_SPEC,   Function38305
+	dbw DIRE_HIT,     Function38311
+	dbw X_ATTACK,     Function3831d
+	dbw X_DEFEND,     Function38329
+	dbw X_SPEED,      Function38335
+	dbw X_SPECIAL,    Function38341
+	db $ff
+; 381be
+
+Function381be: ; 381be
+	call Function381ca
+	jp c, Function38383
+	call Function383a3
+	jp Function38385
+; 381ca
+
+; known jump sources: 381be (e:41be), 38214 (e:4214)
+Function381ca: ; 381ca (e:41ca)
+	ld a, [EnemyMonStatus] ; $d214
+	and a
+	jp z, Function38383
+
+	ld a, [bc]
+	bit 6, a
+	jr nz, .asm_381e7
+	ld a, [bc]
+	bit 4, a
+	jp nz, Function38385
+	call Random
+	cp $32
+	jp c, Function38385
+	jp Function38383
+
+.asm_381e7
+	ld a, [EnemySubStatus5]
+	bit SUBSTATUS_TOXIC, a
+	jr z, .asm_381fd
+	ld a, [$c67c]
+	cp $4
+	jr c, .asm_381fd
+	call Random
+	cp $80
+	jp c, Function38385
+.asm_381fd
+	ld a, [EnemyMonStatus]
+	and 1 << FRZ | SLP
+	jp z, Function38383
+	jp Function38385
+; 38208
+
+Function38208: ; 38208
+	call Function3822c
+	jp nc, Function3821a
+	ld a, [bc]
+	bit 6, a
+	jp z, Function38383
+	call Function381ca
+	jp c, Function38383
+
+; known jump sources: 3820b (e:420b)
+Function3821a: ; 3821a (e:421a)
+	call Function383b5
+	jp Function38385
+; 38220
+
+Function38220: ; 38220
+	call Function3822c
+	jp c, Function38383
+	call Function383ae
+	jp Function38385
+
+; known jump sources: 38208 (e:4208), 38220 (e:4220), 38284 (e:4284)
+Function3822c: ; 3822c (e:422c)
+	ld a, [bc]
+	bit 6, a
+	jr nz, Function38267
+	callab AICheckEnemyHalfHP
+	jp c, Function38383
+	ld a, [bc]
+	bit 5, a
+	jp nz, Function38254
+	callab AICheckEnemyQuarterHP
+	jp nc, Function38281
+	call Random
+	cp $80
+	jp c, Function38281
+	jp Function38383
+
+Function38254: ; 38254 (e:4254)
+	callab AICheckEnemyQuarterHP
+	jp c, Function38383
+	call Random
+	cp $32
+	jp c, Function38383
+	jr Function38281
+
+Function38267: ; 38267 (e:4267)
+	callab AICheckEnemyHalfHP
+	jp c, Function38383
+	callab AICheckEnemyQuarterHP
+	jp nc, Function38281
+	call Random
+	cp $32
+	jp nc, Function38383
+
+Function38281: ; 38281 (e:4281)
+	jp Function38385
+; 38284
+
+Function38284: ; 38284
+	call Function3822c
+	jp c, Function38383
+	ld b, 200
+	call Function383f4
+	jp Function38385
+; 38292 (e:4292)
+
+Function38292: ; 38292
+	call Function3822c
+	jp c, Function38383
+
+Function38298: ; 38298
+	ld b, 50
+	call Function383ee
+	jp Function38385
+; 382a0
+
+Function382a0: ; 382a0
+	call Function3822c
+	jp c, Function38383
+	ld b, 20
+	call Function383e8
+	jp Function38385
+; 382ae
+
+Function382ae: ; 382ae
+	callab AICheckEnemyMaxHP
+	jr c, .asm_382e4
+	push bc
+	ld de, EnemyMonMaxHP + 1
+	ld hl, EnemyMonHP + 1
+	ld a, [de]
+	sub [hl]
+	jr z, .asm_382e7
+	dec hl
+	dec de
+	ld c, a
+	sbc [hl]
+	and a
+	jr nz, .asm_382e7
+	ld a, c
+	cp b
+	jp c, .asm_382d5
+	callab AICheckEnemyQuarterHP
+	jr c, .asm_382e7
+
+.asm_382d5
+	pop bc
+	ld a, [bc]
+	bit 5, a
+	jp z, Function38385
+	call Random
+	cp $80
+	jp c, Function38385
+
+.asm_382e4
+	jp Function38383
+
+.asm_382e7
+	pop bc
+	ld a, [bc]
+	bit 5, a
+	jp z, Function38383
+	call Random
+	cp $64
+	jp c, Function38385
+	jp Function38383
+; 382f9
+
+Function382f9: ; 382f9
+	call Function3834d
+	jp c, Function38383
+	call Function384f7
+	jp Function38385
+; 38305
+
+Function38305: ; 38305
+	call Function3834d
+	jp c, Function38383
+	call Function38504
+	jp Function38385
+; 38311
+
+Function38311: ; 38311
+	call Function3834d
+	jp c, Function38383
+	call Function38511
+	jp Function38385
+; 3831d (e:431d)
+
+Function3831d: ; 3831d
+	call Function3834d
+	jp c, Function38383
+	call Function38541
+	jp Function38385
+; 38329
+
+Function38329: ; 38329
+	call Function3834d
+	jp c, Function38383
+	call Function38547
+	jp Function38385
+; 38335
+
+Function38335: ; 38335
+	call Function3834d
+	jp c, Function38383
+	call Function3854d
+	jp Function38385
+; 38341
+
+Function38341: ; 38341
+	call Function3834d
+	jp c, Function38383
+	call Function38553
+	jp Function38385
+; 3834d
+
+; known jump sources: 38311 (e:4311)
+Function3834d: ; 3834d (e:434d)
+	ld a, [EnemyTurnsTaken] ; $c6dc
+	and a
+	jr nz, .asm_38372
+	ld a, [bc]
+	bit 4, a
+	jp nz, Function38385
+	call Random
+	cp $80
+	jp c, Function38383
+	ld a, [bc]
+	bit 6, a
+	jp nz, Function38385
+	call Random
+	cp $80
+	jp c, Function38383
+	jp Function38385
+.asm_38372
+	ld a, [bc]
+	bit 4, a
+	jp z, Function38383
+	call Random
+	cp $32
+	jp nc, Function38383
+	jp Function38385
+
+Function38383: ; 38383 (e:4383)
+	scf
+	ret
+
+Function38385: ; 38385 (e:4385)
+	and a
+	ret
+
+
+Function38387: ; 38387
+	call UpdateEnemyMonInParty
+	callba UpdateEnemyHUD
+	ld a, $1
+	ld [hBGMapMode], a
+	ld hl, $c6e6
+	dec [hl]
+	scf
+	ret
+; 3839a
+
+Function3839a: ; 3839a
+	push de
+	ld de, SFX_FULL_HEAL
+	call PlaySFX
+	pop de
+	ret
+; 383a3
+
+
+; known jump sources: 381c4 (e:41c4)
+Function383a3: ; 383a3 (e:43a3)
+	call Function3839a
+	call Function384e0
+	ld a, FULL_HEAL
+	jp Function38568
+
+; known jump sources: 38226 (e:4226)
+Function383ae: ; 383ae (e:43ae)
+	ld a, $f
+	ld [$d1f1], a
+	jr asm_383c6
+
+; known jump sources: 3821a (e:421a)
+Function383b5: ; 383b5 (e:43b5)
+	call Function384e0
+	ld a, $e
+	ld [$d1f1], a
+	ld hl, EnemySubStatus3 ; $c66f
+	res SUBSTATUS_CONFUSED, [hl]
+	xor a
+	ld [EnemyConfuseCount], a ; $c67b
+asm_383c6: ; 383c6 (e:43c6)
+	ld de, $d1ec
+	ld hl, EnemyMonHP + 1 ; $d217
+	ld a, [hld]
+	ld [de], a
+	inc de
+	ld a, [hl]
+	ld [de], a
+	inc de
+	ld hl, EnemyMonMaxHP + 1 ; $d219
+	ld a, [hld]
+	ld [de], a
+	inc de
+	ld [Buffer1], a ; $d1ea (aliases: MagikarpLength)
+	ld [EnemyMonHP + 1], a ; $d217
+	ld a, [hl]
+	ld [de], a
+	ld [Buffer2], a ; $d1eb (aliases: MovementType)
+	ld [EnemyMonHP], a ; $d216 (aliases: EnemyMonHP)
+	jr asm_38436
+; 383e8 (e:43e8)
+
+Function383e8: ; 383e8
+	ld a, POTION
+	ld b, 20
+	jr Function383f8
+
+Function383ee: ; 383ee
+	ld a, SUPER_POTION
+	ld b, 50
+	jr Function383f8
+
+; known jump sources: 3828c (e:428c)
+Function383f4: ; 383f4 (e:43f4)
+	ld a, HYPER_POTION
+	ld b, 200
+
+Function383f8: ; 383f8
+	ld [$d1f1], a
+	ld hl, EnemyMonHP + 1 ; $d217
+	ld a, [hl]
+	ld [$d1ec], a
+	add b
+	ld [hld], a
+	ld [$d1ee], a
+	ld a, [hl]
+	ld [$d1ed], a
+	ld [$d1ef], a
+	jr nc, .asm_38415
+	inc a
+	ld [hl], a
+	ld [$d1ef], a
+.asm_38415
+	inc hl
+	ld a, [hld]
+	ld b, a
+	ld de, EnemyMonMaxHP + 1 ; $d219
+	ld a, [de]
+	dec de
+	ld [Buffer1], a ; $d1ea (aliases: MagikarpLength)
+	sub b
+	ld a, [hli]
+	ld b, a
+	ld a, [de]
+	ld [Buffer2], a ; $d1eb (aliases: MovementType)
+	sbc b
+	jr nc, asm_38436
+	inc de
+	ld a, [de]
+	dec de
+	ld [hld], a
+	ld [$d1ee], a
+	ld a, [de]
+	ld [hl], a
+	ld [$d1ef], a
+asm_38436: ; 38436 (e:4436)
+	call Function38571
+	hlcoord 2, 2
+	xor a
+	ld [$d10a], a
+	call Function3839a
+	predef Functionc6e0
+	jp Function38387
+
+
+Function3844b: ; 3844b
+	ld a, [OTPartyCount]
+	ld c, a
+	ld hl, OTPartyMon1HP
+	ld d, 0
+.asm_38454
+	ld a, [hli]
+	ld b, a
+	ld a, [hld]
+	or b
+	jr z, .asm_3845b
+	inc d
+
+.asm_3845b
+	push bc
+	ld bc, PartyMon2 - PartyMon1
+	add hl, bc
+	pop bc
+	dec c
+	jr nz, .asm_38454
+	ld a, d
+	cp $2
+	jp nc, Function3846c
+	and a
+	ret
+; 3846c
+
+Function3846c: ; 3846c
+	ld a, $1
+	ld [$c711], a
+	ld [$c70f], a
+	ld hl, EnemySubStatus4
+	res SUBSTATUS_RAGE, [hl]
+	xor a
+	ld [hBattleTurn], a
+	callab Function3dc5b
+	push af
+	ld a, [CurOTMon]
+	ld hl, OTPartyMon1Status
+	ld bc, PartyMon2 - PartyMon1
+	call AddNTimes
+	ld d, h
+	ld e, l
+	ld hl, EnemyMonStatus
+	ld bc, $0004
+	call CopyBytes
+	pop af
+	jr c, .asm_384a3
+	ld hl, UnknownText_0x384d0
+	call PrintText
+
+.asm_384a3
+	ld a, $1
+	ld [$d264], a
+	callab NewEnemyMonStatus
+	callab ResetEnemyStatLevels
+	ld hl, PlayerSubStatus1
+	res SUBSTATUS_IN_LOVE, [hl]
+	callba Function3d4e1
+	callba Function3d57a
+	xor a
+	ld [$d264], a
+	ld a, [InLinkBattle]
+	and a
+	ret nz
+	scf
+	ret
+; 384d0
+
+UnknownText_0x384d0: ; 384d0
+	text_jump UnknownText_0x1bcf9c
+	db "@"
+; 384d5
+
+Function384d5: ; 384d5
+	call Function3839a
+	call Function384e0
+	ld a, X_SPEED
+	jp Function38568
+; 384e0
+
+Function384e0: ; 384e0
+	ld a, [CurOTMon]
+	ld hl, OTPartyMon1Status
+	ld bc, PartyMon2 - PartyMon1
+	call AddNTimes
+	xor a
+	ld [hl], a
+	ld [EnemyMonStatus], a
+	ld hl, EnemySubStatus5
+	res SUBSTATUS_TOXIC, [hl]
+	ret
+; 384f7
+
+Function384f7: ; 384f7
+	call Function3839a
+	ld hl, EnemySubStatus4
+	set SUBSTATUS_UNLEASH, [hl]
+	ld a, X_ACCURACY
+	jp Function38568
+; 38504
+
+Function38504: ; 38504
+	call Function3839a
+	ld hl, EnemySubStatus4
+	set SUBSTATUS_MIST, [hl]
+	ld a, GUARD_SPEC
+	jp Function38568
+; 38511
+
+Function38511: ; 38511
+	call Function3839a
+	ld hl, EnemySubStatus4
+	set SUBSTATUS_FOCUS_ENERGY, [hl]
+	ld a, DIRE_HIT
+	jp Function38568
+; 3851e
+
+Function3851e: ; 3851e
+	ld [hMultiplier], a
+	ld hl, EnemyMonMaxHP
+	ld a, [hli]
+	ld [hProduct], a
+	ld a, [hl]
+	ld [hMultiplicand], a
+	ld b, $2
+	call Divide
+	ld a, [$ffb6]
+	ld c, a
+	ld a, [$ffb5]
+	ld b, a
+	ld hl, EnemyMonHP + 1
+	ld a, [hld]
+	ld e, a
+	ld a, [hl]
+	ld d, a
+	ld a, d
+	sub b
+	ret nz
+	ld a, e
+	sub c
+	ret
+; 38541
+
+Function38541: ; 38541
+	ld b, ATTACK
+	ld a, X_ATTACK
+	jr Function38557
+; 38547
+
+Function38547: ; 38547
+	ld b, DEFENSE
+	ld a, X_DEFEND
+	jr Function38557
+; 3854d
+
+Function3854d: ; 3854d
+	ld b, SPEED
+	ld a, X_SPEED
+	jr Function38557
+; 38553
+
+Function38553: ; 38553
+	ld b, SP_ATTACK
+	ld a, X_SPECIAL
+
+Function38557
+	ld [$d1f1], a
+	push bc
+	call Function38571
+	pop bc
+	callba Function361ef
+	jp Function38387
+; 38568
+
+
+Function38568: ; 38568
+	ld [$d1f1], a
+	call Function38571
+	jp Function38387
+; 38571
+
+Function38571: ; 38571
+	ld a, [$d1f1]
+	ld [$d265], a
+	call GetItemName
+	ld hl, StringBuffer1
+	ld de, $d050
+	ld bc, $000d
+	call CopyBytes
+	ld hl, UnknownText_0x3858c
+	jp PrintText
+; 3858c
+
+UnknownText_0x3858c: ; 3858c
+	text_jump UnknownText_0x1bcfaf
+	db "@"
+; 38591
--- a/battle/ai/scoring.asm
+++ b/battle/ai/scoring.asm
@@ -16,7 +16,7 @@
 	inc de
 	call AIGetEnemyMove
 
-	ld a, [EnemyMoveEffect]
+	ld a, [wEnemyMoveStruct + MOVE_EFFECT]
 	ld c, a
 
 	push hl
@@ -28,7 +28,7 @@
 	pop hl
 	jr nz, .discourage
 
-	ld a, [EnemyMoveEffect]
+	ld a, [wEnemyMoveStruct + MOVE_EFFECT]
 	push hl
 	push de
 	push bc
@@ -82,7 +82,7 @@
 	inc de
 	call AIGetEnemyMove
 
-	ld a, [EnemyMoveEffect]
+	ld a, [wEnemyMoveStruct + MOVE_EFFECT]
 
 	cp EFFECT_ATTACK_UP
 	jr c, .checkmove
@@ -119,7 +119,7 @@
 	jr nz, .discourage
 
 .encourage
-	call Function_0x39527
+	call Function39527
 	jr c, .checkmove
 
 	dec [hl]
@@ -173,7 +173,7 @@
 	jr c, .noteffective
 
 ; effective
-	ld a, [EnemyMovePower]
+	ld a, [wEnemyMoveStruct + MOVE_POWER]
 	and a
 	jr z, .checkmove
 	dec [hl]
@@ -185,7 +185,7 @@
 	push hl
 	push de
 	push bc
-	ld a, [EnemyMoveType]
+	ld a, [wEnemyMoveStruct + MOVE_TYPE]
 	ld d, a
 	ld hl, EnemyMonMoves
 	ld b, EnemyMonMovesEnd - EnemyMonMoves + 1
@@ -199,10 +199,10 @@
 	jr z, .asm_38693
 
 	call AIGetEnemyMove
-	ld a, [EnemyMoveType]
+	ld a, [wEnemyMoveStruct + MOVE_TYPE]
 	cp d
 	jr z, .checkmove2
-	ld a, [EnemyMovePower]
+	ld a, [wEnemyMoveStruct + MOVE_POWER]
 	and a
 	jr nz, .asm_38692
 	jr .checkmove2
@@ -244,7 +244,7 @@
 	inc de
 	call AIGetEnemyMove
 
-	ld a, [EnemyMovePower]
+	ld a, [wEnemyMoveStruct + MOVE_POWER]
 	and a
 	jr nz, .checkmove
 
@@ -275,7 +275,7 @@
 	push hl
 	call AIGetEnemyMove
 
-	ld a, [EnemyMoveEffect]
+	ld a, [wEnemyMoveStruct + MOVE_EFFECT]
 	ld hl, .table_386f2
 	ld de, 3
 	call IsInArray
@@ -398,7 +398,7 @@
 	ret nc
 
 .asm_387f0
-	call Function_0x39527
+	call Function39527
 	ret c
 	dec [hl]
 	dec [hl]
@@ -421,7 +421,7 @@
 	call AICheckEnemyMaxHP
 
 	ret c
-	call Function_0x39521
+	call Function39521
 
 	ret c
 	dec [hl]
@@ -439,28 +439,23 @@
 
 AIScoring_LockOn: ; 3881d
 	ld a, [PlayerSubStatus5]
-	bit 5, a
+	bit SUBSTATUS_LOCK_ON, a
 	jr nz, .asm_38882
 
 	push hl
 	call AICheckEnemyQuarterHP
-
 	jr nc, .asm_38877
 
 	call AICheckEnemyHalfHP
-
 	jr c, .asm_38834
 
 	call AICompareSpeed
-
 	jr nc, .asm_38877
 
-
 .asm_38834
 	ld a, [PlayerEvaLevel]
 	cp $a
 	jr nc, .asm_3887a
-
 	cp $8
 	jr nc, .asm_38875
 
@@ -467,13 +462,11 @@
 	ld a, [EnemyAccLevel]
 	cp $5
 	jr c, .asm_3887a
-
 	cp $7
 	jr c, .asm_38875
 
 	ld hl, EnemyMonMoves
 	ld c, EnemyMonMovesEnd - EnemyMonMoves + 1
-
 .asm_3884f
 	dec c
 	jr z, .asm_38877
@@ -484,17 +477,16 @@
 
 	call AIGetEnemyMove
 
-	ld a, [EnemyMoveAccuracy]
-	cp $b4
+	ld a, [wEnemyMoveStruct + MOVE_ACC]
+	cp 180
 	jr nc, .asm_3884f
 
 	ld a, $1
 	ld [hBattleTurn], a
+
 	push hl
 	push bc
-
 	callba Function347c8
-
 	ld a, [$d265]
 	cp $a
 	pop bc
@@ -501,7 +493,6 @@
 	pop hl
 	jr c, .asm_3884f
 
-
 .asm_38875
 	pop hl
 	ret
@@ -513,9 +504,9 @@
 
 .asm_3887a
 	pop hl
-	call Function_0x39527
-
+	call Function39527
 	ret c
+
 	dec [hl]
 	dec [hl]
 	ret
@@ -538,8 +529,8 @@
 	inc de
 	call AIGetEnemyMove
 
-	ld a, [EnemyMoveAccuracy]
-	cp $b4
+	ld a, [wEnemyMoveStruct + MOVE_ACC]
+	cp 180
 	jr nc, .asm_3888b
 
 	dec [hl]
@@ -546,11 +537,9 @@
 	dec [hl]
 	jr .asm_3888b
 
-
 .asm_388a2
 	pop hl
 	jp AIDiscourageMove
-
 ; 388a6
 
 
@@ -602,19 +591,16 @@
 	jp nc, AIDiscourageMove
 
 	call AICheckEnemyMaxHP
-
 	jr nc, .asm_388f2
 
 	ld a, [PlayerSubStatus5]
-	bit 0, a
+	bit SUBSTATUS_TOXIC, a
 	jr nz, .asm_388ef
 
 	call Random
-
 	cp $b2
 	jr nc, .asm_38911
 
-
 .asm_388ef
 	dec [hl]
 	dec [hl]
@@ -622,31 +608,23 @@
 
 .asm_388f2
 	call AICheckEnemyQuarterHP
-
 	jr nc, .asm_3890f
 
 	call Random
-
 	cp $a
 	jr c, .asm_388ef
 
 	call AICheckEnemyHalfHP
-
 	jr nc, .asm_3890a
 
-	call Function_0x39521
-
+	call Function39521
 	jr c, .asm_388ef
-
 	jr .asm_38911
 
-
 .asm_3890a
-	call Function_0x39527
-
+	call Function39527
 	jr c, .asm_38911
 
-
 .asm_3890f
 	inc [hl]
 	inc [hl]
@@ -653,11 +631,11 @@
 
 .asm_38911
 	ld a, [PlayerSubStatus5]
-	bit 0, a
+	bit SUBSTATUS_TOXIC, a
 	jr nz, .asm_38938
 
 	ld a, [PlayerSubStatus4]
-	bit 7, a
+	bit SUBSTATUS_LEECH_SEED, a
 	jr nz, .asm_38941
 
 	ld a, [EnemyEvaLevel]
@@ -671,7 +649,7 @@
 	jr nz, .asm_388ef
 
 	ld a, [PlayerSubStatus1]
-	bit 6, a
+	bit SUBSTATUS_ROLLOUT, a
 	jr nz, .asm_388ef
 
 
@@ -688,9 +666,9 @@
 	ret
 
 .asm_38941
-	call Function_0x39527
-
+	call Function39527
 	ret c
+
 	dec [hl]
 	ret
 ; 38947
@@ -706,7 +684,7 @@
 	ret c
 
 .asm_38954
-	call Function_0x39521
+	call Function39521
 
 	ret c
 	dec [hl]
@@ -721,30 +699,29 @@
 	jr nz, .asm_38968
 
 	call AICompareSpeed
-
 	ret nc
+
 	jp AIDiscourageMove
 
-
 .asm_38968
 	push hl
 	ld hl, Table_0x39301
 	ld de, 1
 	call IsInArray
-
 	pop hl
 	ret nc
-	call Function_0x39527
 
+	call Function39527
 	ret c
+
 	dec [hl]
 	call AICompareSpeed
-
 	ret nc
-	call Random
 
+	call Random
 	cp $19
 	ret c
+
 	dec [hl]
 	ret
 ; 38985
@@ -752,23 +729,19 @@
 
 AIScoring_AccuracyDown: ; 38985
 	call AICheckPlayerMaxHP
-
 	jr nc, .asm_389a0
 
 	call AICheckEnemyHalfHP
-
 	jr nc, .asm_389a0
 
 	ld a, [PlayerSubStatus5]
-	bit 0, a
+	bit SUBSTATUS_TOXIC, a
 	jr nz, .asm_3899d
 
 	call Random
-
 	cp $b2
 	jr nc, .asm_389bf
 
-
 .asm_3899d
 	dec [hl]
 	dec [hl]
@@ -776,31 +749,23 @@
 
 .asm_389a0
 	call AICheckPlayerQuarterHP
-
 	jr nc, .asm_389bd
 
 	call Random
-
 	cp $a
 	jr c, .asm_3899d
 
 	call AICheckPlayerHalfHP
-
 	jr nc, .asm_389b8
 
-	call Function_0x39521
-
+	call Function39521
 	jr c, .asm_3899d
-
 	jr .asm_389bf
 
-
 .asm_389b8
-	call Function_0x39527
-
+	call Function39527
 	jr c, .asm_389bf
 
-
 .asm_389bd
 	inc [hl]
 	inc [hl]
@@ -807,11 +772,11 @@
 
 .asm_389bf
 	ld a, [PlayerSubStatus5]
-	bit 0, a
+	bit SUBSTATUS_TOXIC, a
 	jr nz, .asm_389e6
 
 	ld a, [PlayerSubStatus4]
-	bit 7, a
+	bit SUBSTATUS_LEECH_SEED, a
 	jr nz, .asm_389ef
 
 	ld a, [EnemyEvaLevel]
@@ -825,10 +790,9 @@
 	jr nz, .asm_3899d
 
 	ld a, [PlayerSubStatus1]
-	bit 6, a
+	bit SUBSTATUS_ROLLOUT, a
 	jr nz, .asm_3899d
 
-
 .asm_389e4
 	inc [hl]
 	ret
@@ -842,9 +806,9 @@
 	ret
 
 .asm_389ef
-	call Function_0x39527
-
+	call Function39527
 	ret c
+
 	dec [hl]
 	ret
 ; 389f5
@@ -862,7 +826,6 @@
 	jr c, .asm_38a12
 	jr .asm_389fb
 
-
 .asm_38a05
 	ld hl, PlayerAtkLevel
 	ld c, $8
@@ -976,7 +939,7 @@
 	jr nz, .asm_38a91
 
 	ld a, [PlayerSubStatus1]
-	and 1<<SUBSTATUS_IN_LOVE | 1<<SUBSTATUS_ENCORED | 1<<SUBSTATUS_IDENTIFIED | 1<<SUBSTATUS_NIGHTMARE
+	and 1<<SUBSTATUS_IN_LOVE | 1<<SUBSTATUS_ROLLOUT | 1<<SUBSTATUS_IDENTIFIED | 1<<SUBSTATUS_NIGHTMARE
 	jr nz, .asm_38a91
 
 	ld a, [PlayerTurnsTaken]
@@ -984,7 +947,7 @@
 	jr z, .asm_38a91
 
 .asm_38a8b
-	call Function_0x39527
+	call Function39527
 	ret c
 	inc [hl]
 	ret
@@ -992,7 +955,7 @@
 .asm_38a91
 	call AICheckEnemyQuarterHP
 	ret nc
-	call Function_0x39527
+	call Function39527
 	ret c
 	dec [hl]
 	dec [hl]
@@ -1022,7 +985,7 @@
 
 	call AIGetEnemyMove
 
-	ld a, [EnemyMoveEffect]
+	ld a, [wEnemyMoveStruct + MOVE_EFFECT]
 	cp EFFECT_PROTECT
 	jr z, .asm_38ad5
 	dec c
@@ -1081,14 +1044,14 @@
 	ret nc
 
 	ld a, [BattleMonType1]
-	cp FIRE
+	cp SPECIAL
 	jr nc, .asm_38b09
 	ld a, [BattleMonType2]
-	cp FIRE
+	cp SPECIAL
 	ret c
 
 .asm_38b09
-	call Function_0x39521
+	call Function39521
 	ret c
 	dec [hl]
 	dec [hl]
@@ -1128,7 +1091,7 @@
 	ret c
 	call AICheckEnemyQuarterHP
 	ret nc
-	call Function_0x39521
+	call Function39521
 	ret c
 	dec [hl]
 	dec [hl]
@@ -1135,7 +1098,7 @@
 	ret
 
 .asm_38b3a
-	call Function_0x39527
+	call Function39527
 	ret c
 	inc [hl]
 	ret
@@ -1143,7 +1106,7 @@
 
 
 AIScoring_SpeedDownHit: ; 38b40
-	ld a, [EnemyMoveAnimation]
+	ld a, [wEnemyMoveStruct + MOVE_ANIM]
 	cp ICY_WIND
 	ret nz
 	call AICheckEnemyQuarterHP
@@ -1174,7 +1137,7 @@
 	jr c, .asm_38b72
 	call AICheckEnemyQuarterHP
 	ret c
-	call Function_0x39527
+	call Function39527
 	ret c
 	dec [hl]
 	ret
@@ -1184,7 +1147,7 @@
 	cp 40
 	ret c
 	inc [hl]
-	call Function_0x39527
+	call Function39527
 	ret c
 	inc [hl]
 	ret
@@ -1193,10 +1156,10 @@
 
 AIScoring_Rage: ; 38b7f
 	ld a, [EnemySubStatus4]
-	bit 6, a
+	bit SUBSTATUS_RAGE, a
 	jr z, .asm_38b9b
 
-	call Function_0x39527
+	call Function39527
 	jr c, .asm_38b8c
 
 	dec [hl]
@@ -1216,7 +1179,7 @@
 	call AICheckEnemyHalfHP
 	jr nc, .asm_38ba6
 
-	call Function_0x39521
+	call Function39521
 	ret nc
 	dec [hl]
 	ret
@@ -1249,7 +1212,7 @@
 	jr c, .asm_38bef
 	jr z, .asm_38bd4
 
-	call Function_0x39527
+	call Function39527
 	jr c, .asm_38bd4
 
 	dec [hl]
@@ -1263,7 +1226,7 @@
 
 	pop hl
 	ret nc
-	call Function_0x39527
+	call Function39527
 	ret c
 	dec [hl]
 	ret
@@ -1291,12 +1254,12 @@
 
 	call AIGetEnemyMove
 
-	ld a, [EnemyMovePower]
+	ld a, [wEnemyMoveStruct + MOVE_POWER]
 	and a
 	jr z, .asm_38c0e
 
-	ld a, [EnemyMoveType]
-	cp $14
+	ld a, [wEnemyMoveStruct + MOVE_TYPE]
+	cp SPECIAL
 	jr nc, .asm_38c0e
 
 	inc b
@@ -1319,12 +1282,12 @@
 
 	call AIGetEnemyMove
 
-	ld a, [EnemyMovePower]
+	ld a, [wEnemyMoveStruct + MOVE_POWER]
 	and a
 	jr z, .asm_38c38
 
-	ld a, [EnemyMoveType]
-	cp $14
+	ld a, [wEnemyMoveStruct + MOVE_TYPE]
+	cp SPECIAL
 	jr nc, .asm_38c38
 
 
@@ -1354,15 +1317,14 @@
 
 	call AIGetEnemyMove
 
-	ld a, [EnemyMovePower]
+	ld a, [wEnemyMoveStruct + MOVE_POWER]
 	and a
 	jr z, .asm_38c68
 
 	push hl
-	ld a, [EnemyMoveType]
+	ld a, [wEnemyMoveStruct + MOVE_TYPE]
 	ld hl, EnemyMonType1
-	ld a, $41
-	call Predef
+	predef Function347d3
 
 	pop hl
 	ld a, [$d265]
@@ -1433,7 +1395,7 @@
 
 AIScoring_PainSplit: ; 38ca4
 	push hl
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld b, [hl]
 	inc hl
 	ld c, [hl]
@@ -1490,7 +1452,7 @@
 	call AICompareSpeed
 	jp c, AIDiscourageMove
 
-	call Function_0x39527
+	call Function39527
 	ret c
 	inc [hl]
 	ret
@@ -1561,13 +1523,13 @@
 	ld b, a
 	ld c, 0
 	ld hl, OTPartyMon1HP
-	ld de, $0030
+	ld de, OTPartyMon2 - OTPartyMon1
 
-.asm_38d2c
+.loop
 	push hl
 	ld a, [hli]
 	or [hl]
-	jr z, .asm_38d37
+	jr z, .next
 
 	dec hl
 	dec hl
@@ -1576,34 +1538,31 @@
 	or c
 	ld c, a
 
-.asm_38d37
+.next
 	pop hl
 	add hl, de
 	dec b
-	jr nz, .asm_38d2c
+	jr nz, .loop
 
 	pop hl
 	ld a, c
 	and a
-	jr z, .asm_38d52
+	jr z, .no_status
 
 	ld a, [EnemyMonStatus]
 	and a
-	jr z, .asm_38d48
-
+	jr z, .ok
 	dec [hl]
-
-.asm_38d48
-	and $27
+.ok
+	and 1 << FRZ | SLP
 	ret z
-	call Function_0x39527
-
+	call Function39527
 	ret c
 	dec [hl]
 	dec [hl]
 	ret
 
-.asm_38d52
+.no_status
 	ld a, [EnemyMonStatus]
 	and a
 	ret nz
@@ -1658,13 +1617,13 @@
 
 	push hl
 	dec a
-	ld hl, Moves + PlayerMoveType - PlayerMoveStruct
-	ld bc, Move2 - Move1
+	ld hl, Moves + MOVE_TYPE
+	ld bc, MOVE_LENGTH
 	call AddNTimes
 
 	ld a, BANK(Moves)
 	call GetFarByte
-	ld [PlayerMoveType], a
+	ld [wPlayerMoveStruct + MOVE_TYPE], a
 
 	xor a
 	ld [hBattleTurn], a
@@ -1677,7 +1636,7 @@
 	jr c, .asm_38dc9
 
 	ret z
-	call Function_0x39527
+	call Function39527
 
 	ret c
 	dec [hl]
@@ -1713,7 +1672,7 @@
 	ret
 
 .asm_38dee
-	ld a, [EnemyMovePower]
+	ld a, [wEnemyMoveStruct + MOVE_POWER]
 	and a
 	ret nz
 
@@ -1740,7 +1699,7 @@
 	jr nz, .asm_38e26
 
 	ld a, [PlayerSubStatus1]
-	and 1<<SUBSTATUS_IN_LOVE | 1<<SUBSTATUS_ENCORED | 1<<SUBSTATUS_IDENTIFIED | 1<<SUBSTATUS_NIGHTMARE
+	and 1<<SUBSTATUS_IN_LOVE | 1<<SUBSTATUS_ROLLOUT | 1<<SUBSTATUS_IDENTIFIED | 1<<SUBSTATUS_NIGHTMARE
 	jr nz, .asm_38e26
 
 	push hl
@@ -1755,7 +1714,7 @@
 	ret
 
 .asm_38e26
-	call Function_0x39521
+	call Function39521
 	ret c
 	dec [hl]
 	dec [hl]
@@ -1792,7 +1751,7 @@
 
 
 AIScoring_Nightmare: ; 38e4a
-	call Function_0x39527
+	call Function39527
 	ret c
 	dec [hl]
 	ret
@@ -1832,12 +1791,12 @@
 	ld a, [BattleMonType1]
 	cp GHOST
 	jr z, .asm_38e92
-	cp FIRE
+	cp SPECIAL
 	ret nc
 	ld a, [BattleMonType2]
-	cp FIRE
+	cp SPECIAL
 	ret nc
-	call Function_0x39521
+	call Function39521
 	ret c
 	dec [hl]
 	dec [hl]
@@ -1892,7 +1851,7 @@
 	ret nz
 
 .asm_38ecb
-	call Function_0x39527
+	call Function39527
 
 	ret c
 	dec [hl]
@@ -1928,7 +1887,7 @@
 	bit SUBSTATUS_CURSE, a
 	jr nz, .asm_38f0d
 
-	bit SUBSTATUS_ENCORED, a
+	bit SUBSTATUS_ROLLOUT, a
 	jr z, .asm_38f14
 
 	ld a, [PlayerRolloutCount]
@@ -1936,7 +1895,7 @@
 	jr c, .asm_38f14
 
 .asm_38f0d
-	call Function_0x39521
+	call Function39521
 	ret c
 	dec [hl]
 	ret
@@ -1992,7 +1951,7 @@
 	jr c, .asm_38f75
 
 	ld a, [PlayerSubStatus5]
-	bit 7, a
+	bit SUBSTATUS_CANT_RUN, a
 	jr nz, .asm_38f6f
 
 	push hl
@@ -2002,7 +1961,7 @@
 	pop hl
 	ret c
 
-	call Function_0x39527
+	call Function39527
 	ret c
 
 	inc [hl]
@@ -2009,9 +1968,9 @@
 	ret
 
 .asm_38f6f
-	call Function_0x39527
-
+	call Function39527
 	ret c
+
 	dec [hl]
 	ret
 
@@ -2043,7 +2002,7 @@
 	call AICheckPlayerHalfHP
 	jr nc, .asm_38fa6
 
-	call Function_0x39527
+	call Function39527
 	ret c
 
 	dec [hl]
@@ -2079,7 +2038,7 @@
 	call AIHasMove
 	jr nc, .asm_38fcb
 
-	call Function_0x39521
+	call Function39521
 	ret c
 
 	dec [hl]
@@ -2091,7 +2050,7 @@
 	ld a, [EnemySubStatus5]
 	bit SUBSTATUS_LOCK_ON, a
 	ret z
-	call Function_0x39527
+	call Function39527
 
 	ret c
 	dec [hl]
@@ -2161,7 +2120,7 @@
 	ret
 
 .asm_39020
-	call Function_0x39521
+	call Function39521
 	ret c
 	inc [hl]
 	ret
@@ -2172,14 +2131,14 @@
 AIScoring_Attract: ; 39026
 	ld a, [PlayerTurnsTaken]
 	and a
-	jr z, .asm_39032
+	jr z, .first_turn
 
-	call Function_0x39521
+	call Function39521
 	ret c
 	inc [hl]
 	ret
 
-.asm_39032
+.first_turn
 	call Random
 	cp 200
 	ret nc
@@ -2191,7 +2150,7 @@
 AIScoring_Safeguard: ; 3903a
 	call AICheckPlayerHalfHP
 	ret c
-	call Function_0x39521
+	call Function39521
 	ret c
 	inc [hl]
 	ret
@@ -2206,7 +2165,7 @@
 
 	ld a, [PlayerSubStatus3]
 	bit SUBSTATUS_UNDERGROUND, a
-	jr z, .asm_39058
+	jr z, .could_dig
 
 	call AICompareSpeed
 	ret nc
@@ -2214,10 +2173,12 @@
 	dec [hl]
 	ret
 
-.asm_39058
+.could_dig
+	; Try to predict if the player
+	; will use Dig this turn.
 	call AICompareSpeed
 	ret c
-	call Function_0x39527
+	call Function39527
 	ret c
 	dec [hl]
 	ret
@@ -2239,13 +2200,13 @@
 AIScoring_Pursuit: ; 39072
 	call AICheckPlayerQuarterHP
 	jr nc, .asm_3907d
-	call Function_0x39521
+	call Function39521
 	ret c
 	inc [hl]
 	ret
 
 .asm_3907d
-	call Function_0x39527
+	call Function39527
 	ret c
 	dec [hl]
 	dec [hl]
@@ -2267,7 +2228,7 @@
 	ret z
 
 .asm_39097
-	call Function_0x39521
+	call Function39521
 
 	ret c
 	dec [hl]
@@ -2289,7 +2250,7 @@
 	jr c, .asm_390c9
 
 	ld a, d
-	cp $32
+	cp 50
 	jr c, .asm_390c9
 
 	ld a, [$d265]
@@ -2297,7 +2258,7 @@
 	jr nc, .asm_390c7
 
 	ld a, d
-	cp $46
+	cp 70
 	ret c
 
 .asm_390c7
@@ -2372,7 +2333,7 @@
 	call AICheckPlayerHalfHP
 	jr nc, AIBadWeatherType
 
-	call Function_0x39527
+	call Function39527
 	ret c
 
 	dec [hl]
@@ -2476,7 +2437,7 @@
 	ld a, [EnemyEvaLevel]
 	cp $8
 	ret nc
-	call Function_0x39521
+	call Function39521
 
 	ret c
 	dec [hl]
@@ -2502,12 +2463,12 @@
 
 	call AIGetEnemyMove
 
-	ld a, [EnemyMovePower]
+	ld a, [wEnemyMoveStruct + MOVE_POWER]
 	and a
 	jr z, .asm_391a8
 
-	ld a, [EnemyMoveType]
-	cp FIRE
+	ld a, [wEnemyMoveStruct + MOVE_TYPE]
+	cp SPECIAL
 	jr c, .asm_391a8
 
 	inc b
@@ -2530,12 +2491,12 @@
 
 	call AIGetEnemyMove
 
-	ld a, [EnemyMovePower]
+	ld a, [wEnemyMoveStruct + MOVE_POWER]
 	and a
 	jr z, .asm_391d2
 
-	ld a, [EnemyMoveType]
-	cp FIRE
+	ld a, [wEnemyMoveStruct + MOVE_TYPE]
+	cp SPECIAL
 	jr c, .asm_391d2
 
 
@@ -2574,7 +2535,7 @@
 .asm_391e9
 	call AICompareSpeed
 	ret c
-	call Function_0x39527
+	call Function39527
 	ret c
 	dec [hl]
 	ret
@@ -2600,7 +2561,7 @@
 	and a
 	ret z
 
-	call Function_0x39521
+	call Function39521
 	ret c
 
 	dec [hl]
@@ -2625,7 +2586,7 @@
 	ret
 
 .asm_3921e
-	call Function_0x39521
+	call Function39521
 	ret c
 
 	dec [hl]
@@ -2650,13 +2611,13 @@
 
 AICompareSpeed: ; 39233
 	push bc
-	ld a, [EnemyMonSpd + 1]
+	ld a, [EnemyMonSpeed + 1]
 	ld b, a
-	ld a, [BattleMonSpd + 1]
+	ld a, [BattleMonSpeed + 1]
 	cp b
-	ld a, [EnemyMonSpd]
+	ld a, [EnemyMonSpeed]
 	ld b, a
-	ld a, [BattleMonSpd]
+	ld a, [BattleMonSpeed]
 	sbc b
 	pop bc
 	ret
@@ -2677,8 +2638,8 @@
 	push hl
 	push de
 	push bc
-	ld de, EnemyMonHPHi
-	ld hl, EnemyMonMaxHPHi
+	ld de, EnemyMonHP
+	ld hl, EnemyMonMaxHP
 	; fallthrough
 ; 3925a
 
@@ -2733,7 +2694,7 @@
 	push hl
 	push de
 	push bc
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld b, [hl]
 	inc hl
 	ld c, [hl]
@@ -2756,7 +2717,7 @@
 	push hl
 	push de
 	push bc
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld b, [hl]
 	inc hl
 	ld c, [hl]
@@ -2811,7 +2772,7 @@
 
 	call AIGetEnemyMove
 
-	ld a, [EnemyMoveEffect]
+	ld a, [wEnemyMoveStruct + MOVE_EFFECT]
 	cp b
 	jr z, .asm_392e3
 
@@ -2898,7 +2859,7 @@
 	call AICheckEnemyQuarterHP
 	jr nc, .asm_39322
 
-	call Function_0x39527
+	call Function39527
 	ret c
 
 .asm_39322
@@ -2992,7 +2953,7 @@
 	push de
 	push bc
 	call AIGetEnemyMove
-	ld a, [EnemyMovePower]
+	ld a, [wEnemyMoveStruct + MOVE_POWER]
 	and a
 	jr z, .nodamage
 	call AIDamageCalc
@@ -3043,7 +3004,7 @@
 
 	call AIGetEnemyMove
 
-	ld a, [EnemyMovePower]
+	ld a, [wEnemyMoveStruct + MOVE_POWER]
 	cp 2
 	jr c, .checkmove2
 
@@ -3050,7 +3011,7 @@
 	push hl
 	push de
 	push bc
-	ld a, [EnemyMoveEffect]
+	ld a, [wEnemyMoveStruct + MOVE_EFFECT]
 	ld hl, .aggressivemoves
 	ld de, 1
 	call IsInArray
@@ -3077,7 +3038,7 @@
 AIDamageCalc: ; 393e7
 	ld a, 1
 	ld [hBattleTurn], a
-	ld a, [EnemyMoveEffect]
+	ld a, [wEnemyMoveStruct + MOVE_EFFECT]
 	ld de, 1
 	ld hl, .ConstantDamageEffects
 	call IsInArray
@@ -3175,7 +3136,7 @@
 	inc de
 	call AIGetEnemyMove
 
-	ld a, [EnemyMoveEffect]
+	ld a, [wEnemyMoveStruct + MOVE_EFFECT]
 	cp EFFECT_TOXIC
 	jr z, .poisonimmunity
 	cp EFFECT_POISON
@@ -3185,7 +3146,7 @@
 	cp EFFECT_PARALYZE
 	jr z, .typeimmunity
 
-	ld a, [EnemyMovePower]
+	ld a, [wEnemyMoveStruct + MOVE_POWER]
 	and a
 	jr z, .checkmove
 
@@ -3242,12 +3203,12 @@
 	push hl
 	call AIGetEnemyMove
 
-	ld a, [EnemyMovePower]
+	ld a, [wEnemyMoveStruct + MOVE_POWER]
 	and a
 	jr z, .nextmove
 
 ; Don't use risky moves at max hp.
-	ld a, [EnemyMoveEffect]
+	ld a, [wEnemyMoveStruct + MOVE_EFFECT]
 	ld de, 1
 	ld hl, .riskymoves
 	call IsInArray
@@ -3314,10 +3275,10 @@
 	push bc
 	dec a
 	ld hl, Moves
-	ld bc, Move2 - Move1
+	ld bc, MOVE_LENGTH
 	call AddNTimes
 
-	ld de, EnemyMoveStruct
+	ld de, wEnemyMoveStruct
 	ld a, BANK(Moves)
 	call FarCopyBytes
 
@@ -3328,7 +3289,7 @@
 ; 39521
 
 
-Function_0x39521: ; 39521
+Function39521: ; 39521
 	call Random
 	cp 50 ; 1/5
 	ret
@@ -3335,7 +3296,7 @@
 ; 39527
 
 
-Function_0x39527: ; 39527
+Function39527: ; 39527
 	call Random
 	cp $80 ; 1/2
 	ret
--- a/battle/anim_commands.asm
+++ b/battle/anim_commands.asm
@@ -954,11 +954,9 @@
 	ld a, [TempBattleMonSpecies] ; $d205
 	ld [CurPartySpecies], a ; $d108
 	ld hl, BattleMonDVs ; $c632
-	ld a, PREDEF_GET_UNOWN_LETTER
-	call Predef
+	predef GetUnownLetter
 	ld de, $8000
-	ld a, $3c
-	call Predef
+	predef GetFrontpic
 	jr .done
 
 .player
@@ -965,11 +963,9 @@
 	ld a, [TempEnemyMonSpecies] ; $d204
 	ld [CurPartySpecies], a ; $d108
 	ld hl, EnemyMonDVs ; $d20c
-	ld a, PREDEF_GET_UNOWN_LETTER
-	call Predef
+	predef GetUnownLetter
 	ld de, $8000
-	ld a, $3d
-	call Predef
+	predef GetBackpic
 
 .done
 	pop af
@@ -1194,20 +1190,16 @@
 	jr z, .player
 
 	ld hl, BattleMonDVs ; $c632
-	ld a, PREDEF_GET_UNOWN_LETTER
-	call Predef
+	predef GetUnownLetter
 	ld de, $9000
-	ld a, $3c
-	call Predef
+	predef GetFrontpic
 	jr .done
 
 .player
 	ld hl, EnemyMonDVs ; $d20c
-	ld a, PREDEF_GET_UNOWN_LETTER
-	call Predef
+	predef GetUnownLetter
 	ld de, $9310
-	ld a, $3d
-	call Predef
+	predef GetBackpic
 
 .done
 	pop af
--- a/battle/core.asm
+++ b/battle/core.asm
@@ -12,8 +12,8 @@
 	inc a
 	ld [$d264], a
 	ld hl, OTPartyMon1HP
-	ld bc, $002f
-	ld d, $3
+	ld bc, OTPartyMon2 - (OTPartyMon1 + 1)
+	ld d, NUM_MOVES - 1
 .asm_3c019
 	inc d
 	ld a, [hli]
@@ -24,7 +24,7 @@
 
 .asm_3c021
 	ld a, d
-	ld [$d430], a
+	ld [wBattleAction], a
 	ld a, [InLinkBattle]
 	and a
 	jr z, .asm_3c031
@@ -57,9 +57,9 @@
 	call Function30b4
 	ld a, [BattleType]
 	cp $2
-	jp z, Function3c0e2
-	cp $3
-	jp z, Function3c0e2
+	jp z, .asm_3c0e2
+	cp BATTLETYPE_TUTORIAL
+	jp z, .asm_3c0e2
 	xor a
 	ld [CurPartyMon], a
 .asm_3c06b
@@ -75,9 +75,9 @@
 	ld a, [CurPartyMon]
 	ld [CurBattleMon], a
 	inc a
-	ld hl, PartyCount
+	ld hl, PartySpecies - 1
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [hl]
 	ld [CurPartySpecies], a
@@ -114,10 +114,9 @@
 
 .asm_3c0df
 	jp Function3c12f
-; 3c0e2
 
-Function3c0e2: ; 3c0e2
-	jp Function3e139
+.asm_3c0e2
+	jp BattleMenu
 ; 3c0e5
 
 
@@ -162,69 +161,75 @@
 ; 3c12f
 
 Function3c12f: ; 3c12f
+.loop
 	call Function3c1bf
 	call Function3c3f5
-	jp c, .asm_3c1be
+	jp c, .quit
+
 	xor a
-	ld [$c710], a
-	ld [$c711], a
+	ld [wPlayerIsSwitching], a
+	ld [wEnemyIsSwitching], a
 	ld [$d264], a
 	ld [$c73f], a
 	ld [$c740], a
 	ld [CurDamage], a
-	ld [$d257], a
+	ld [CurDamage + 1], a
+
 	call Function3c27c
 	call UpdateBattleMonInParty
 	callba AIChooseMove
-	call Function3d2f1
-	jr nz, .asm_3c174
+
+	call IsMobileBattle
+	jr nz, .not_disconnected
 	callba Function100da5
 	callba Function100641
 	callba Function100dd8
-	jp c, .asm_3c1be
+	jp c, .quit
+.not_disconnected
 
-.asm_3c174
 	call Function3c410
 	jr c, .asm_3c18a
 .asm_3c179
-	call Function3e139
-	jr c, .asm_3c1be
+	call BattleMenu
+	jr c, .quit
 	ld a, [BattleEnded]
 	and a
-	jr nz, .asm_3c1be
-	ld a, [$d232]
+	jr nz, .quit
+	ld a, [$d232] ; roared/whirlwinded/teleported
 	and a
-	jr nz, .asm_3c1be
-
+	jr nz, .quit
 .asm_3c18a
 	call Function3c434
 	jr nz, .asm_3c179
+
 	call Function3c300
-	jr c, .asm_3c1be
+	jr c, .quit
+
 	call Function3c314
 	jr c, .asm_3c19e
 	call Function3c5fe
 	jr .asm_3c1a1
-
 .asm_3c19e
 	call Function3c664
-
 .asm_3c1a1
 	call Function3d2e0
-	jr c, .asm_3c1be
+	jr c, .quit
+
 	ld a, [$d232]
 	and a
-	jr nz, .asm_3c1be
+	jr nz, .quit
+
 	ld a, [BattleEnded]
 	and a
-	jr nz, .asm_3c1be
+	jr nz, .quit
+
 	call Function3c1d6
 	ld a, [BattleEnded]
 	and a
-	jr nz, .asm_3c1be
-	jp Function3c12f
+	jr nz, .quit
+	jp .loop
 
-.asm_3c1be
+.quit
 	ret
 ; 3c1bf
 
@@ -302,7 +307,7 @@
 ; 3c23c
 
 Function3c23c: ; 3c23c
-	call Function3c710
+	call HasPlayerFainted
 	jr nz, .asm_3c24a
 	call Function3d14e
 	ld a, [BattleEnded]
@@ -310,7 +315,7 @@
 	jr nz, .asm_3c25a
 
 .asm_3c24a
-	call Function3c70b
+	call HasEnemyFainted
 	jr nz, .asm_3c258
 	call Function3cd55
 	ld a, [BattleEnded]
@@ -327,7 +332,7 @@
 ; 3c25c
 
 Function3c25c: ; 3c25c
-	call Function3c70b
+	call HasEnemyFainted
 	jr nz, .asm_3c26a
 	call Function3cd55
 	ld a, [BattleEnded]
@@ -335,7 +340,7 @@
 	jr nz, .asm_3c27a
 
 .asm_3c26a
-	call Function3c710
+	call HasPlayerFainted
 	jr nz, .asm_3c278
 	call Function3d14e
 	ld a, [BattleEnded]
@@ -397,11 +402,11 @@
 	xor a
 	ld [hl], a
 	ld a, BATTLE_VARS_SUBSTATUS3
-	call _GetBattleVar
+	call GetBattleVarAddr
 	push af
 	set SUBSTATUS_CONFUSED, [hl]
 	ld a, BATTLE_VARS_MOVE_ANIM
-	call _GetBattleVar
+	call GetBattleVarAddr
 	push hl
 	push af
 	xor a
@@ -421,9 +426,9 @@
 	ret nz
 	xor a
 	ld [$cfca], a
-	ld de, $0103
+	ld de, ANIM_CONFUSED
 	call Function3ee0f
-	call Function3c8e4
+	call SwitchTurnCore
 	ld hl, BecameConfusedText
 	jp StdBattleTextBox
 ; 3c300
@@ -432,7 +437,7 @@
 	ld a, [InLinkBattle]
 	and a
 	jr z, .asm_3c30d
-	ld a, [$d430]
+	ld a, [wBattleAction]
 	cp $f
 	jr z, .asm_3c30f
 
@@ -450,12 +455,12 @@
 	ld a, [InLinkBattle]
 	and a
 	jr z, .asm_3c35b
-	ld a, [$d430]
+	ld a, [wBattleAction]
 	cp $e
 	jr z, .asm_3c35b
 	cp $d
 	jr z, .asm_3c35b
-	sub $4
+	sub NUM_MOVES
 	jr c, .asm_3c35b
 	ld a, [$d0ec]
 	cp $2
@@ -496,10 +501,10 @@
 	callab GetOpponentItem
 	pop de
 	ld a, d
-	cp $4a
+	cp HELD_QUICK_CLAW
 	jr nz, .asm_3c391
 	ld a, b
-	cp $4a
+	cp HELD_QUICK_CLAW
 	jr z, .asm_3c39f
 	call BattleRandom
 	cp e
@@ -508,7 +513,7 @@
 
 .asm_3c391
 	ld a, b
-	cp $4a
+	cp HELD_QUICK_CLAW
 	jr nz, .asm_3c3c5
 	call BattleRandom
 	cp c
@@ -537,8 +542,8 @@
 	jr .asm_3c3c5
 
 .asm_3c3c5
-	ld de, BattleMonSpd
-	ld hl, EnemyMonSpd
+	ld de, BattleMonSpeed
+	ld hl, EnemyMonSpeed
 	ld c, $2
 	call StringCmp
 	jr z, .asm_3c3d8
@@ -570,7 +575,7 @@
 
 Function3c3f5: ; 3c3f5
 	ld a, [BattleType]
-	cp $6
+	cp BATTLETYPE_CONTEST
 	jr nz, .asm_3c40e
 	ld a, [$dc79]
 	and a
@@ -589,23 +594,26 @@
 
 Function3c410: ; 3c410
 	ld a, [PlayerSubStatus4]
-	and $20
-	jp nz, Function3c432
+	and 1 << SUBSTATUS_RECHARGE
+	jp nz, .quit
+
 	ld hl, EnemySubStatus3
-	res 3, [hl]
+	res SUBSTATUS_FLINCHED, [hl]
 	ld hl, PlayerSubStatus3
-	res 3, [hl]
+	res SUBSTATUS_FLINCHED, [hl]
+
 	ld a, [hl]
-	and $12
-	jp nz, Function3c432
+	and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_RAMPAGE
+	jp nz, .quit
+
 	ld hl, PlayerSubStatus1
-	bit 6, [hl]
-	jp nz, Function3c432
+	bit SUBSTATUS_ROLLOUT, [hl]
+	jp nz, .quit
+
 	and a
 	ret
-; 3c432
 
-Function3c432: ; 3c432
+.quit
 	scf
 	ret
 ; 3c434
@@ -614,7 +622,7 @@
 	call Function3c410
 	jp c, .asm_3c4ba
 	ld hl, PlayerSubStatus5
-	bit 4, [hl]
+	bit SUBSTATUS_ENCORED, [hl]
 	jr z, .asm_3c449
 	ld a, [LastPlayerMove]
 	ld [CurPlayerMove], a
@@ -627,11 +635,11 @@
 	and a
 	jr nz, .asm_3c4b5
 	ld a, [PlayerSubStatus3]
-	and $1
+	and 1 << SUBSTATUS_BIDE
 	jr nz, .asm_3c4ba
 	xor a
 	ld [$d235], a
-	inc a
+	inc a ; POUND
 	ld [FXAnimIDLo], a
 	call Function3e4bc
 	push af
@@ -638,7 +646,7 @@
 	call Function30b4
 	call UpdateBattleHuds
 	ld a, [CurPlayerMove]
-	cp $a5
+	cp STRUGGLE
 	jr z, .asm_3c476
 	call PlayClickSFX
 
@@ -653,26 +661,26 @@
 	callab UpdateMoveData
 	xor a
 	ld [$c732], a
-	ld a, [PlayerMoveEffect]
-	cp $77
+	ld a, [wPlayerMoveStruct + MOVE_EFFECT]
+	cp EFFECT_FURY_CUTTER
 	jr z, .asm_3c494
 	xor a
 	ld [PlayerFuryCutterCount], a
 
 .asm_3c494
-	ld a, [PlayerMoveEffect]
-	cp $51
+	ld a, [wPlayerMoveStruct + MOVE_EFFECT]
+	cp EFFECT_RAGE
 	jr z, .asm_3c4a4
 	ld hl, PlayerSubStatus4
-	res 6, [hl]
+	res SUBSTATUS_RAGE, [hl]
 	xor a
 	ld [$c72b], a
 
 .asm_3c4a4
-	ld a, [PlayerMoveEffect]
-	cp $6f
+	ld a, [wPlayerMoveStruct + MOVE_EFFECT]
+	cp EFFECT_PROTECT
 	jr z, .asm_3c4c9
-	cp $74
+	cp EFFECT_ENDURE
 	jr z, .asm_3c4c9
 	xor a
 	ld [PlayerProtectCount], a
@@ -680,7 +688,7 @@
 
 .asm_3c4b5
 	ld hl, PlayerSubStatus3
-	res 0, [hl]
+	res SUBSTATUS_BIDE, [hl]
 
 .asm_3c4ba
 	xor a
@@ -688,7 +696,7 @@
 	ld [PlayerProtectCount], a
 	ld [$c72b], a
 	ld hl, PlayerSubStatus4
-	res 6, [hl]
+	res SUBSTATUS_RAGE, [hl]
 
 .asm_3c4c9
 	call Function3e7c1
@@ -701,7 +709,7 @@
 	ld [PlayerProtectCount], a
 	ld [$c72b], a
 	ld hl, PlayerSubStatus4
-	res 6, [hl]
+	res SUBSTATUS_RAGE, [hl]
 	xor a
 	ret
 ; 3c4df
@@ -717,16 +725,16 @@
 	call .asm_3c518
 .asm_3c4ed
 	ld hl, PlayerSubStatus5
-	bit 4, [hl]
+	bit SUBSTATUS_ENCORED, [hl]
 	ret z
 	ld a, [PlayerEncoreCount]
 	dec a
 	ld [PlayerEncoreCount], a
 	jr z, .asm_3c50a
-	ld hl, BattleMonPPMove1
+	ld hl, BattleMonPP
 	ld a, [CurMoveNum]
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [hl]
 	and $3f
@@ -734,7 +742,7 @@
 
 .asm_3c50a
 	ld hl, PlayerSubStatus5
-	res 4, [hl]
+	res SUBSTATUS_ENCORED, [hl]
 	call SetEnemyTurn
 	ld hl, BattleText_0x80c8a
 	jp StdBattleTextBox
@@ -741,16 +749,16 @@
 
 .asm_3c518
 	ld hl, EnemySubStatus5
-	bit 4, [hl]
+	bit SUBSTATUS_ENCORED, [hl]
 	ret z
 	ld a, [EnemyEncoreCount]
 	dec a
 	ld [EnemyEncoreCount], a
 	jr z, .asm_3c535
-	ld hl, EnemyMonPPMove1
+	ld hl, EnemyMonPP
 	ld a, [CurEnemyMoveNum]
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [hl]
 	and $3f
@@ -758,7 +766,7 @@
 
 .asm_3c535
 	ld hl, EnemySubStatus5
-	res 4, [hl]
+	res SUBSTATUS_ENCORED, [hl]
 	call SetPlayerTurn
 	ld hl, BattleText_0x80c8a
 	jp StdBattleTextBox
@@ -771,7 +779,7 @@
 	jr nz, .Stay
 
 	ld a, [PlayerSubStatus5]
-	bit 7, a
+	bit SUBSTATUS_CANT_RUN, a
 	jr nz, .Stay
 
 	ld a, [$c731]
@@ -915,7 +923,7 @@
 	ld a, b
 	dec a
 	ld hl, Moves + MOVE_EFFECT
-	ld bc, Move2 - Move1
+	ld bc, MOVE_LENGTH
 	call AddNTimes
 	ld a, BANK(Moves)
 	call GetFarByte
@@ -939,14 +947,14 @@
 	ld a, [$d232]
 	and a
 	ret nz
-	call Function3c710
+	call HasPlayerFainted
 	jp z, Function3d14e
-	call Function3c70b
+	call HasEnemyFainted
 	jp z, Function3cd55
 
 .asm_3c62f
 	call SetEnemyTurn
-	call Function3c716
+	call ResidualDamage
 	jp z, Function3cd55
 	call RefreshBattleHuds
 	call Function3c6cf
@@ -955,12 +963,12 @@
 	ld a, [$d232]
 	and a
 	ret nz
-	call Function3c70b
+	call HasEnemyFainted
 	jp z, Function3cd55
-	call Function3c710
+	call HasPlayerFainted
 	jp z, Function3d14e
 	call SetPlayerTurn
-	call Function3c716
+	call ResidualDamage
 	jp z, Function3d14e
 	call RefreshBattleHuds
 	xor a
@@ -981,13 +989,13 @@
 	ret nz
 	call Function3d2e0
 	ret c
-	call Function3c70b
+	call HasEnemyFainted
 	jp z, Function3cd55
-	call Function3c710
+	call HasPlayerFainted
 	jp z, Function3d14e
 	push bc
 	call SetPlayerTurn
-	call Function3c716
+	call ResidualDamage
 	pop bc
 	jp z, Function3d14e
 	push bc
@@ -1003,14 +1011,14 @@
 	ld a, [$d232]
 	and a
 	ret nz
-	call Function3c710
+	call HasPlayerFainted
 	jp z, Function3d14e
-	call Function3c70b
+	call HasEnemyFainted
 	jp z, Function3cd55
 
 .asm_3c6be
 	call SetEnemyTurn
-	call Function3c716
+	call ResidualDamage
 	jp z, Function3cd55
 	call RefreshBattleHuds
 	xor a
@@ -1033,32 +1041,32 @@
 ; 3c6ed
 
 Function3c6ed: ; 3c6ed
-	ld a, $5
-	call _GetBattleVar
-	res 2, [hl]
-	res 5, [hl]
-	ld a, $9
-	call _GetBattleVar
-	res 6, [hl]
+	ld a, BATTLE_VARS_SUBSTATUS1_OPP
+	call GetBattleVarAddr
+	res SUBSTATUS_PROTECT, [hl]
+	res SUBSTATUS_ENDURE, [hl]
+	ld a, BATTLE_VARS_SUBSTATUS5_OPP
+	call GetBattleVarAddr
+	res SUBSTATUS_DESTINY_BOND, [hl]
 	ret
 ; 3c6fe
 
 Function3c6fe: ; 3c6fe
-	ld a, $4
-	call _GetBattleVar
-	res 6, [hl]
+	ld a, BATTLE_VARS_SUBSTATUS5
+	call GetBattleVarAddr
+	res SUBSTATUS_DESTINY_BOND, [hl]
 	ret
 ; 3c706
 
-Function3c706: ; 3c706
+HasUserFainted: ; 3c706
 	ld a, [hBattleTurn]
 	and a
-	jr z, Function3c710
-Function3c70b: ; 3c70b
-	ld hl, EnemyMonHPHi
+	jr z, HasPlayerFainted
+HasEnemyFainted: ; 3c70b
+	ld hl, EnemyMonHP
 	jr Function3c713
 
-Function3c710: ; 3c710
+HasPlayerFainted: ; 3c710
 	ld hl, BattleMonHP
 
 Function3c713: ; 3c713
@@ -1067,108 +1075,121 @@
 	ret
 ; 3c716
 
-Function3c716: ; 3c716
-	call Function3c706
+ResidualDamage: ; 3c716
+; Return z if the user fainted before
+; or as a result of residual damage.
+; For Sandstorm damage, see HandleWeather.
+
+	call HasUserFainted
 	ret z
-	ld a, $a
+
+	ld a, BATTLE_VARS_STATUS
 	call GetBattleVar
-	and $18
-	jr z, .asm_3c768
-	ld hl, BattleText_0x807e2
-	ld de, $0106
-	and $10
-	jr z, .asm_3c733
-	ld hl, BattleText_0x807f8
-	ld de, $0105
+	and 1 << PSN | 1 << BRN
+	jr z, .did_psn_brn
 
-.asm_3c733
+	ld hl, HurtByPoisonText
+	ld de, ANIM_PSN
+	and 1 << BRN
+	jr z, .got_anim
+	ld hl, HurtByBurnText
+	ld de, ANIM_BRN
+.got_anim
+
 	push de
 	call StdBattleTextBox
 	pop de
+
 	xor a
 	ld [$cfca], a
 	call Function3ee0f
 	call GetEighthMaxHP
-	ld de, $c674
+	ld de, PlayerToxicCount
 	ld a, [hBattleTurn]
 	and a
 	jr z, .asm_3c74d
-	ld de, $c67c
-
+	ld de, EnemyToxicCount
 .asm_3c74d
-	ld a, $4
+
+	ld a, BATTLE_VARS_SUBSTATUS5
 	call GetBattleVar
-	bit 0, a
-	jr z, .asm_3c765
-	call Function3cc76
+	bit SUBSTATUS_TOXIC, a
+	jr z, .did_toxic
+	call GetSixteenthMaxHP
 	ld a, [de]
 	inc a
 	ld [de], a
-	ld hl, $0000
-.asm_3c75f
+	ld hl, 0
+.add
 	add hl, bc
 	dec a
-	jr nz, .asm_3c75f
+	jr nz, .add
 	ld b, h
 	ld c, l
+.did_toxic
 
-.asm_3c765
 	call Function3cc3f
+.did_psn_brn
 
-.asm_3c768
-	call Function3c706
-	jp z, .asm_3c7f7
-	ld a, $3
-	call _GetBattleVar
-	bit 7, [hl]
+	call HasUserFainted
+	jp z, .fainted
+
+	ld a, BATTLE_VARS_SUBSTATUS4
+	call GetBattleVarAddr
+	bit SUBSTATUS_LEECH_SEED, [hl]
 	jr z, .asm_3c7a1
-	call Function3c8e4
+
+	call SwitchTurnCore
 	xor a
 	ld [$cfca], a
-	ld de, $0107
-	ld a, $7
+	ld de, ANIM_SAP
+	ld a, BATTLE_VARS_SUBSTATUS3_OPP
 	call GetBattleVar
-	and $60
+	and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
 	call z, Function3ee0f
-	call Function3c8e4
+	call SwitchTurnCore
+
 	call GetEighthMaxHP
 	call Function3cc3f
 	ld a, $1
 	ld [hBGMapMode], a
 	call Function3ccef
-	ld hl, BattleText_0x8080e
+	ld hl, LeechSeedSapsText
 	call StdBattleTextBox
-
 .asm_3c7a1
-	call Function3c706
-	jr z, .asm_3c7f7
-	ld a, $0
-	call _GetBattleVar
-	bit 0, [hl]
+
+	call HasUserFainted
+	jr z, .fainted
+
+	ld a, BATTLE_VARS_SUBSTATUS1
+	call GetBattleVarAddr
+	bit SUBSTATUS_NIGHTMARE, [hl]
 	jr z, .asm_3c7c5
 	xor a
 	ld [$cfca], a
-	ld de, $010c
+	ld de, ANIM_IN_NIGHTMARE
 	call Function3ee0f
 	call GetQuarterMaxHP
 	call Function3cc3f
-	ld hl, BattleText_0x80822
+	ld hl, HasANightmareText
 	call StdBattleTextBox
-
 .asm_3c7c5
-	call Function3c706
-	jr z, .asm_3c7f7
-	ld a, $0
-	call _GetBattleVar
-	bit 1, [hl]
+
+	call HasUserFainted
+	jr z, .fainted
+
+	ld a, BATTLE_VARS_SUBSTATUS1
+	call GetBattleVarAddr
+	bit SUBSTATUS_CURSE, [hl]
 	jr z, .asm_3c7e9
+
 	xor a
 	ld [$cfca], a
-	ld de, $010c
+	ld de, ANIM_IN_NIGHTMARE
 	call Function3ee0f
 	call GetQuarterMaxHP
 	call Function3cc3f
-	ld hl, BattleText_0x80836
+	ld hl, HurtByCurseText
 	call StdBattleTextBox
 
 .asm_3c7e9
@@ -1176,7 +1197,7 @@
 	ld a, [hBattleTurn]
 	and a
 	jr z, .asm_3c7f4
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 
 .asm_3c7f4
 	ld a, [hli]
@@ -1183,9 +1204,9 @@
 	or [hl]
 	ret nz
 
-.asm_3c7f7
+.fainted
 	call RefreshBattleHuds
-	ld c, $14
+	ld c, 20
 	call DelayFrames
 	xor a
 	ret
@@ -1212,21 +1233,21 @@
 	ld hl, EnemyPerishCount
 
 .asm_3c827
-	ld a, $0
+	ld a, BATTLE_VARS_SUBSTATUS1
 	call GetBattleVar
-	bit 4, a
+	bit SUBSTATUS_PERISH, a
 	ret z
 	dec [hl]
 	ld a, [hl]
 	ld [$d265], a
 	push af
-	ld hl, BattleText_0x80864
+	ld hl, PerishCountText
 	call StdBattleTextBox
 	pop af
 	ret nz
-	ld a, $0
-	call _GetBattleVar
-	res 4, [hl]
+	ld a, BATTLE_VARS_SUBSTATUS1
+	call GetBattleVarAddr
+	res SUBSTATUS_PERISH, [hl]
 	ld a, [hBattleTurn]
 	and a
 	jr nz, .asm_3c85c
@@ -1243,7 +1264,7 @@
 	ret
 
 .asm_3c85c
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	xor a
 	ld [hli], a
 	ld [hl], a
@@ -1285,9 +1306,9 @@
 	ld a, [hl]
 	and a
 	ret z
-	ld a, $3
+	ld a, BATTLE_VARS_SUBSTATUS4
 	call GetBattleVar
-	bit 4, a
+	bit SUBSTATUS_SUBSTITUTE, a
 	ret nz
 	ld a, [de]
 	ld [$d265], a
@@ -1295,20 +1316,19 @@
 	call GetMoveName
 	dec [hl]
 	jr z, .asm_3c8de
-	ld a, $2
+	ld a, BATTLE_VARS_SUBSTATUS3
 	call GetBattleVar
-	and $60
+	and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
 	jr nz, .asm_3c8d3
-	call Function3c8e4
+	call SwitchTurnCore
 	xor a
 	ld [$cfca], a
 	ld [FXAnimIDHi], a
-	ld a, $37
-	call Predef
-	call Function3c8e4
+	predef PlayBattleAnim
+	call SwitchTurnCore
 
 .asm_3c8d3
-	call Function3cc76
+	call GetSixteenthMaxHP
 	call Function3cc3f
 	ld hl, BattleText_0x80de2
 	jr .asm_3c8e1
@@ -1320,9 +1340,9 @@
 	jp StdBattleTextBox
 ; 3c8e4
 
-Function3c8e4: ; 3c8e4
+SwitchTurnCore: ; 3c8e4
 	ld a, [hBattleTurn]
-	xor $1
+	xor 1
 	ld [hBattleTurn], a
 	ret
 ; 3c8eb
@@ -1352,7 +1372,7 @@
 	ld a, [hBattleTurn]
 	and a
 	jr z, .asm_3c922
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 
 .asm_3c922
 	ld a, [hli]
@@ -1367,8 +1387,8 @@
 	ret z
 
 .asm_3c92d
-	call Function3cc76
-	call Function3c8e4
+	call GetSixteenthMaxHP
+	call SwitchTurnCore
 	call Function3ccef
 	ld hl, BattleText_0x80880
 	jp StdBattleTextBox
@@ -1390,7 +1410,7 @@
 .asm_3c957
 	callab GetUserItem
 	ld a, b
-	cp $6
+	cp HELD_RESTORE_PP
 	jr nz, .asm_3c9ae
 	ld hl, PartyMon1PP
 	ld a, [CurBattleMon]
@@ -1397,7 +1417,7 @@
 	call GetPartyLocation
 	ld d, h
 	ld e, l
-	ld hl, PartyMon1Move1
+	ld hl, PartyMon1Moves
 	ld a, [CurBattleMon]
 	call GetPartyLocation
 	ld a, [hBattleTurn]
@@ -1408,12 +1428,12 @@
 	ld a, [IsInBattle]
 	dec a
 	jr z, .asm_3c99b
-	ld hl, OTPartyMon1PPMove1
+	ld hl, OTPartyMon1PP
 	ld a, [CurOTMon]
 	call GetPartyLocation
 	ld d, h
 	ld e, l
-	ld hl, OTPartyMon1Move1
+	ld hl, OTPartyMon1Moves
 	ld a, [CurOTMon]
 	call GetPartyLocation
 
@@ -1430,7 +1450,7 @@
 	inc de
 	inc c
 	ld a, c
-	cp $4
+	cp NUM_MOVES
 	jr nz, .asm_3c99d
 
 .asm_3c9ae
@@ -1437,12 +1457,12 @@
 	ret
 
 .asm_3c9af
+	; lousy hack
 	ld a, [hl]
-	cp $a6
-	ld b, $1
+	cp SKETCH
+	ld b, 1
 	jr z, .asm_3c9b8
-	ld b, $5
-
+	ld b, 5
 .asm_3c9b8
 	ld a, [de]
 	add b
@@ -1451,18 +1471,17 @@
 	push bc
 	ld a, [hl]
 	ld [$d265], a
-	ld de, BattleMonItem
-	ld hl, BattleMonPPMove1
+	ld de, BattleMonMoves - 1
+	ld hl, BattleMonPP
 	ld a, [hBattleTurn]
 	and a
 	jr z, .asm_3c9d2
-	ld de, EnemyMonItem
-	ld hl, EnemyMonPPMove1
-
+	ld de, EnemyMonMoves - 1
+	ld hl, EnemyMonPP
 .asm_3c9d2
 	inc de
 	pop bc
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	push hl
 	ld h, d
@@ -1470,6 +1489,7 @@
 	add hl, bc
 	pop de
 	pop bc
+
 	ld a, [$d265]
 	cp [hl]
 	jr nz, .asm_3c9f5
@@ -1478,14 +1498,12 @@
 	ld a, [PlayerSubStatus5]
 	jr z, .asm_3c9ee
 	ld a, [EnemySubStatus5]
-
 .asm_3c9ee
-	bit 3, a
+	bit SUBSTATUS_TRANSFORMED, a
 	jr nz, .asm_3c9f5
 	ld a, [de]
 	add b
 	ld [de], a
-
 .asm_3c9f5
 	callab GetUserItem
 	ld a, [hl]
@@ -1507,9 +1525,9 @@
 
 .asm_3ca14
 	call GetItemName
-	call Function3c8e4
+	call SwitchTurnCore
 	call Function3ddc8
-	call Function3c8e4
+	call SwitchTurnCore
 	ld hl, BattleText_0x80899
 	jp StdBattleTextBox
 ; 3ca26
@@ -1542,27 +1560,32 @@
 	ld [hl], a
 	cp $1
 	ret nz
+
 	ld hl, BattleText_0x808b6
 	call StdBattleTextBox
-	ld a, $10
-	call _GetBattleVar
+
+	ld a, BATTLE_VARS_MOVE
+	call GetBattleVarAddr
 	push af
-	ld a, $f8
+	ld a, FUTURE_SIGHT
 	ld [hl], a
+
 	callab UpdateMoveData
 	xor a
 	ld [AttackMissed], a
 	ld [AlreadyDisobeyed], a
-	ld a, $a
+	ld a, 10
 	ld [TypeModifier], a
 	callab DoMove
 	xor a
 	ld [CurDamage], a
-	ld [$d257], a
-	ld a, $10
-	call _GetBattleVar
+	ld [CurDamage + 1], a
+
+	ld a, BATTLE_VARS_MOVE
+	call GetBattleVarAddr
 	pop af
 	ld [hl], a
+
 	call UpdateBattleMonInParty
 	jp UpdateEnemyMonInParty
 ; 3ca8f
@@ -1578,7 +1601,7 @@
 	call .asm_3cac9
 .asm_3ca9d
 	ld a, [BattleMonStatus]
-	bit 5, a
+	bit FRZ, a
 	ret z
 	ld a, [$c73f]
 	and a
@@ -1591,7 +1614,7 @@
 	ld a, [CurBattleMon]
 	ld hl, PartyMon1Status
 	call GetPartyLocation
-	ld [hl], $0
+	ld [hl], 0
 	call UpdateBattleHuds
 	call SetEnemyTurn
 	ld hl, DefrostedOpponentText
@@ -1599,7 +1622,7 @@
 
 .asm_3cac9
 	ld a, [EnemyMonStatus]
-	bit 5, a
+	bit FRZ, a
 	ret z
 	ld a, [$c740]
 	and a
@@ -1609,6 +1632,7 @@
 	ret nc
 	xor a
 	ld [EnemyMonStatus], a
+
 	ld a, [IsInBattle]
 	dec a
 	jr z, .asm_3caef
@@ -1615,9 +1639,9 @@
 	ld a, [CurOTMon]
 	ld hl, OTPartyMon1Status
 	call GetPartyLocation
-	ld [hl], $0
-
+	ld [hl], 0
 .asm_3caef
+
 	call UpdateBattleHuds
 	call SetPlayerTurn
 	ld hl, DefrostedOpponentText
@@ -1635,12 +1659,12 @@
 	call .asm_3cb1c
 .asm_3cb09
 	ld a, [PlayerScreens]
-	bit 2, a
+	bit SCREENS_SAFEGUARD, a
 	ret z
 	ld hl, $c701
 	dec [hl]
 	ret nz
-	res 2, a
+	res SCREENS_SAFEGUARD, a
 	ld [PlayerScreens], a
 	xor a
 	jr .asm_3cb2e
@@ -1647,12 +1671,12 @@
 
 .asm_3cb1c
 	ld a, [EnemyScreens]
-	bit 2, a
+	bit SCREENS_SAFEGUARD, a
 	ret z
 	ld hl, $c705
 	dec [hl]
 	ret nz
-	res 2, a
+	res SCREENS_SAFEGUARD, a
 	ld [EnemyScreens], a
 	ld a, $1
 
@@ -1676,7 +1700,7 @@
 .CheckPlayer
 	call SetPlayerTurn
 	ld de, .Your
-	call .asm_3cb6f
+	call .Copy
 	ld hl, PlayerScreens
 	ld de, PlayerLightScreenCount
 	jr .FadeScreens
@@ -1684,7 +1708,7 @@
 .CheckEnemy
 	call SetEnemyTurn
 	ld de, .Enemy
-	call .asm_3cb6f
+	call .Copy
 	ld hl, EnemyScreens
 	ld de, EnemyLightScreenCount
 
@@ -1695,7 +1719,7 @@
 	call nz, FadeReflect
 	ret
 
-.asm_3cb6f
+.Copy
 	ld hl, StringBuffer1
 	jp CopyName2
 ; 3cb75
@@ -1734,37 +1758,37 @@
 ; 3cb9e
 
 HandleWeather: ; 3cb9e
-
 	ld a, [Weather]
-	cp 0
+	cp WEATHER_NONE
 	ret z
 
 	ld hl, WeatherCount
 	dec [hl]
-	jr z, .asm_3cc13
+	jr z, .ended
 
 	ld hl, .WeatherMessages
-	call .asm_3cc1e
+	call .PrintWeatherMessage
+
 	ld a, [Weather]
 	cp WEATHER_SANDSTORM
 	ret nz
+
 	ld a, [$ffcb]
 	cp 1
-	jr z, .asm_3cbc7
+	jr z, .enemy_first
 
-; Player first
+.player_first
 	call SetPlayerTurn
-	call .asm_3cbd0
+	call .SandstormDamage
 	call SetEnemyTurn
-	jr .asm_3cbd0
+	jr .SandstormDamage
 
-.asm_3cbc7
-; Enemy first
+.enemy_first
 	call SetEnemyTurn
-	call .asm_3cbd0
+	call .SandstormDamage
 	call SetPlayerTurn
 
-.asm_3cbd0
+.SandstormDamage
 	ld a, BATTLE_VARS_SUBSTATUS3
 	call GetBattleVar
 	bit SUBSTATUS_UNDERGROUND, a
@@ -1773,10 +1797,9 @@
 	ld hl, BattleMonType1
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_3cbe3
+	jr z, .ok
 	ld hl, EnemyMonType1
-
-.asm_3cbe3
+.ok
 	ld a, [hli]
 	cp ROCK
 	ret z
@@ -1793,26 +1816,26 @@
 	cp STEEL
 	ret z
 
-	call Function3c8e4
+	call SwitchTurnCore
 	xor a
 	ld [$cfca], a
-	ld de, $010b
+	ld de, ANIM_IN_SANDSTORM
 	call Function3ee17
-	call Function3c8e4
+	call SwitchTurnCore
 	call GetEighthMaxHP
 	call Function3cc3f
 
-	ld hl, BattleText_0x8084d
+	ld hl, SandstormHitsText
 	jp StdBattleTextBox
 
-.asm_3cc13
+.ended
 	ld hl, .WeatherEndedMessages
-	call .asm_3cc1e
+	call .PrintWeatherMessage
 	xor a
 	ld [Weather], a
 	ret
 
-.asm_3cc1e
+.PrintWeatherMessage
 	ld a, [Weather]
 	dec a
 	ld c, a
@@ -1846,15 +1869,13 @@
 ; 3cc45
 
 
-
 Function3cc45: ; 3cc45
 	ld hl, BattleMonHP
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_3cc50
-	ld hl, EnemyMonHPHi
-
-.asm_3cc50
+	jr z, .ok
+	ld hl, EnemyMonHP
+.ok
 	inc hl
 	ld a, [hl]
 	ld [$d1ec], a
@@ -1879,16 +1900,17 @@
 	ret
 ; 3cc76
 
-Function3cc76: ; 3cc76
+GetSixteenthMaxHP: ; 3cc76
 	call GetQuarterMaxHP
+	; quarter result
 	srl c
 	srl c
+	; round up
 	ld a, c
 	and a
-	jr nz, .asm_3cc82
+	jr nz, .ok
 	inc c
-
-.asm_3cc82
+.ok
 	ret
 ; 3cc83
 
@@ -1934,7 +1956,7 @@
 ; output: bc
 	call GetMaxHP
 
-; halve reslut
+; halve result
 	srl b
 	rr c
 
@@ -1951,18 +1973,12 @@
 GetMaxHP: ; 3ccac
 ; output: bc, Buffer1-2
 
-; player
 	ld hl, BattleMonMaxHP
-
-; whose turn?
 	ld a, [hBattleTurn]
 	and a
-	jr z, .gethp
-
-; enemy
+	jr z, .ok
 	ld hl, EnemyMonMaxHP
-
-.gethp
+.ok
 	ld a, [hli]
 	ld [Buffer2], a
 	ld b, a
@@ -1977,10 +1993,9 @@
 	ld hl, BattleMonHP
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_3cccd
+	jr z, .ok
 	ld hl, EnemyMonHP
-
-.asm_3cccd
+.ok
 	ld a, [hli]
 	ld b, a
 	ld a, [hli]
@@ -1998,10 +2013,9 @@
 	ld hl, BattleMonHP + 1
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_3cce9
+	jr z, .ok
 	ld hl, EnemyMonHP + 1
-
-.asm_3cce9
+.ok
 	ld a, c
 	sub [hl]
 	dec hl
@@ -2015,25 +2029,25 @@
 	ld hl, EnemyMonMaxHP
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_3ccfa
+	jr z, .ok
 	ld hl, BattleMonMaxHP
-
-.asm_3ccfa
+.ok
 	ld a, [hli]
-	ld [Buffer2], a
+	ld [Buffer1 + 1], a
 	ld a, [hld]
-	ld [Buffer1], a
+	ld [Buffer1 + 0], a
 	dec hl
 	ld a, [hl]
-	ld [$d1ec], a
+	ld [Buffer1 + 2], a
 	add c
 	ld [hld], a
-	ld [$d1ee], a
+	ld [Buffer1 + 4], a
 	ld a, [hl]
-	ld [$d1ed], a
+	ld [Buffer1 + 3], a
 	adc b
 	ld [hli], a
-	ld [$d1ef], a
+	ld [Buffer1 + 5], a
+
 	ld a, [Buffer1]
 	ld c, a
 	ld a, [hld]
@@ -2045,15 +2059,15 @@
 	jr c, .asm_3cd2d
 	ld a, b
 	ld [hli], a
-	ld [$d1ef], a
+	ld [Buffer1 + 5], a
 	ld a, c
 	ld [hl], a
-	ld [$d1ee], a
-
+	ld [Buffer1 + 4], a
 .asm_3cd2d
-	call Function3c8e4
+
+	call SwitchTurnCore
 	call Function3cd36
-	jp Function3c8e4
+	jp SwitchTurnCore
 ; 3cd36
 
 Function3cd36: ; 3cd36
@@ -2061,21 +2075,18 @@
 	jp UpdateBattleHuds
 ; 3cd3c
 
-
 Function3cd3c: ; 3cd3c
 	hlcoord 10, 9
 	ld a, [hBattleTurn]
 	and a
-	ld a, $1
-	jr z, .asm_3cd4a
+	ld a, 1
+	jr z, .ok
 	hlcoord 2, 2
 	xor a
-
-.asm_3cd4a
+.ok
 	push bc
 	ld [$d10a], a
-	ld a, $b
-	call Predef
+	predef Functionc6e0
 	pop bc
 	ret
 ; 3cd55
@@ -2093,18 +2104,22 @@
 	ld a, d
 	and a
 	jp z, LostBattle
+
 	ld hl, BattleMonHP
 	ld a, [hli]
 	or [hl]
-	call nz, Function3df48
+	call nz, UpdatePlayerHUD
+
 	ld a, $1
 	ld [hBGMapMode], a
-	ld c, $3c
+	ld c, 60
 	call DelayFrames
+
 	ld a, [IsInBattle]
 	dec a
 	jr nz, .asm_3cd8c
-	ld a, $1
+
+	ld a, 1
 	ld [BattleEnded], a
 	ret
 
@@ -2111,13 +2126,16 @@
 .asm_3cd8c
 	call Function3cf35
 	jp z, Function3cfa4
+
 	ld hl, BattleMonHP
 	ld a, [hli]
 	or [hl]
 	jr nz, .asm_3cdba
+
 	call Function3d1f8
 	jr nc, .asm_3cda4
-	ld a, $1
+
+	ld a, 1
 	ld [BattleEnded], a
 	ret
 
@@ -2125,6 +2143,7 @@
 	call Function3d227
 	call Function3d2e0
 	jp c, Function3c0e5
+
 	ld a, $1
 	ld [$d0ec], a
 	call Function3cf4a
@@ -2147,7 +2166,7 @@
 	jr z, .asm_3cde6
 	call ClearSprites
 	hlcoord 1, 0
-	ld bc, $040a
+	lb bc, 4, 10
 	call ClearBox
 	call Function3d2b3
 	ld a, $1
@@ -2185,7 +2204,7 @@
 
 .asm_3ce16
 	ld hl, PlayerSubStatus3
-	res 2, [hl]
+	res SUBSTATUS_IN_LOOP, [hl]
 	xor a
 	ld hl, EnemyDamageTaken
 	ld [hli], a
@@ -2264,13 +2283,13 @@
 Function3ceaa: ; 3ceaa
 	ld a, [PartyCount]
 	ld b, a
-	ld hl, PartyMon1Species
-	ld c, $1
-	ld d, $0
+	ld hl, PartyMon1
+	ld c, 1
+	ld d, 0
 .asm_3ceb5
 	push hl
 	push bc
-	ld bc, $0022
+	ld bc, PartyMon1HP - PartyMon1
 	add hl, bc
 	ld a, [hli]
 	or [hl]
@@ -2277,14 +2296,16 @@
 	pop bc
 	pop hl
 	jr z, .asm_3ced1
+
 	push hl
 	push bc
-	ld bc, $0001
+	ld bc, PartyMon1Item - PartyMon1
 	add hl, bc
 	pop bc
 	ld a, [hl]
 	pop hl
-	cp $39
+
+	cp EXP_SHARE
 	jr nz, .asm_3ced1
 	ld a, d
 	or c
@@ -2293,14 +2314,15 @@
 .asm_3ced1
 	sla c
 	push de
-	ld de, $0030
+	ld de, PartyMon2 - PartyMon1
 	add hl, de
 	pop de
 	dec b
 	jr nz, .asm_3ceb5
+
 	ld a, d
-	ld e, $0
-	ld b, $6
+	ld e, 0
+	ld b, PARTY_LENGTH
 .asm_3cee1
 	srl a
 	jr nc, .asm_3cee6
@@ -2331,7 +2353,7 @@
 	call Function37b6
 	call Function3d43b
 	hlcoord 9, 7
-	ld bc, $050b
+	lb bc, 5, 11
 	call ClearBox
 	ld hl, BattleText_0x80a75
 	jp StdBattleTextBox
@@ -2345,7 +2367,7 @@
 	ld de, SFX_UNKNOWN_2A
 	call PlaySFX
 	hlcoord 1, 0
-	ld bc, $040a
+	lb bc, 4, 10
 	call ClearBox
 	ld hl, BattleText_0x809a8
 	jp StdBattleTextBox
@@ -2356,7 +2378,7 @@
 	ld b, a
 	xor a
 	ld hl, OTPartyMon1HP
-	ld de, $0030
+	ld de, PartyMon2 - PartyMon1
 .asm_3cf40
 	or [hl]
 	inc hl
@@ -2371,7 +2393,7 @@
 
 Function3cf4a: ; 3cf4a
 	ld hl, EnemyHPPal
-	ld e, $30
+	ld e, HP_BAR_LENGTH_PX
 	call Function3e12e
 	call WaitBGMap
 	callba Function2c012
@@ -2379,7 +2401,7 @@
 	and a
 	jr z, .asm_3cf6d
 	call Function3e8e4
-	ld a, [$d430]
+	ld a, [wBattleAction]
 	cp $f
 	ret z
 	call Function30b4
@@ -2415,7 +2437,7 @@
 	call SetEnemyTurn
 	call SpikesDamage
 	xor a
-	ld [EnemyMoveAnimation], a
+	ld [wEnemyMoveStruct + MOVE_ANIM], a
 	ld [$d0ec], a
 	inc a
 	ret
@@ -2433,7 +2455,7 @@
 	callab Function39939
 	ld hl, BattleText_0x809da
 	call StdBattleTextBox
-	call Function3d2f1
+	call IsMobileBattle
 	jr z, .asm_3cff5
 	ld a, [InLinkBattle]
 	and a
@@ -2445,11 +2467,9 @@
 	ld c, $28
 	call DelayFrames
 	ld a, [BattleType]
-	cp $1
+	cp BATTLETYPE_CANLOSE
 	jr nz, .asm_3cfe8
-	ld a, $2
-	call Predef
-
+	predef Functionc658
 .asm_3cfe8
 	ld a, [$c2cc]
 	bit 0, a
@@ -2475,7 +2495,7 @@
 	ld c, $3
 	callba Function11c000
 	call Functiona80
-	ld hl, $c6ec
+	ld hl, wPayDayMoney
 	ld a, [hli]
 	or [hl]
 	inc hl
@@ -2494,7 +2514,7 @@
 	push af
 	ld a, $0
 	jr nc, .asm_3d044
-	ld a, [$d854]
+	ld a, [wMomSavingMoney]
 	and $7
 	cp $3
 	jr nz, .asm_3d044
@@ -2525,7 +2545,7 @@
 	call Function3d099
 	pop af
 	jr nc, .asm_3d07b
-	ld a, [$d854]
+	ld a, [wMomSavingMoney]
 	and $7
 	jr z, .asm_3d07b
 	ld hl, SentToMomTexts
@@ -2547,7 +2567,7 @@
 Function3d081: ; 3d081
 	push bc
 	ld hl, $c688
-	ld de, $d853
+	ld de, wMomsMoney + 2
 	call Function3d0be
 	pop bc
 	ret
@@ -2556,7 +2576,7 @@
 Function3d08d: ; 3d08d
 	push bc
 	ld hl, $c688
-	ld de, $d850
+	ld de, Money + 2
 	call Function3d0be
 	pop bc
 	ret
@@ -2585,13 +2605,13 @@
 
 
 Function3d0b1: ; 3d0b1
-	ld hl, $d853
+	ld hl, wMomsMoney + 2
 	ld a, [hld]
-	cp $3f
+	cp 999999 % $100
 	ld a, [hld]
-	sbc $42
+	sbc 999999 / $100 % $100
 	ld a, [hl]
-	sbc $f
+	sbc 999999 / $10000 % $100
 	ret
 ; 3d0be
 
@@ -2616,17 +2636,17 @@
 	jr nz, .asm_3d0ce
 	pop hl
 	ld a, [hld]
-	cp $3f
+	cp 999999 % $100
 	ld a, [hld]
-	sbc $42
+	sbc 999999 / $100 % $100
 	ld a, [hl]
-	sbc $f
+	sbc 999999 / $10000 % $100
 	ret c
-	ld [hl], $f
+	ld [hl], 999999 / $10000 % $100
 	inc hl
-	ld [hl], $42
+	ld [hl], 999999 / $100 % $100
 	inc hl
-	ld [hl], $3f
+	ld [hl], 999999 % $100
 	ret
 ; 3d0ea
 
@@ -2643,7 +2663,7 @@
 	call Function3ceaa
 	pop de
 	jr nz, .asm_3d11e
-	ld hl, $c6ec
+	ld hl, wPayDayMoney
 	ld a, [hli]
 	or [hl]
 	jr nz, .asm_3d11e
@@ -2724,7 +2744,7 @@
 
 Function3d14e: ; 3d14e
 	call Function3cef1
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld a, [hli]
 	or [hl]
 	call z, Function3cf14
@@ -2735,7 +2755,7 @@
 	ld a, d
 	and a
 	jp z, LostBattle
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld a, [hli]
 	or [hl]
 	jr nz, .asm_3d185
@@ -2777,10 +2797,9 @@
 	ld c, a
 	ld hl, $c664
 	ld b, $0
-	ld a, $3
-	call Predef
+	predef FlagPredef
 	ld hl, EnemySubStatus3
-	res 2, [hl]
+	res SUBSTATUS_IN_LOOP, [hl]
 	xor a
 	ld [Danger], a
 	ld hl, PlayerDamageTaken
@@ -2833,7 +2852,7 @@
 	cp $1
 	jr z, .asm_3d20a
 	ld hl, PartyMon1Speed
-	ld de, EnemyMonSpd
+	ld de, EnemyMonSpeed
 	jp Function3d8b3
 ; 3d227
 
@@ -2854,7 +2873,7 @@
 	ld [$d0ec], a
 	call Function3d2e0
 	jr c, .asm_3d251
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld a, [hli]
 	or [hl]
 	jr nz, .asm_3d26c
@@ -2920,7 +2939,6 @@
 ; 3d2e0
 
 
-
 Function3d2e0: ; 3d2e0
 	ld a, [InLinkBattle]
 	cp $4
@@ -2936,7 +2954,7 @@
 	ret
 ; 3d2f1
 
-Function3d2f1: ; 3d2f1
+IsMobileBattle: ; 3d2f1
 	ld a, [InLinkBattle]
 	cp $4
 	ret
@@ -2962,18 +2980,18 @@
 ; 3d329
 
 Function3d329: ; 3d329
-	call Function3d2f1
-	jr z, .asm_3d335
+	call IsMobileBattle
+	jr z, .mobile
 	callba PartyMenuSelect
 	ret
 
-.asm_3d335
+.mobile
 	callba Function100cb5
 	ret
 ; 3d33c
 
 PickPartyMonInBattle: ; 3d33c
-.asm_3d33c
+.loop
 	ld a, $2 ; Which PKMN?
 	ld [PartyMenuActionText], a
 	call Function3d313
@@ -2980,7 +2998,7 @@
 	call Function3d329
 	ret c
 	call Function3d887
-	jr z, .asm_3d33c
+	jr z, .loop
 	xor a
 	ret
 ; 3d34f
@@ -3108,14 +3126,14 @@
 	and $c0
 	add 2
 	ld [$d0ee], a
-	jr .asm_3d412
+	jr .text
 
 .asm_3d40a
 	ld hl, LostAgainstText
-	call Function3d2f1
+	call IsMobileBattle
 	jr z, .asm_3d417
 
-.asm_3d412
+.text
 	call StdBattleTextBox
 
 .end
@@ -3204,7 +3222,7 @@
 
 
 Function3d490: ; 3d490
-	ld [hConnectionStripLength], a
+	ld [$ffaf], a
 	ld c, a
 .asm_3d493
 	push bc
@@ -3214,7 +3232,7 @@
 	push hl
 	call Function3d4ae
 	pop hl
-	ld de, 20
+	ld de, SCREEN_WIDTH
 	add hl, de
 	dec b
 	jr nz, .asm_3d497
@@ -3228,24 +3246,24 @@
 ; 3d4ae
 
 Function3d4ae: ; 3d4ae
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	ld c, a
 	cp $8
-	jr nz, .asm_3d4bc
-.asm_3d4b5
+	jr nz, .back
+.forward
 	ld a, [hli]
 	ld [hld], a
 	dec hl
 	dec c
-	jr nz, .asm_3d4b5
+	jr nz, .forward
 	ret
 
-.asm_3d4bc
+.back
 	ld a, [hld]
 	ld [hli], a
 	inc hl
 	dec c
-	jr nz, .asm_3d4bc
+	jr nz, .back
 	ret
 ; 3d4c3
 
@@ -3273,7 +3291,6 @@
 	call Function3d533
 	jr c, .asm_3d4f1
 	call Function3d599
-
 .asm_3d4f1
 	call Function3d6ca
 	call Function3d74b
@@ -3288,7 +3305,7 @@
 	ld [$c6fc], a
 	ld [$d0ec], a
 	inc a
-	ld [$c711], a
+	ld [wEnemyIsSwitching], a
 	call Function309d
 	jp Function3e3ad
 ; 3d517
@@ -3298,11 +3315,10 @@
 	call Function3d533
 	jr c, .asm_3d522
 	call Function3d599
-
 .asm_3d522
 	call Function3d6ca
-	ld a, $1
-	ld [$c711], a
+	ld a, 1
+	ld [wEnemyIsSwitching], a
 	call Function3d7a0
 	call Function3d7b8
 	jp Function3d7c7
@@ -3312,8 +3328,9 @@
 	ld a, [InLinkBattle]
 	and a
 	jr z, .asm_3d541
-	ld a, [$d430]
-	sub $4
+
+	ld a, [wBattleAction]
+	sub NUM_MOVES
 	ld b, a
 	jr .asm_3d555
 
@@ -3363,14 +3380,12 @@
 	ld a, [CurBattleMon]
 	ld c, a
 	ld hl, $c664
-	ld b, $1
+	ld b, SET_FLAG
 	push bc
-	ld a, $3
-	call Predef
+	predef FlagPredef
 	pop bc
 	ld hl, $c6fc
-	ld a, $3
-	jp Predef
+	predef_jump FlagPredef
 ; 3d599
 
 Function3d599: ; 3d599
@@ -3412,25 +3427,25 @@
 
 Function3d5d7: ; 3d5d7
 	push bc
-	ld hl, OTPartyMon1Move1
+	ld hl, OTPartyMon1Moves
 	ld a, b
 	call GetPartyLocation
 	pop bc
-	ld e, $5
-.asm_3d5e2
+	ld e, NUM_MOVES + 1
+.loop
 	dec e
-	jr z, .asm_3d617
+	jr z, .done
 	ld a, [hli]
 	and a
-	jr z, .asm_3d617
+	jr z, .done
 	push hl
 	push de
 	push bc
 	dec a
-	ld hl, Moves + MOVE_ANIM
-	ld bc, Move2 - Move1
+	ld hl, Moves
+	ld bc, MOVE_LENGTH
 	call AddNTimes
-	ld de, EnemyMoveAnimation
+	ld de, wEnemyMoveStruct
 	ld a, BANK(Moves)
 	call FarCopyBytes
 	call SetEnemyTurn
@@ -3439,13 +3454,12 @@
 	pop de
 	pop hl
 	ld a, [$d265]
-	cp $b
-	jr c, .asm_3d5e2
+	cp 10 + 1 ; 1.0 + 0.1
+	jr c, .loop
 	ld hl, Buffer1
 	set 0, [hl]
 	ret
-
-.asm_3d617
+.done
 	ret
 ; 3d618
 
@@ -3455,7 +3469,7 @@
 	ld a, b
 	inc a
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [hl]
 	dec a
@@ -3462,22 +3476,22 @@
 	ld hl, BaseData + 7 ; type
 	ld bc, $20
 	call AddNTimes
-	ld de, EnemyMonType1
+	ld de, EnemyMonType
 	ld bc, 2
 	ld a, BANK(BaseData)
 	call FarCopyBytes
 	ld a, [BattleMonType1]
-	ld [PlayerMoveType], a
+	ld [wPlayerMoveStruct + MOVE_TYPE], a
 	call SetPlayerTurn
 	callab Function347c8
 	ld a, [$d265]
-	cp $b
+	cp 10 + 1 ; 1.0 + 0.1
 	jr nc, .asm_3d663
 	ld a, [BattleMonType2]
-	ld [PlayerMoveType], a
+	ld [wPlayerMoveStruct + MOVE_TYPE], a
 	callab Function347c8
 	ld a, [$d265]
-	cp $b
+	cp 10 + 1 ; 1.0 + 0.1
 	jr nc, .asm_3d663
 	pop bc
 	ret
@@ -3572,7 +3586,7 @@
 	inc a
 	ld hl, OTPartyCount
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [hl]
 	ld [TempEnemyMonSpecies], a
@@ -3584,14 +3598,12 @@
 	ld a, [$def4]
 	and a
 	jr nz, .asm_3d708
-	ld hl, EnemyMonAtkDefDV
-	ld a, $2d
-	call Predef
+	ld hl, EnemyMonDVs
+	predef GetUnownLetter
 	ld a, [UnownLetter]
 	ld [$def4], a
-
 .asm_3d708
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld a, [hli]
 	ld [$c6ea], a
 	ld a, [hl]
@@ -3610,7 +3622,7 @@
 	and a
 	jp nz, .asm_3d749
 	ld a, [Options]
-	bit 6, a
+	bit BATTLE_SHIFT, a
 	jr nz, .asm_3d749
 	ld a, [CurPartyMon]
 	push af
@@ -3676,7 +3688,7 @@
 	call Function1c07
 	call ClearSprites
 	hlcoord 1, 0
-	ld bc, $040a
+	lb bc, 4, 10
 	call ClearBox
 	call WaitBGMap
 	jp Function3ee27
@@ -3694,25 +3706,26 @@
 	ld [CurPartySpecies], a
 	ld [CurSpecies], a
 	call GetBaseData
-	ld a, $1
+	ld a, OTPARTYMON
 	ld [MonType], a
-	ld a, $1f
-	call Predef
+	predef Function5084a
 	call Function3f47c
+
 	xor a
 	ld [$cfca], a
 	ld [$c689], a
 	call SetEnemyTurn
-	ld de, $0101
+	ld de, ANIM_SEND_OUT_MON
 	call Function3ee17
+
 	call Function3da79
 	jr nc, .asm_3d800
-	ld a, $1
+	ld a, 1 ; shiny anim
 	ld [$c689], a
-	ld de, $0101
+	ld de, ANIM_SEND_OUT_MON
 	call Function3ee17
-
 .asm_3d800
+
 	ld bc, TempMonSpecies
 	callba Function4e53f
 	jr c, .asm_3d82c
@@ -3721,8 +3734,7 @@
 	hlcoord 12, 0
 	ld d, $0
 	ld e, $0
-	ld a, $47
-	call Predef
+	predef Functiond008e
 	jr .asm_3d82c
 
 .asm_3d821
@@ -3732,7 +3744,7 @@
 	call Function37b6
 
 .asm_3d82c
-	call Function3e036
+	call UpdateEnemyHUD
 	ld a, $1
 	ld [hBGMapMode], a
 	ret
@@ -3751,7 +3763,7 @@
 	ld [hl], a
 	ld [EnemyDisableCount], a
 	ld [EnemyFuryCutterCount], a
-	ld [$c681], a
+	ld [EnemyProtectCount], a
 	ld [$c72c], a
 	ld [EnemyDisabledMove], a
 	ld [$c6fa], a
@@ -3759,7 +3771,7 @@
 	ld [$c731], a
 	ld [EnemyTurnsTaken], a
 	ld hl, PlayerSubStatus5
-	res 7, [hl]
+	res SUBSTATUS_CANT_RUN, [hl]
 	ret
 ; 3d867
 
@@ -3779,7 +3791,7 @@
 	ld e, a
 	xor a
 	ld hl, PartyMon1HP
-	ld bc, $002f
+	ld bc, PartyMon2 - (PartyMon1 + 1)
 .asm_3d87e
 	or [hl]
 	inc hl
@@ -3826,15 +3838,15 @@
 	ld a, [BattleType]
 	cp $2
 	jp z, .asm_3d9a2
-	cp $6
+	cp BATTLETYPE_CONTEST
 	jp z, .asm_3d9a2
-	cp $9
+	cp BATTLETYPE_TRAP
 	jp z, .asm_3d98d
-	cp $b
+	cp BATTLETYPE_CELEBI
 	jp z, .asm_3d98d
-	cp $7
+	cp BATTLETYPE_SHINY
 	jp z, .asm_3d98d
-	cp $c
+	cp BATTLETYPE_SUICUNE
 	jp z, .asm_3d98d
 
 	ld a, [InLinkBattle]
@@ -3846,7 +3858,7 @@
 	jp nz, .asm_3d992
 
 	ld a, [EnemySubStatus5]
-	bit 7, a
+	bit SUBSTATUS_CANT_RUN, a
 	jp nz, .asm_3d98d
 
 	ld a, [$c730]
@@ -3860,7 +3872,7 @@
 	ld b, a
 	callab GetItem
 	ld a, b
-	cp $48
+	cp HELD_ESCAPE
 	pop de
 	pop hl
 	jr nz, .asm_3d916
@@ -3969,8 +3981,8 @@
 	call Function3d2e0
 	jr c, .asm_3d9f5
 
-; Got away safely
-	ld a, [$d430]
+	; Got away safely
+	ld a, [wBattleAction]
 	cp $f
 	ld a, $2
 	jr z, .asm_3d9cf
@@ -4011,21 +4023,21 @@
 
 
 Function3da0d: ; 3da0d
-	ld a, $0
+	ld a, PartyMon1Species - PartyMon1
 	call GetPartyParamLocation
 	ld de, BattleMonSpecies
-	ld bc, $0006
+	ld bc, 1 + 1 + NUM_MOVES ; species, item, moves ; BattleMonDVs - BattleMonSpecies
 	call CopyBytes
-	ld bc, $000f
+	ld bc, PartyMon1DVs - (PartyMon1Species + 1 + 1 + NUM_MOVES)
 	add hl, bc
-	ld de, BattleMonAtkDefDV
-	ld bc, $0007
+	ld de, BattleMonDVs
+	ld bc, 2 + NUM_MOVES + 1 ; DVs, PP, happiness ; BattleMonLevel - BattleMonDVs
 	call CopyBytes
 	inc hl
 	inc hl
 	inc hl
 	ld de, BattleMonLevel
-	ld bc, $0011
+	ld bc, 1 + 1 + 1 + 2 + 2 * 6 ; level, status, unused, stats
 	call CopyBytes
 	ld a, [BattleMonSpecies]
 	ld [TempBattleMonSpecies], a
@@ -4036,15 +4048,15 @@
 	ld [BattleMonType1], a
 	ld a, [BaseType2]
 	ld [BattleMonType2], a
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld a, [CurBattleMon]
 	call SkipNames
 	ld de, BattleMonNick
-	ld bc, $000b
+	ld bc, PKMN_NAME_LENGTH
 	call CopyBytes
-	ld hl, BattleMonAtk
+	ld hl, BattleMonAttack
 	ld de, PlayerStats
-	ld bc, $000a
+	ld bc, 2 * 5
 	call CopyBytes
 	call Function3ec2c
 	call BadgeStatBoosts
@@ -4066,9 +4078,9 @@
 ; 3da85
 
 Function3da85: ; 3da85
-	ld hl, BattleMonAtkDefDV
+	ld hl, BattleMonDVs
 	ld a, [PlayerSubStatus5]
-	bit 3, a
+	bit SUBSTATUS_TRANSFORMED, a
 	ret z
 	ld hl, PartyMon1DVs
 	ld a, [CurBattleMon]
@@ -4076,15 +4088,15 @@
 ; 3da97
 
 Function3da97: ; 3da97
-	ld hl, EnemyMonAtkDefDV
+	ld hl, EnemyMonDVs
 	ld a, [EnemySubStatus5]
-	bit 3, a
+	bit SUBSTATUS_TRANSFORMED, a
 	ret z
 	ld hl, $c6f2
 	ld a, [IsInBattle]
 	dec a
 	ret z
-	ld hl, OTPartyMon1AtkDefDV
+	ld hl, OTPartyMon1DVs
 	ld a, [CurOTMon]
 	jp GetPartyLocation
 ; 3dab1
@@ -4106,31 +4118,31 @@
 	ld hl, OTPartyMon1Species
 	call GetPartyLocation
 	ld de, EnemyMonSpecies
-	ld bc, $0006
+	ld bc, 1 + 1 + NUM_MOVES
 	call CopyBytes
-	ld bc, $000f
+	ld bc, OTPartyMon1DVs - (OTPartyMon1Species + 1 + 1 + NUM_MOVES)
 	add hl, bc
-	ld de, EnemyMonAtkDefDV
-	ld bc, $0007
+	ld de, EnemyMonDVs
+	ld bc, 2 + NUM_MOVES + 1
 	call CopyBytes
 	inc hl
 	inc hl
 	inc hl
 	ld de, EnemyMonLevel
-	ld bc, $0011
+	ld bc, 1 + 1 + 1 + 2 + 2 * 6
 	call CopyBytes
 	ld a, [EnemyMonSpecies]
 	ld [CurSpecies], a
 	call GetBaseData
-	ld hl, OTPartyMon1Nickname
+	ld hl, OTPartyMonNicknames
 	ld a, [CurPartyMon]
 	call SkipNames
 	ld de, EnemyMonNick
-	ld bc, $000b
+	ld bc, PKMN_NAME_LENGTH
 	call CopyBytes
-	ld hl, EnemyMonAtk
+	ld hl, EnemyMonAttack
 	ld de, EnemyStats
-	ld bc, $000a
+	ld bc, 2 * 5
 	call CopyBytes
 	call Function3ec30
 	ld hl, BaseType1
@@ -4140,9 +4152,9 @@
 	inc de
 	ld a, [hl]
 	ld [de], a
-	ld hl, BaseHP
+	ld hl, BaseStats
 	ld de, EnemyMonBaseStats
-	ld b, $5
+	ld b, 5
 .asm_3db25
 	ld a, [hli]
 	ld [de], a
@@ -4169,7 +4181,7 @@
 	call Function3db5f
 	call EmptyBattleTextBox
 	call Function309d
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld a, [hli]
 	or [hl]
 	ret
@@ -4177,12 +4189,11 @@
 
 
 Function3db5f: ; 3db5f
-	ld hl, BattleMonAtkDefDV
-	ld a, $2d
-	call Predef
+	ld hl, BattleMonDVs
+	predef GetUnownLetter
 	hlcoord 1, 5
-	ld b, $7
-	ld c, $8
+	ld b, 7
+	ld c, 8
 	call ClearBox
 	call WaitBGMap
 	xor a
@@ -4193,11 +4204,11 @@
 	ld [$d0d2], a
 	ld [CurMoveNum], a
 	ld [TypeModifier], a
-	ld [PlayerMoveAnimation], a
+	ld [wPlayerMoveStruct + MOVE_ANIM], a
 	ld [LastEnemyCounterMove], a
 	ld [LastPlayerCounterMove], a
 	ld [LastPlayerMove], a
-	call Function3e4a8
+	call CheckAmuletCoin
 	call Function3ee27
 	xor a
 	ld [$c731], a
@@ -4205,17 +4216,17 @@
 	xor a
 	ld [$cfca], a
 	ld [$c689], a
-	ld de, $0101
+	ld de, ANIM_SEND_OUT_MON
 	call Function3ee17
 	call Function3da74
 	jr nc, .asm_3dbbc
 	ld a, $1
 	ld [$c689], a
-	ld de, $0101
+	ld de, ANIM_SEND_OUT_MON
 	call Function3ee17
 
 .asm_3dbbc
-	ld a, $0
+	ld a, PartyMon1Species - PartyMon1
 	call GetPartyParamLocation
 	ld b, h
 	ld c, l
@@ -4227,7 +4238,7 @@
 	call Function37b6
 
 .asm_3dbd6
-	call Function3df48
+	call UpdatePlayerHUD
 	ld a, $1
 	ld [hBGMapMode], a
 	ret
@@ -4273,20 +4284,20 @@
 
 SpikesDamage: ; 3dc23
 	ld hl, PlayerScreens
-	ld de, BattleMonType1
-	ld bc, Function3df48
+	ld de, BattleMonType
+	ld bc, UpdatePlayerHUD
 	ld a, [hBattleTurn]
 	and a
 	jr z, .ok
 	ld hl, EnemyScreens
-	ld de, EnemyMonType1
-	ld bc, Function3e036
+	ld de, EnemyMonType
+	ld bc, UpdateEnemyHUD
 .ok
 
 	bit SCREENS_SPIKES, [hl]
 	ret z
 
-; Flying-types aren't affected by Spikes.
+	; Flying-types aren't affected by Spikes.
 	ld a, [de]
 	cp FLYING
 	ret z
@@ -4313,15 +4324,17 @@
 ; 3dc5b
 
 Function3dc5b: ; 3dc5b
-	ld a, $10
+	ld a, BATTLE_VARS_MOVE
 	call GetBattleVar
 	ld b, a
 	call GetMoveEffect
 	ld a, b
-	cp $80
+	cp EFFECT_PURSUIT
 	jr nz, .asm_3dce4
+
 	ld a, [CurBattleMon]
 	push af
+
 	ld hl, DoPlayerTurn
 	ld a, [hBattleTurn]
 	and a
@@ -4329,19 +4342,22 @@
 	ld hl, DoEnemyTurn
 	ld a, [$c71a]
 	ld [CurBattleMon], a
-
 .asm_3dc7e
 	ld a, BANK(DoPlayerTurn)
 	rst FarCall
-	ld a, $10
-	call _GetBattleVar
+
+	ld a, BATTLE_VARS_MOVE
+	call GetBattleVarAddr
 	ld a, $ff
 	ld [hl], a
+
 	pop af
 	ld [CurBattleMon], a
+
 	ld a, [hBattleTurn]
 	and a
 	jr z, .asm_3dcc0
+
 	ld a, [$c71a]
 	call Function399f
 	ld hl, BattleMonHP
@@ -4348,6 +4364,7 @@
 	ld a, [hli]
 	or [hl]
 	jr nz, .asm_3dce4
+
 	ld a, $f0
 	ld [CryTracks], a
 	ld a, [BattleMonSpecies]
@@ -4356,17 +4373,17 @@
 	ld c, a
 	ld hl, $c664
 	ld b, $0
-	ld a, $3
-	call Predef
+	predef FlagPredef
 	call Function3d43b
 	ld hl, BattleText_0x80a75
 	jr .asm_3dcdf
 
 .asm_3dcc0
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld a, [hli]
 	or [hl]
 	jr nz, .asm_3dce4
+
 	ld de, SFX_KINESIS
 	call PlaySFX
 	call WaitSFX
@@ -4392,7 +4409,7 @@
 	xor a
 	ld [hBattleTurn], a
 	ld [$cfca], a
-	ld de, $0102
+	ld de, ANIM_RETURN_MON
 	call Function3ee17
 	pop af
 	ld [hBattleTurn], a
@@ -4428,8 +4445,8 @@
 	ld a, b
 	cp $1
 	ret nz
-	ld de, EnemyMonHPLo
-	ld hl, EnemyMonMaxHPHi
+	ld de, EnemyMonHP + 1
+	ld hl, EnemyMonMaxHP
 	ld a, [hBattleTurn]
 	and a
 	jr z, .asm_3dd4a
@@ -4502,8 +4519,7 @@
 
 .asm_3dda4
 	ld [$d10a], a
-	ld a, $b
-	call Predef
+	predef Functionc6e0
 Function3ddac:
 	call RefreshBattleHuds
 	callab GetOpponentItem
@@ -4521,15 +4537,14 @@
 	push de
 	push bc
 	call EmptyBattleTextBox
-	ld a, $69
+	ld a, RECOVER
 	ld [FXAnimIDLo], a
-	call Function3c8e4
+	call SwitchTurnCore
 	xor a
 	ld [$cfca], a
 	ld [FXAnimIDHi], a
-	ld a, $37
-	call Predef
-	call Function3c8e4
+	predef PlayBattleAnim
+	call SwitchTurnCore
 	pop bc
 	pop de
 	pop hl
@@ -4548,8 +4563,8 @@
 	jr nz, .asm_3ddf2
 	dec hl
 	ld b, [hl]
-	ld a, $b
-	call _GetBattleVar
+	ld a, BATTLE_VARS_STATUS_OPP
+	call GetBattleVarAddr
 	and b
 	ret z
 	xor a
@@ -4557,20 +4572,20 @@
 	push bc
 	call UpdateOpponentInParty
 	pop bc
-	ld a, $9
-	call _GetBattleVar
+	ld a, BATTLE_VARS_SUBSTATUS5_OPP
+	call GetBattleVarAddr
 	and [hl]
-	res 0, [hl]
-	ld a, $5
-	call _GetBattleVar
+	res SUBSTATUS_TOXIC, [hl]
+	ld a, BATTLE_VARS_SUBSTATUS1_OPP
+	call GetBattleVarAddr
 	and [hl]
-	res 0, [hl]
+	res SUBSTATUS_NIGHTMARE, [hl]
 	ld a, b
 	cp $7f
 	jr nz, .asm_3de26
-	ld a, $7
-	call _GetBattleVar
-	res 7, [hl]
+	ld a, BATTLE_VARS_SUBSTATUS3_OPP
+	call GetBattleVarAddr
+	res SUBSTATUS_CONFUSED, [hl]
 
 .asm_3de26
 	ld hl, Function365fd
@@ -4580,10 +4595,10 @@
 	ld hl, Function365d7
 
 .asm_3de31
-	call Function3c8e4
+	call SwitchTurnCore
 	ld a, BANK(Function365fd)
 	rst FarCall
-	call Function3c8e4
+	call SwitchTurnCore
 	call Function3ddc8
 	call Function3ddac
 	ld a, $1
@@ -4603,23 +4618,23 @@
 
 
 Function3de51: ; 3de51
-	ld a, $7
+	ld a, BATTLE_VARS_SUBSTATUS3_OPP
 	call GetBattleVar
-	bit 7, a
+	bit SUBSTATUS_CONFUSED, a
 	ret z
 	callab GetOpponentItem
 	ld a, b
-	cp $10
+	cp HELD_HEAL_CONFUSION
 	jr z, .asm_3de67
-	cp $f
+	cp HELD_HEAL_STATUS
 	ret nz
 
 .asm_3de67
 	ld a, [hl]
 	ld [$d265], a
-	ld a, $7
-	call _GetBattleVar
-	res 7, [hl]
+	ld a, BATTLE_VARS_SUBSTATUS3_OPP
+	call GetBattleVarAddr
+	res SUBSTATUS_CONFUSED, [hl]
 	call GetItemName
 	call Function3ddc8
 	ld hl, BattleText_0x80dab
@@ -4715,13 +4730,13 @@
 ; 3defc
 
 .data_3defc
-	dbw $1f, BattleCommand70
-	dbw $20, BattleCommand71
-	dbw $21, BattleCommand72
-	dbw $22, BattleCommand73
-	dbw $23, BattleCommand74
-	dbw $24, BattleCommand75
-	dbw $25, BattleCommand76
+	dbw HELD_ATTACK_UP,     BattleCommand70
+	dbw HELD_DEFENSE_UP,    BattleCommand71
+	dbw HELD_SPEED_UP,      BattleCommand72
+	dbw HELD_SP_ATTACK_UP,  BattleCommand73
+	dbw HELD_SP_DEFENSE_UP, BattleCommand74
+	dbw HELD_ACCURACY_UP,   BattleCommand75
+	dbw HELD_EVASION_UP,    BattleCommand76
 	db $ff
 ; 3df12
 
@@ -4750,7 +4765,7 @@
 	ld hl, PlayerHPPal
 	call SetHPPal
 	call CheckDanger
-	call Function3e043
+	call DrawEnemyHUD
 	ld hl, EnemyHPPal
 	call SetHPPal
 	pop bc
@@ -4761,7 +4776,7 @@
 
 
 
-Function3df48:: ; 3df48
+UpdatePlayerHUD:: ; 3df48
 	push hl
 	push de
 	push bc
@@ -4778,9 +4793,9 @@
 	xor a
 	ld [hBGMapMode], a
 
-; Clear the area
+	; Clear the area
 	hlcoord 9, 7
-	ld bc, $050b
+	lb bc, 5, 11
 	call ClearBox
 
 	callba DrawPlayerExpBar
@@ -4789,15 +4804,14 @@
 	ld [hl], $73 ; vertical bar
 	call PrintPlayerHUD
 
-; HP bar
+	; HP bar
 	hlcoord 10, 9
-	ld b, OTPARTYMON
+	ld b, 1
 	xor a
 	ld [MonType], a
-	ld a, PREDEF_DRAW_PLAYER_HP
-	call Predef
+	predef DrawPlayerHP
 
-; Exp bar
+	; Exp bar
 	push de
 	ld a, [CurBattleMon]
 	ld hl, PartyMon1Exp + 2
@@ -4822,24 +4836,24 @@
 	ld hl, BattleMonHP
 	ld a, [hli]
 	or [hl]
-	jr z, .asm_3dfb2
+	jr z, .no_danger
 	ld a, [$c6fd]
 	and a
-	jr nz, .asm_3dfbe
+	jr nz, .done
 	ld a, [PlayerHPPal]
-	cp $2
-	jr z, .asm_3dfb9
+	cp HP_RED
+	jr z, .danger
 
-.asm_3dfb2
+.no_danger
 	ld hl, Danger
 	res 7, [hl]
-	jr .asm_3dfbe
+	jr .done
 
-.asm_3dfb9
+.danger
 	ld hl, Danger
 	set 7, [hl]
 
-.asm_3dfbe
+.done
 	ret
 ; 3dfbf
 
@@ -4878,11 +4892,11 @@
 	ld a, $3
 	ld [MonType], a
 	callab GetGender
-	ld a, $7f
+	ld a, " "
 	jr c, .asm_3e013
-	ld a, $ef
+	ld a, "♂"
 	jr nz, .asm_3e013
-	ld a, $f5
+	ld a, "♀"
 
 .asm_3e013
 	hlcoord 17, 8
@@ -4891,13 +4905,12 @@
 	push af
 	push hl
 	ld de, BattleMonStatus
-	ld a, $21
-	call Predef
+	predef Function50d2e
 	pop hl
 	pop bc
 	ret nz
 	ld a, b
-	cp $7f
+	cp " "
 	jr nz, .asm_3e02d
 	dec hl
 
@@ -4907,12 +4920,12 @@
 	jp PrintLevel
 ; 3e036
 
-Function3e036:: ; 3e036
+UpdateEnemyHUD:: ; 3e036
 	push hl
 	push de
 	push bc
-	call Function3e043
-	call Function3e127
+	call DrawEnemyHUD
+	call UpdateEnemyHPPal
 	pop bc
 	pop de
 	pop hl
@@ -4919,13 +4932,16 @@
 	ret
 ; 3e043
 
-Function3e043: ; 3e043
+DrawEnemyHUD: ; 3e043
 	xor a
 	ld [hBGMapMode], a
+
 	hlcoord 1, 0
-	ld bc, $040b
+	lb bc, 4, 11
 	call ClearBox
+
 	callba Function2c0c5
+
 	ld a, [TempEnemyMonSpecies]
 	ld [CurSpecies], a
 	ld [CurPartySpecies], a
@@ -4937,52 +4953,52 @@
 	ld h, b
 	ld l, c
 	dec hl
-	ld hl, EnemyMonAtkDefDV
+
+	ld hl, EnemyMonDVs
 	ld de, TempMonDVs
 	ld a, [EnemySubStatus5]
-	bit 3, a
-	jr z, .asm_3e080
+	bit SUBSTATUS_TRANSFORMED, a
+	jr z, .ok
 	ld hl, $c6f2
-
-.asm_3e080
+.ok
 	ld a, [hli]
 	ld [de], a
 	inc de
 	ld a, [hl]
 	ld [de], a
+
 	ld a, $3
 	ld [MonType], a
 	callab GetGender
-	ld a, $7f
+	ld a, " "
 	jr c, .asm_3e09a
-	ld a, $ef
+	ld a, "♂"
 	jr nz, .asm_3e09a
-	ld a, $f5
+	ld a, "♀"
 
 .asm_3e09a
 	hlcoord 9, 1
 	ld [hl], a
+
 	hlcoord 6, 1
 	push af
 	push hl
 	ld de, EnemyMonStatus
-	ld a, $21
-	call Predef
+	predef Function50d2e
 	pop hl
 	pop bc
 	jr nz, .asm_3e0be
 	ld a, b
-	cp $7f
+	cp " "
 	jr nz, .asm_3e0b5
 	dec hl
-
 .asm_3e0b5
 	ld a, [EnemyMonLevel]
 	ld [TempMonLevel], a
 	call PrintLevel
-
 .asm_3e0be
-	ld hl, EnemyMonHPHi
+
+	ld hl, EnemyMonHP
 	ld a, [hli]
 	ld [$ffb5], a
 	ld a, [hld]
@@ -4991,16 +5007,16 @@
 	jr nz, .asm_3e0d1
 	ld c, a
 	ld e, a
-	ld d, $6
+	ld d, HP_BAR_LENGTH
 	jp .asm_3e11a
-
 .asm_3e0d1
+
 	xor a
 	ld [hMultiplicand], a
-	ld a, $30
+	ld a, HP_BAR_LENGTH_PX
 	ld [hMultiplier], a
 	call Multiply
-	ld hl, EnemyMonMaxHPHi
+	ld hl, EnemyMonMaxHP
 	ld a, [hli]
 	ld b, a
 	ld a, [hl]
@@ -5035,19 +5051,20 @@
 	call Divide
 	ld a, [$ffb6]
 	ld e, a
-	ld a, $6
+	ld a, HP_BAR_LENGTH
 	ld d, a
 	ld c, a
+
 .asm_3e11a
 	xor a
 	ld [$d10a], a
 	hlcoord 2, 2
-	ld b, $0
+	ld b, 0
 	call DrawHPBar
 	ret
 ; 3e127
 
-Function3e127: ; 3e127
+UpdateEnemyHPPal: ; 3e127
 	ld hl, EnemyHPPal
 	call Function3e12e
 	ret
@@ -5066,52 +5083,56 @@
 	ret
 ; 3e139
 
-Function3e139: ; 3e139
+BattleMenu: ; 3e139
 	xor a
 	ld [hBGMapMode], a
 	call Function30bf
+
 	ld a, [BattleType]
 	cp $2
-	jr z, .asm_3e156
-	cp $3
-	jr z, .asm_3e156
+	jr z, .ok
+	cp BATTLETYPE_TUTORIAL
+	jr z, .ok
 	call EmptyBattleTextBox
 	call UpdateBattleHuds
 	call EmptyBattleTextBox
 	call Function309d
+.ok
 
-.asm_3e156
+.loop
 	ld a, [BattleType]
-	cp $6
-	jr nz, .asm_3e165
-	callba Function24f13
-	jr .asm_3e175
+	cp BATTLETYPE_CONTEST
+	jr nz, .not_contest
+	callba ContestBattleMenu
+	jr .next
+.not_contest
 
-.asm_3e165
+	; Auto input: choose "ITEM"
 	ld a, [InputType]
 	or a
 	jr z, .asm_3e171
 	callba Function1de294
 .asm_3e171
-	call Function3e19b
+
+	call LoadBattleMenu2
 	ret c
 
-.asm_3e175
+.next
 	ld a, $1
 	ld [hBGMapMode], a
 	ld a, [$d0d2]
 	cp $1
-	jp z, Function3e192
+	jp z, BattleMenu_Fight
 	cp $3
-	jp z, Function3e1c7
+	jp z, BattleMenu_Pack
 	cp $2
-	jp z, Function3e28d
+	jp z, BattleMenu_PKMN
 	cp $4
-	jp z, Function3e489
-	jr .asm_3e156
+	jp z, BattleMenu_Run
+	jr .loop
 ; 3e192
 
-Function3e192: ; 3e192
+BattleMenu_Fight: ; 3e192
 	xor a
 	ld [$d267], a
 	call Function30b4
@@ -5119,59 +5140,64 @@
 	ret
 ; 3e19b
 
-Function3e19b: ; 3e19b
-	call Function3d2f1
-	jr z, .asm_3e1a8
-	callba LoadBattleMenuDataHeader
+LoadBattleMenu2: ; 3e19b
+	call IsMobileBattle
+	jr z, .mobile
+
+	callba LoadBattleMenu
 	and a
 	ret
 
-.asm_3e1a8
+.mobile
 	callba Function100b12
 	ld a, [$cd2b]
 	and a
 	ret z
+
 	ld hl, $cd2a
 	bit 4, [hl]
-	jr nz, .asm_3e1c5
+	jr nz, .error
 	ld hl, BattleText_0x81863
 	call StdBattleTextBox
-	ld c, $3c
+	ld c, 60
 	call DelayFrames
-
-.asm_3e1c5
+.error
 	scf
 	ret
 ; 3e1c7
 
-Function3e1c7: ; 3e1c7
+BattleMenu_Pack: ; 3e1c7
 	ld a, [InLinkBattle]
 	and a
-	jp nz, Function3e22b
+	jp nz, ItemsCantBeUsed
+
 	ld a, [$cfc0]
 	and a
-	jp nz, Function3e22b
+	jp nz, ItemsCantBeUsed
+
 	call Function1d6e
+
 	ld a, [BattleType]
-	cp $3
-	jr z, .asm_3e1f1
-	cp $6
-	jr z, .asm_3e201
-	callba Function10493
+	cp BATTLETYPE_TUTORIAL
+	jr z, .tutorial
+	cp BATTLETYPE_CONTEST
+	jr z, .contest
+
+	callba BattlePack
 	ld a, [$d0ec]
 	and a
 	jr z, .asm_3e20d
 	jr .asm_3e209
 
-.asm_3e1f1
+.tutorial
 	callba Function107bb
-	ld a, $5
+	ld a, POKE_BALL
 	ld [CurItem], a
 	call DoItemEffect
 	jr .asm_3e209
 
-.asm_3e201
-	ld a, $b1
+.contest
+	ld a, PARK_BALL
 	ld [CurItem], a
 	call DoItemEffect
 
@@ -5189,13 +5215,13 @@
 	call WaitBGMap
 	call Function3ee27
 	call Function309d
-	jp Function3e139
+	jp BattleMenu
 ; 3e22b
 
-Function3e22b: ; 3e22b
+ItemsCantBeUsed: ; 3e22b
 	ld hl, BattleText_0x80bf3
 	call StdBattleTextBox
-	jp Function3e139
+	jp BattleMenu
 ; 3e234
 
 Function3e234: ; 3e234
@@ -5214,7 +5240,7 @@
 	call Function3ed9f
 	call ClearSprites
 	ld a, [BattleType]
-	cp $3
+	cp BATTLETYPE_TUTORIAL
 	jr z, .asm_3e25d
 	call Function3f43d
 
@@ -5243,7 +5269,7 @@
 	ret
 ; 3e28d
 
-Function3e28d: ; 3e28d
+BattleMenu_PKMN: ; 3e28d
 	call Function1d6e
 Function3e290:
 	call Function1c07
@@ -5290,11 +5316,11 @@
 	call Function309d
 	call ClearSGB
 	call Function32f9
-	jp Function3e139
+	jp BattleMenu
 ; 3e2f5
 
 Function3e2f5: ; 3e2f5
-	call Function3d2f1
+	call IsMobileBattle
 	jr z, .asm_3e301
 	callba Function24e99
 	ret
@@ -5350,7 +5376,7 @@
 	and a
 	jr nz, .asm_3e378
 	ld a, [EnemySubStatus5]
-	bit 7, a
+	bit SUBSTATUS_CANT_RUN, a
 	jr z, .asm_3e381
 
 .asm_3e378
@@ -5378,8 +5404,8 @@
 ; 3e3ad
 
 Function3e3ad: ; 3e3ad
-	ld a, $1
-	ld [$c710], a
+	ld a, 1
+	ld [wPlayerIsSwitching], a
 	ld a, [InLinkBattle]
 	and a
 	jr z, .asm_3e3c1
@@ -5399,12 +5425,12 @@
 	ret
 
 .asm_3e3cf
-	ld a, [$d430]
+	ld a, [wBattleAction]
 	cp $e
 	jp z, .asm_3e3ca
 	cp $d
 	jp z, .asm_3e3ca
-	cp $4
+	cp NUM_MOVES
 	jp c, .asm_3e3ca
 	cp $f
 	jr nz, .asm_3e3e9
@@ -5444,9 +5470,9 @@
 
 	call SetEnemyTurn
 	call Function3dc5b
-	jr c, .asm_3e423
+	jr c, .ok
 	call Function3dce6
-.asm_3e423
+.ok
 
 	hlcoord 9, 7
 	lb bc, 5, 11
@@ -5493,13 +5519,12 @@
 ; 3e489
 
 
-
-Function3e489: ; 3e489
+BattleMenu_Run: ; 3e489
 	call Function30b4
 	ld a, $3
 	ld [$cfa9], a
-	ld hl, BattleMonSpd
-	ld de, EnemyMonSpd
+	ld hl, BattleMonSpeed
+	ld de, EnemyMonSpeed
 	call Function3d8b3
 	ld a, $0
 	ld [$d266], a
@@ -5507,31 +5532,30 @@
 	ld a, [$d0ec]
 	and a
 	ret nz
-	jp Function3e139
+	jp BattleMenu
 ; 3e4a8
 
 
-
-Function3e4a8: ; 3e4a8
+CheckAmuletCoin: ; 3e4a8
 	ld a, [BattleMonItem]
 	ld b, a
 	callab GetItem
 	ld a, b
-	cp $4c
+	cp HELD_AMULET_COIN
 	ret nz
-	ld a, $1
+	ld a, 1
 	ld [$c73d], a
 	ret
 ; 3e4bc
 
 Function3e4bc: ; 3e4bc
-	call Function3d2f1
+	call IsMobileBattle
 	jr nz, .asm_3e4c8
 	callba Function100b9f
 	ret
 
 .asm_3e4c8
-	ld hl, EnemyMonMove1
+	ld hl, EnemyMonMoves
 	ld a, [$d235]
 	dec a
 	jr z, .asm_3e4e2
@@ -5539,49 +5563,49 @@
 	jr z, .asm_3e4dd
 	call Function3e786
 	ret z
-	ld hl, BattleMonMove1
+	ld hl, BattleMonMoves
 	jr .asm_3e4e2
 
 .asm_3e4dd
-	ld a, $2
+	ld a, PartyMon1Moves - PartyMon1
 	call GetPartyParamLocation
 
 .asm_3e4e2
 	ld de, $d25e
-	ld bc, $0004
+	ld bc, NUM_MOVES
 	call CopyBytes
 	xor a
 	ld [hBGMapMode], a
-	hlcoord 4, 12
-	ld b, $4
-	ld c, $e
+
+	hlcoord 4, 17 - NUM_MOVES - 1
+	ld b, 4
+	ld c, 14
 	ld a, [$d235]
 	cp $2
 	jr nz, .asm_3e503
-	hlcoord 4, 8
-	ld b, $4
-	ld c, $e
-
+	hlcoord 4, 17 - NUM_MOVES - 1 - 4
+	ld b, 4
+	ld c, 14
 .asm_3e503
 	call TextBox
-	hlcoord 6, 13
+
+	hlcoord 6, 17 - NUM_MOVES
 	ld a, [$d235]
 	cp $2
 	jr nz, .asm_3e513
-	hlcoord 6, 9
-
+	hlcoord 6, 17 - NUM_MOVES - 4
 .asm_3e513
-	ld a, $14
+	ld a, SCREEN_WIDTH
 	ld [Buffer1], a
-	ld a, $20
-	call Predef
-	ld b, $5
+	predef ListMoves
+
+	ld b, 5
 	ld a, [$d235]
 	cp $2
-	ld a, $d
+	ld a, 17 - NUM_MOVES
 	jr nz, .asm_3e52c
-	ld b, $5
-	ld a, $9
+	ld b, 5
+	ld a, 17 - NUM_MOVES - 4
 
 .asm_3e52c
 	ld [$cfa1], a
@@ -5641,23 +5665,24 @@
 	and a
 	jr z, .asm_3e5a3
 	hlcoord 5, 13
-	ld bc, $0014
+	ld bc, SCREEN_WIDTH
 	dec a
 	call AddNTimes
-	ld [hl], $ec
+	ld [hl], "▷"
 
 .asm_3e5a3
 	ld a, $1
 	ld [hBGMapMode], a
 	call Function1bd3
-	bit 6, a
+	bit 6, a ; D_UP
 	jp nz, .asm_3e61d
-	bit 7, a
+	bit 7, a ; D_DOWN
 	jp nz, .asm_3e62e
-	bit 2, a
-	jp nz, Function3e643
-	bit 1, a
+	bit 2, a ; B_BUTTON
+	jp nz, .asm_3e643
+	bit 1, a ; A_BUTTON
 	push af
+
 	xor a
 	ld [$d0e3], a
 	ld a, [$cfa9]
@@ -5667,6 +5692,7 @@
 	ld a, [$d235]
 	dec a
 	jr nz, .asm_3e5d0
+
 	pop af
 	ret
 
@@ -5675,6 +5701,7 @@
 	ld a, b
 	ld [CurMoveNum], a
 	jr nz, .asm_3e5d9
+
 	pop af
 	ret
 
@@ -5681,10 +5708,11 @@
 .asm_3e5d9
 	pop af
 	ret nz
-	ld hl, BattleMonPPMove1
+
+	ld hl, BattleMonPP
 	ld a, [$cfa9]
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [hl]
 	and $3f
@@ -5699,9 +5727,9 @@
 	and a
 	jr nz, .asm_3e606
 	ld a, [$cfa9]
-	ld hl, BattleMonMove1
+	ld hl, BattleMonMoves
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [hl]
 
@@ -5737,7 +5765,7 @@
 	jp .asm_3e57a
 ; 3e62e
 
-.asm_3e62e: ; 3e62e
+.asm_3e62e ; 3e62e
 	ld a, [$cfa9]
 	ld b, a
 	ld a, [$d0eb]
@@ -5750,7 +5778,7 @@
 	jp .asm_3e57a
 ; 3e643
 
-Function3e643: ; 3e643
+.asm_3e643 ; 3e643
 	ld a, [$d0e3]
 	and a
 	jr z, .asm_3e6bf
@@ -5789,7 +5817,7 @@
 
 .asm_3e682
 	ld a, [PlayerSubStatus5]
-	bit 3, a
+	bit SUBSTATUS_TRANSFORMED, a
 	jr nz, .asm_3e69e
 	ld hl, PartyMon1Moves
 	ld a, [CurBattleMon]
@@ -5797,7 +5825,7 @@
 	push hl
 	call .asm_3e6a5
 	pop hl
-	ld bc, $0015
+	ld bc, PartyMon1PP - PartyMon1Moves
 	add hl, bc
 	call .asm_3e6a5
 
@@ -5897,11 +5925,10 @@
 	ld [hl], "/"
 
 	callab UpdateMoveData
-	ld a, [PlayerMoveAnimation]
+	ld a, [wPlayerMoveStruct + MOVE_ANIM]
 	ld b, a
 	hlcoord 2, 10
-	ld a, PREDEF_PRINT_MOVE_TYPE
-	call Predef
+	predef PrintMoveType
 
 .done
 	ret
@@ -5918,10 +5945,9 @@
 	hlcoord 5, 11
 	ld a, [InLinkBattle]
 	cp $4
-	jr c, .asm_3e76c
+	jr c, .ok
 	hlcoord 5, 11
-
-.asm_3e76c
+.ok
 	push hl
 	ld de, StringBuffer1
 	ld bc, $0102
@@ -5987,7 +6013,7 @@
 
 
 Function3e7c1: ; 3e7c1
-	ld a, [$c711]
+	ld a, [wEnemyIsSwitching]
 	and a
 	ret nz
 	ld a, [InLinkBattle]
@@ -5999,27 +6025,28 @@
 	and a
 	call z, Function3e8e4
 	call Function30b4
-	ld a, [$d430]
+	ld a, [wBattleAction]
 	cp $e
 	jp z, .asm_3e8bd
 	cp $d
 	jp z, .asm_3e82c
-	cp $4
+	cp NUM_MOVES
 	jp nc, Function3e8c1
 	ld [CurEnemyMoveNum], a
 	ld c, a
 	ld a, [EnemySubStatus1]
-	bit 6, a
+	bit SUBSTATUS_ROLLOUT, a
 	jp nz, .asm_3e882
 	ld a, [EnemySubStatus3]
-	and $13
+	and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_RAMPAGE | 1 << SUBSTATUS_BIDE
 	jp nz, .asm_3e882
+
 	ld hl, EnemySubStatus5
-	bit 4, [hl]
+	bit SUBSTATUS_ENCORED, [hl]
 	ld a, [LastEnemyMove]
 	jp nz, .asm_3e87f
-	ld hl, EnemyMonMove1
-	ld b, $0
+	ld hl, EnemyMonMoves
+	ld b, 0
 	add hl, bc
 	ld a, [hl]
 	jp .asm_3e87f
@@ -6026,7 +6053,7 @@
 
 .asm_3e817
 	ld hl, EnemySubStatus5
-	bit 4, [hl]
+	bit SUBSTATUS_ENCORED, [hl]
 	jr z, .asm_3e824
 	ld a, [LastEnemyMove]
 	jp .asm_3e87f
@@ -6041,9 +6068,9 @@
 	jr .asm_3e87f
 
 .asm_3e830
-	ld hl, EnemyMonMove1
-	ld de, EnemyMonPPMove1
-	ld b, $4
+	ld hl, EnemyMonMoves
+	ld de, EnemyMonPP
+	ld b, NUM_MOVES
 .asm_3e838
 	ld a, [hl]
 	and a
@@ -6067,11 +6094,11 @@
 	dec a
 	jr nz, .asm_3e882
 .asm_3e855
-	ld hl, EnemyMonMove1
+	ld hl, EnemyMonMoves
 	call BattleRandom
-	and $3
+	and 3 ; TODO factor in NUM_MOVES
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [EnemyDisableCount]
 	swap a
@@ -6082,7 +6109,7 @@
 	ld a, [hl]
 	and a
 	jr z, .asm_3e855
-	ld hl, EnemyMonPPMove1
+	ld hl, EnemyMonPP
 	add hl, bc
 	ld b, a
 	ld a, [hl]
@@ -6104,33 +6131,33 @@
 	ld [$c733], a
 
 .asm_3e894
-	ld a, [EnemyMoveEffect]
-	cp $77
+	ld a, [wEnemyMoveStruct + MOVE_EFFECT]
+	cp EFFECT_FURY_CUTTER
 	jr z, .asm_3e89f
 	xor a
 	ld [EnemyFuryCutterCount], a
 
 .asm_3e89f
-	ld a, [EnemyMoveEffect]
-	cp $51
+	ld a, [wEnemyMoveStruct + MOVE_EFFECT]
+	cp EFFECT_RAGE
 	jr z, .asm_3e8af
 	ld hl, EnemySubStatus4
-	res 6, [hl]
+	res SUBSTATUS_RAGE, [hl]
 	xor a
 	ld [$c72c], a
 
 .asm_3e8af
-	ld a, [EnemyMoveEffect]
-	cp $6f
+	ld a, [wEnemyMoveStruct + MOVE_EFFECT]
+	cp EFFECT_PROTECT
 	ret z
-	cp $74
+	cp EFFECT_ENDURE
 	ret z
 	xor a
-	ld [$c681], a
+	ld [EnemyProtectCount], a
 	ret
 
 .asm_3e8bd
-	ld a, $a5
+	ld a, STRUGGLE
 	jr .asm_3e87f
 ; 3e8c1
 
@@ -6137,23 +6164,23 @@
 Function3e8c1: ; 3e8c1
 	xor a
 	ld [EnemyFuryCutterCount], a
-	ld [$c681], a
+	ld [EnemyProtectCount], a
 	ld [$c72c], a
 	ld hl, EnemySubStatus4
-	res 6, [hl]
+	res SUBSTATUS_RAGE, [hl]
 	ret
 ; 3e8d1
 
 Function3e8d1: ; 3e8d1
 	ld a, [EnemySubStatus4]
-	and $20
+	and 1 << SUBSTATUS_RECHARGE
 	ret nz
 	ld hl, EnemySubStatus3
 	ld a, [hl]
-	and $13
+	and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_RAMPAGE | 1 << SUBSTATUS_BIDE
 	ret nz
 	ld hl, EnemySubStatus1
-	bit 6, [hl]
+	bit SUBSTATUS_ROLLOUT, [hl]
 	ret
 ; 3e8e4
 
@@ -6251,9 +6278,8 @@
 	and a
 	jr z, .InitDVs
 	
-; ????
 	ld a, [EnemySubStatus5]
-	bit 3, a
+	bit SUBSTATUS_TRANSFORMED, a
 	jr z, .InitDVs
 	
 ; Unknown
@@ -6366,8 +6392,7 @@
 	
 ; Get letter based on DVs
 	ld hl, EnemyMonDVs
-	ld a, PREDEF_GET_UNOWN_LETTER
-	call Predef
+	predef GetUnownLetter
 ; Can't use any letters that haven't been unlocked
 ; If combined with forced shiny battletype, causes an infinite loop
 	call CheckUnownLetter
@@ -6448,8 +6473,7 @@
 	ld de, EnemyMonMaxHP
 	ld b, $00
 	ld hl, $d201 ; ?
-	ld a, PREDEF_FILLSTATS
-	call Predef
+	predef Functione167
 	
 ; If we're in a trainer battle,
 ; get the rest of the parameters from the party struct
@@ -6461,15 +6485,14 @@
 	and a
 	jr z, .TreeMon
 	
-; ????
 	ld a, [EnemySubStatus5]
-	bit 3, a
+	bit SUBSTATUS_TRANSFORMED, a
 	jp nz, .Moves
 	
 .TreeMon
 ; If we're headbutting trees, some monsters enter battle asleep
 	call CheckSleepingTreeMon
-	ld a, 7 ; Asleep for 7 turns
+	ld a, SLP ; Asleep for 7 turns
 	jr c, .UpdateStatus
 ; Otherwise, no status
 	xor a
@@ -6483,9 +6506,9 @@
 	ld [hli], a
 	
 ; Full HP...
-	ld a, [EnemyMonMaxHPHi]
+	ld a, [EnemyMonMaxHP]
 	ld [hli], a
-	ld a, [EnemyMonMaxHPLo]
+	ld a, [EnemyMonMaxHP + 1]
 	ld [hl], a
 	
 ; ...unless it's a RoamMon
@@ -6501,13 +6524,13 @@
 	jr z, .InitRoamHP
 ; Update from the struct if it has
 	ld a, [hl]
-	ld [EnemyMonHPLo], a
+	ld [EnemyMonHP + 1], a
 	jr .Moves
 	
 .InitRoamHP
 ; HP only uses the lo byte in the RoamMon struct since
 ; Raikou/Entei/Suicune will have < 256 hp at level 40
-	ld a, [EnemyMonHPLo]
+	ld a, [EnemyMonHP + 1]
 	ld [hl], a
 	jr .Moves
 	
@@ -6518,9 +6541,9 @@
 	ld a, [CurPartyMon]
 	call GetPartyLocation
 	ld a, [hld]
-	ld [EnemyMonHPLo], a
+	ld [EnemyMonHP + 1], a
 	ld a, [hld]
-	ld [EnemyMonHPHi], a
+	ld [EnemyMonHP], a
 	
 ; Make sure everything knows which monster the opponent is using
 	ld a, [CurPartyMon]
@@ -6533,7 +6556,6 @@
 	
 	
 .Moves
-; ????
 	ld hl, BaseType1
 	ld de, EnemyMonType1
 	ld a, [hli]
@@ -6568,8 +6590,7 @@
 ; Make sure the predef knows this isn't a partymon
 	ld [MagikarpLength], a
 ; Fill moves based on level
-	ld a, PREDEF_FILLMOVES
-	call Predef
+	predef FillMoves
 	
 .PP
 ; Trainer battle?
@@ -6580,8 +6601,7 @@
 ; Fill wild PP
 	ld hl, EnemyMonMoves
 	ld de, EnemyMonPP
-	ld a, PREDEF_FILLPP
-	call Predef
+	predef FillPP
 	jr .Finish
 	
 .TrainerPP
@@ -6634,8 +6654,7 @@
 	ld c, a
 	ld b, 1 ; set
 	ld hl, PokedexSeen
-	ld a, PREDEF_FLAG
-	call Predef
+	predef FlagPredef
 
 	ld hl, EnemyMonStats
 	ld de, EnemyStats
@@ -6795,7 +6814,7 @@
 	ld a, [OtherTrainerClass]
 	ld [TrainerClass], a
 	ld de, VTiles2
-	callab Function5120d
+	callab GetTrainerPic
 	hlcoord 19, 0
 	ld c, $0
 .asm_3ebf3
@@ -6866,7 +6885,7 @@
 	and a
 	jr z, .asm_3ec5a
 	ld a, [BattleMonStatus]
-	and $40
+	and 1 << PAR
 	ret z
 	ld hl, $c645
 	ld a, [hld]
@@ -6887,7 +6906,7 @@
 
 .asm_3ec5a
 	ld a, [EnemyMonStatus]
-	and $40
+	and 1 << PAR
 	ret z
 	ld hl, $d21f
 	ld a, [hld]
@@ -6912,7 +6931,7 @@
 	and a
 	jr z, .asm_3ec93
 	ld a, [BattleMonStatus]
-	and $10
+	and 1 << BRN
 	ret z
 	ld hl, $c641
 	ld a, [hld]
@@ -6931,7 +6950,7 @@
 
 .asm_3ec93
 	ld a, [EnemyMonStatus]
-	and $10
+	and 1 << BRN
 	ret z
 	ld hl, $d21b
 	ld a, [hld]
@@ -6966,11 +6985,11 @@
 	ld a, [$d265]
 	and a
 	ld a, c
-	ld hl, BattleMonAtk
+	ld hl, BattleMonAttack
 	ld de, PlayerStats
 	ld bc, PlayerAtkLevel
 	jr z, .asm_3ecd2
-	ld hl, EnemyMonAtk
+	ld hl, EnemyMonAttack
 	ld de, EnemyStats
 	ld bc, EnemyAtkLevel
 
@@ -7104,7 +7123,7 @@
 	or c
 	ld b, a
 
-	ld hl, BattleMonAtk
+	ld hl, BattleMonAttack
 	ld c, 4
 .CheckBadge
 	ld a, b
@@ -7274,8 +7293,7 @@
 	ld a, d
 	ld [FXAnimIDHi], a
 	call WaitBGMap
-	ld a, $37
-	jp Predef
+	predef_jump PlayBattleAnim
 ; 3ee27
 
 Function3ee27: ; 3ee27
@@ -7320,8 +7338,7 @@
 	ld c, a
 	ld b, $2
 	ld d, $0
-	ld a, $3
-	call Predef
+	predef FlagPredef
 	ld a, c
 	and a
 	pop bc
@@ -7423,7 +7440,7 @@
 	ld a, [$ffb5]
 	ld [StringBuffer2], a
 	ld a, [CurPartyMon]
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call GetNick
 	ld hl, UnknownText_0x3f11b
 	call BattleTextBox
@@ -7494,8 +7511,7 @@
 .asm_3ef74
 	xor a
 	ld [MonType], a
-	ld a, $1f
-	call Predef
+	predef Function5084a
 	callab Function50e1b
 	pop bc
 	ld hl, PartyMon1Level - PartyMon1
@@ -7531,8 +7547,7 @@
 	add hl, bc
 	push bc
 	ld b, $1
-	ld a, $c
-	call Predef
+	predef Functione167
 	pop bc
 	pop de
 	ld hl, $0025
@@ -7571,7 +7586,7 @@
 	ld a, [hl]
 	ld [BattleMonLevel], a
 	ld a, [PlayerSubStatus5]
-	bit 3, a
+	bit SUBSTATUS_TRANSFORMED, a
 	jr nz, .asm_3f012
 	ld hl, $0026
 	add hl, bc
@@ -7585,7 +7600,7 @@
 	call Function3ecab
 	callab Function3ec2c
 	callab BadgeStatBoosts
-	callab Function3df48
+	callab UpdatePlayerHUD
 	call EmptyBattleTextBox
 	call Function309d
 	ld a, $1
@@ -7608,8 +7623,7 @@
 .asm_3f057
 	xor a
 	ld [MonType], a
-	ld a, $1f
-	call Predef
+	predef Function5084a
 	hlcoord 9, 0
 	ld b, $a
 	ld c, $9
@@ -7616,8 +7630,7 @@
 	call TextBox
 	hlcoord 11, 1
 	ld bc, $0004
-	ld a, $28
-	call Predef
+	predef Function50b7b
 	ld c, $1e
 	call DelayFrames
 	call Functiona80
@@ -7637,8 +7650,7 @@
 	ld a, b
 	ld [CurPartyLevel], a
 	push bc
-	ld a, $1a
-	call Predef
+	predef LearnLevelMoves
 	pop bc
 	ld a, b
 	cp c
@@ -7649,8 +7661,7 @@
 	ld a, [CurPartyMon]
 	ld c, a
 	ld b, $1
-	ld a, $3
-	call Predef
+	predef FlagPredef
 	pop af
 	ld [CurPartyLevel], a
 
@@ -7767,8 +7778,7 @@
 	ld [DefaultFlypoint], a
 	xor a
 	ld [MonType], a
-	ld a, $1f
-	call Predef
+	predef Function5084a
 	ld a, [TempMonLevel]
 	ld b, a
 	ld e, a
@@ -7951,7 +7961,7 @@
 	jr nz, .asm_3f2ce
 
 .asm_3f27c
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld a, [hli]
 	or [hl]
 	ld hl, UnknownText_0x3f2d1
@@ -7958,7 +7968,7 @@
 	jr z, .asm_3f2ce
 	xor a
 	ld [hMultiplicand], a
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld a, [hli]
 	ld [$c6ea], a
 	ld [$ffb5], a
@@ -7968,7 +7978,7 @@
 	ld a, $19
 	ld [hMultiplier], a
 	call Multiply
-	ld hl, EnemyMonMaxHPHi
+	ld hl, EnemyMonMaxHP
 	ld a, [hli]
 	ld b, [hl]
 	srl a
@@ -8043,7 +8053,7 @@
 Function3f2ff: ; 3f2ff
 	push de
 	push bc
-	ld hl, EnemyMonHPLo
+	ld hl, EnemyMonHP + 1
 	ld de, $c6eb
 	ld b, [hl]
 	dec hl
@@ -8058,7 +8068,7 @@
 	ld a, $19
 	ld [hMultiplier], a
 	call Multiply
-	ld hl, EnemyMonMaxHPHi
+	ld hl, EnemyMonMaxHP
 	ld a, [hli]
 	ld b, [hl]
 	srl a
@@ -8279,9 +8289,10 @@
 
 Function3f43d: ; 3f43d
 	ld a, [PlayerSubStatus4]
-	bit 4, a
+	bit SUBSTATUS_SUBSTITUTE, a
 	ld hl, BattleAnimCmd_DD
 	jr nz, Function3f46f
+
 Function3f447: ; 3f447
 	ld a, [$c6fe]
 	and a
@@ -8291,12 +8302,10 @@
 	push af
 	ld a, [BattleMonSpecies]
 	ld [CurPartySpecies], a
-	ld hl, BattleMonAtkDefDV
-	ld a, $2d
-	call Predef
+	ld hl, BattleMonDVs
+	predef GetUnownLetter
 	ld de, $9310
-	ld a, $3d
-	call Predef
+	predef GetBackpic
 	pop af
 	ld [CurPartySpecies], a
 	ret
@@ -8316,14 +8325,16 @@
 
 Function3f47c: ; 3f47c
 	ld a, [EnemySubStatus4]
-	bit 4, a
+	bit SUBSTATUS_SUBSTITUTE, a
 	ld hl, BattleAnimCmd_DD
 	jr nz, Function3f4b4
+
 Function3f486: ; 3f486
 	ld a, [$c6fa]
 	and a
 	ld hl, BattleAnimCmd_E2
 	jr nz, Function3f4b4
+
 	ld a, [CurPartySpecies]
 	push af
 	ld a, [EnemyMonSpecies]
@@ -8330,12 +8341,10 @@
 	ld [CurSpecies], a
 	ld [CurPartySpecies], a
 	call GetBaseData
-	ld hl, EnemyMonAtkDefDV
-	ld a, $2d
-	call Predef
+	ld hl, EnemyMonDVs
+	predef GetUnownLetter
 	ld de, VTiles2
-	ld a, $3e
-	call Predef
+	predef Function5108b
 	pop af
 	ld [CurPartySpecies], a
 	ret
@@ -8410,7 +8419,7 @@
 	call ClearSprites
 	ld a, [IsInBattle]
 	cp $1
-	call z, Function3e036
+	call z, UpdateEnemyHUD
 	ld a, $1
 	ld [hBGMapMode], a
 	ret
@@ -8441,7 +8450,7 @@
 	ld a, $6
 	ld [rSVBK], a
 	ld hl, $d000
-	ld bc, VBlank5
+	ld bc, $400
 	ld a, $2
 	call ByteFill
 	ld a, [rVBK]
@@ -8465,28 +8474,29 @@
 	xor a
 	ld [TempEnemyMonSpecies], a
 	callab Function3957b
-	callab Function39771
+	callab ReadTrainerParty
+
 	ld a, [TrainerClass]
-	cp $9
-	jr nz, .asm_3f5b8
+	cp RIVAL1
+	jr nz, .ok
 	xor a
 	ld [OTPartyMon1Item], a
+.ok
 
-.asm_3f5b8
 	ld de, VTiles2
-	callab Function5120d
+	callab GetTrainerPic
 	xor a
 	ld [$ffad], a
 	dec a
 	ld [$c6e6], a
 	hlcoord 12, 0
-	ld bc, $0707
-	ld a, $13
-	call Predef
+	lb bc, 7, 7
+	predef FillBox
 	ld a, $ff
 	ld [CurOTMon], a
-	ld a, $2
+	ld a, TRAINER_BATTLE
 	ld [IsInBattle], a
+
 	call IsJohtoGymLeader
 	jr nc, .asm_3f606
 	xor a
@@ -8495,7 +8505,7 @@
 	ld b, a
 .asm_3f5ea
 	push bc
-	ld a, $22
+	ld a, PartyMon1HP - PartyMon1
 	call GetPartyParamLocation
 	ld a, [hli]
 	or [hl]
@@ -8502,7 +8512,6 @@
 	jr z, .asm_3f5fc
 	ld c, $4
 	callab ChangeHappiness
-
 .asm_3f5fc
 	pop bc
 	dec b
@@ -8510,7 +8519,6 @@
 	ld hl, CurPartyMon
 	inc [hl]
 	jr .asm_3f5ea
-
 .asm_3f606
 	ret
 ; 3f607
@@ -8520,19 +8528,18 @@
 	ld [IsInBattle], a
 	callba Function10605d
 	call LoadEnemyMon
-	ld hl, EnemyMonMove1
+	ld hl, EnemyMonMoves
 	ld de, $c735
-	ld bc, $0004
+	ld bc, NUM_MOVES
 	call CopyBytes
-	ld hl, EnemyMonPPMove1
+	ld hl, EnemyMonPP
 	ld de, $c739
-	ld bc, $0004
+	ld bc, NUM_MOVES
 	call CopyBytes
-	ld hl, EnemyMonAtkDefDV
-	ld a, $2d
-	call Predef
+	ld hl, EnemyMonDVs
+	predef GetUnownLetter
 	ld a, [CurPartySpecies]
-	cp $c9
+	cp UNOWN
 	jr nz, .asm_3f648
 	ld a, [$def4]
 	and a
@@ -8539,25 +8546,22 @@
 	jr nz, .asm_3f648
 	ld a, [UnownLetter]
 	ld [$def4], a
-
 .asm_3f648
 	ld de, VTiles2
-	ld a, $3e
-	call Predef
+	predef Function5108b
 	xor a
 	ld [TrainerClass], a
 	ld [$ffad], a
 	hlcoord 12, 0
-	ld bc, $0707
-	ld a, $13
-	call Predef
+	lb bc, 7, 7
+	predef FillBox
 	ret
 ; 3f662
 
 Function3f662: ; 3f662
-	ld hl, EnemyMonMove1
+	ld hl, EnemyMonMoves
 	ld de, $d25e
-	ld b, 4
+	ld b, NUM_MOVES
 .loop
 	ld a, [de]
 	inc de
@@ -8571,7 +8575,7 @@
 	push hl
 	dec a
 	ld hl, Moves + MOVE_PP
-	ld bc, Move2 - Move1
+	ld bc, MOVE_LENGTH
 	call AddNTimes
 	ld a, BANK(Moves)
 	call GetFarByte
@@ -8618,7 +8622,7 @@
 	and a
 	jr z, .asm_3f6b7
 	call Function3f759
-	ld c, $96
+	ld c, 150
 	call DelayFrames
 	call Function3f77c
 	ret
@@ -8630,8 +8634,7 @@
 	call Function3f71d
 	xor a
 	ld [$d1e9], a
-	ld a, $1c
-	call Predef
+	predef Function421e6
 	callba Function2ed44
 	ret
 ; 3f6d0
@@ -8661,16 +8664,16 @@
 	ld [$d0e1], a
 	ld hl, PlayerSubStatus1
 	ld b, $18
-.asm_3f715
+.loop
 	ld [hli], a
 	dec b
-	jr nz, .asm_3f715
+	jr nz, .loop
 	call WaitSFX
 	ret
 ; 3f71d
 
 Function3f71d: ; 3f71d
-	ld hl, $c6ec
+	ld hl, wPayDayMoney
 	ld a, [hli]
 	or [hl]
 	inc hl
@@ -8679,7 +8682,7 @@
 	ld a, [$c73d]
 	and a
 	jr z, .asm_3f73d
-	ld hl, $c6ee
+	ld hl, wPayDayMoney + 2
 	sla [hl]
 	dec hl
 	rl [hl]
@@ -8692,8 +8695,8 @@
 	ld [hl], a
 
 .asm_3f73d
-	ld hl, $c6ee
-	ld de, $d850
+	ld hl, wPayDayMoney + 2
+	ld de, Money + 2
 	call Function3d0be
 	ld hl, BattleText_0x80730
 	call StdBattleTextBox
@@ -8966,7 +8969,7 @@
 	and $f
 	jr z, .asm_3f9af
 	call GetRoamMonHP
-	ld a, [EnemyMonHPLo]
+	ld a, [EnemyMonHP + 1]
 	ld [hl], a
 	jr .asm_3f9ca
 
@@ -8994,15 +8997,15 @@
 GetRoamMonMapGroup: ; 3f9d1
 	ld a, [TempEnemyMonSpecies]
 	ld b, a
-	ld a, [RoamMon1Species]
+	ld a, [wRoamMon1Species]
 	cp b
-	ld hl, RoamMon1MapGroup
+	ld hl, wRoamMon1MapGroup
 	ret z
-	ld a, [RoamMon2Species]
+	ld a, [wRoamMon2Species]
 	cp b
-	ld hl, RoamMon2MapGroup
+	ld hl, wRoamMon2MapGroup
 	ret z
-	ld hl, RoamMon3MapGroup
+	ld hl, wRoamMon3MapGroup
 	ret
 ; 3f9e9
 
@@ -9009,59 +9012,59 @@
 GetRoamMonMapNumber: ; 3f9e9
 	ld a, [TempEnemyMonSpecies]
 	ld b, a
-	ld a, [RoamMon1Species]
+	ld a, [wRoamMon1Species]
 	cp b
-	ld hl, RoamMon1MapNumber
+	ld hl, wRoamMon1MapNumber
 	ret z
-	ld a, [RoamMon2Species]
+	ld a, [wRoamMon2Species]
 	cp b
-	ld hl, RoamMon2MapNumber
+	ld hl, wRoamMon2MapNumber
 	ret z
-	ld hl, RoamMon3MapNumber
+	ld hl, wRoamMon3MapNumber
 	ret
 ; 3fa01
 
 GetRoamMonHP: ; 3fa01
-; output: hl = RoamMonHP
+; output: hl = wRoamMonHP
 	ld a, [TempEnemyMonSpecies]
 	ld b, a
-	ld a, [RoamMon1Species]
+	ld a, [wRoamMon1Species]
 	cp b
-	ld hl, RoamMon1HP
+	ld hl, wRoamMon1HP
 	ret z
-	ld a, [RoamMon2Species]
+	ld a, [wRoamMon2Species]
 	cp b
-	ld hl, RoamMon2HP
+	ld hl, wRoamMon2HP
 	ret z
-	ld hl, RoamMon3HP
+	ld hl, wRoamMon3HP
 	ret
 ; 3fa19
 
 GetRoamMonDVs: ; 3fa19
-; output: hl = RoamMonDVs
+; output: hl = wRoamMonDVs
 	ld a, [TempEnemyMonSpecies]
 	ld b, a
-	ld a, [RoamMon1Species]
+	ld a, [wRoamMon1Species]
 	cp b
-	ld hl, RoamMon1DVs
+	ld hl, wRoamMon1DVs
 	ret z
-	ld a, [RoamMon2Species]
+	ld a, [wRoamMon2Species]
 	cp b
-	ld hl, RoamMon2DVs
+	ld hl, wRoamMon2DVs
 	ret z
-	ld hl, RoamMon3DVs
+	ld hl, wRoamMon3DVs
 	ret
 ; 3fa31
 
 GetRoamMonSpecies: ; 3fa31
 	ld a, [TempEnemyMonSpecies]
-	ld hl, RoamMon1Species
+	ld hl, wRoamMon1Species
 	cp [hl]
 	ret z
-	ld hl, RoamMon2Species
+	ld hl, wRoamMon2Species
 	cp [hl]
 	ret z
-	ld hl, RoamMon3Species
+	ld hl, wRoamMon3Species
 	ret
 ; 3fa42
 
@@ -9305,8 +9308,7 @@
 	ld [$ffad], a
 	hlcoord 2, 6
 	ld bc, $0606
-	ld a, $13
-	call Predef
+	predef FillBox
 	xor a
 	ld [hWY], a
 	ld [rWY], a
@@ -9328,7 +9330,7 @@
 	ld a, $6
 	ld [rSVBK], a
 	ld hl, $d000
-	ld bc, VBlank5
+	ld bc, $400
 	ld a, $7f
 	call ByteFill
 	ld de, $d000
@@ -9377,8 +9379,7 @@
 .Decompress
 	ld de, $9310
 	ld c, $31
-	ld a, PREDEF_DECOMPRESS
-	call Predef
+	predef DecompressPredef
 	ret
 ; 3fc30
 
@@ -9401,8 +9402,7 @@
 	ld [$ffad], a
 	hlcoord 2, 6
 	ld bc, $0606
-	ld a, $13
-	call Predef
+	predef FillBox
 	ret
 ; 3fc5b
 
@@ -9409,7 +9409,7 @@
 Function3fc5b: ; 3fc5b
 	ld hl, Sprites
 	xor a
-	ld [hConnectionStripLength], a
+	ld [$ffaf], a
 	ld b, $6
 	ld e, $a8
 .asm_3fc65
@@ -9420,10 +9420,10 @@
 	inc hl
 	ld [hl], e
 	inc hl
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	ld [hli], a
 	inc a
-	ld [hConnectionStripLength], a
+	ld [$ffaf], a
 	ld a, $1
 	ld [hli], a
 	ld a, d
@@ -9431,9 +9431,9 @@
 	ld d, a
 	dec c
 	jr nz, .asm_3fc69
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	add $3
-	ld [hConnectionStripLength], a
+	ld [$ffaf], a
 	ld a, e
 	add $8
 	ld e, a
@@ -9470,7 +9470,7 @@
 	ld [hBattleTurn], a
 	ld a, 1
 	ld [$c689], a
-	ld de, $0101
+	ld de, ANIM_SEND_OUT_MON
 	call Function3ee17
 
 .asm_3fcc2
@@ -9483,8 +9483,7 @@
 	hlcoord 12, 0
 	ld d, $0
 	ld e, $1
-	ld a, $47
-	call Predef
+	predef Functiond008e
 	jr .asm_3fceb
 
 .asm_3fce0
@@ -9507,8 +9506,8 @@
 	ld hl, PokemonFellFromTreeText
 	cp BATTLETYPE_TREE
 	jr z, .asm_3fd0e
-	ld hl, WildPokemonAppearedText2
-	cp $b
+	ld hl, WildCelebiAppearedText
+	cp BATTLETYPE_CELEBI
 	jr z, .asm_3fd0e
 	ld hl, WildPokemonAppearedText
 
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -16,10 +16,10 @@
 	and a
 	jr z, DoTurn
 
-	ld a, [$d430]
+	ld a, [wBattleAction]
 	cp $e
 	jr z, DoTurn
-	cp $4
+	cp NUM_MOVES
 	ret nc
 
 	; fallthrough
@@ -32,7 +32,7 @@
 	xor a
 	ld [$c6b4], a
 
-; Effect command checkturn is called for every move.
+	; Effect command checkturn is called for every move.
 	call CheckTurn
 
 	ld a, [$c6b4]
@@ -146,80 +146,76 @@
 
 CheckPlayerTurn:
 
-; check recharge
 	ld hl, PlayerSubStatus4
-	bit 5, [hl]
-	jr z, .CheckSleep
-	res 5, [hl]
+	bit SUBSTATUS_RECHARGE, [hl]
+	jr z, .no_recharge
 
-; 'must recharge!'
+	res SUBSTATUS_RECHARGE, [hl]
 	ld hl, MustRechargeText
 	call StdBattleTextBox
-
 	call CantMove
 	jp Function34385
 
+.no_recharge
 
-.CheckSleep
+
 	ld hl, BattleMonStatus
 	ld a, [hl]
-	and $7
-	jr z, .CheckFrozen
+	and SLP
+	jr z, .not_asleep
+
 	dec a
 	ld [BattleMonStatus], a
-	and $7
-	jr z, .WokeUp
+	and SLP
+	jr z, .woke_up
+
 	xor a
 	ld [$cfca], a
 	ld de, ANIM_SLP
 	call FarPlayBattleAnimation
-	jr .FastAsleep
+	jr .fast_asleep
 
-
-.WokeUp
-; 'woke up!'
+.woke_up
 	ld hl, WokeUpText
 	call StdBattleTextBox
-
 	call CantMove
 	call UpdateBattleMonInParty
-	ld hl, Function3df48
+	ld hl, UpdatePlayerHUD
 	call CallBattleCore
 	ld a, $1
 	ld [$ffd4], a
 	ld hl, PlayerSubStatus1
-	res 0, [hl]
-	jr .CheckFrozen
+	res SUBSTATUS_NIGHTMARE, [hl]
+	jr .not_asleep
 
-
-.FastAsleep
-; 'fast asleep!'
+.fast_asleep
 	ld hl, FastAsleepText
 	call StdBattleTextBox
 
-; Snore and Sleep Talk bypass sleep.
+	; Snore and Sleep Talk bypass sleep.
 	ld a, [CurPlayerMove]
 	cp SNORE
-	jr z, .CheckFrozen
+	jr z, .not_asleep
 	cp SLEEP_TALK
-	jr z, .CheckFrozen
+	jr z, .not_asleep
+
 	call CantMove
 	jp Function34385
 
+.not_asleep
 
-.CheckFrozen
+
 	ld hl, BattleMonStatus
-	bit 5, [hl]
-	jr z, .CheckFlinch
+	bit FRZ, [hl]
+	jr z, .not_frozen
 
-; Flame Wheel and Sacred Fire thaw the user.
+	; Flame Wheel and Sacred Fire thaw the user.
 	ld a, [CurPlayerMove]
 	cp FLAME_WHEEL
-	jr z, .CheckFlinch
+	jr z, .not_frozen
 	cp SACRED_FIRE
-	jr z, .CheckFlinch
+	jr z, .not_frozen
 
-; 'frozen solid!'
 	ld hl, FrozenSolidText
 	call StdBattleTextBox
 
@@ -226,15 +222,14 @@
 	call CantMove
 	jp Function34385
 
+.not_frozen
 
-.CheckFlinch
+
 	ld hl, PlayerSubStatus3
-	bit 3, [hl] ; flinch
-	jr z, .CheckDisabled
+	bit SUBSTATUS_FLINCHED, [hl]
+	jr z, .not_flinched
 
-	res 3, [hl]
-
-; 'flinched!'
+	res SUBSTATUS_FLINCHED, [hl]
 	ld hl, FlinchedText
 	call StdBattleTextBox
 
@@ -241,123 +236,116 @@
 	call CantMove
 	jp Function34385
 
+.not_flinched
 
-.CheckDisabled
+
 	ld hl, PlayerDisableCount
 	ld a, [hl]
 	and a
-	jr z, .CheckConfused
+	jr z, .not_disabled
+
 	dec a
 	ld [hl], a
 	and $f
-	jr nz, .CheckConfused
+	jr nz, .not_disabled
+
 	ld [hl], a
 	ld [DisabledMove], a
-
-; 'disabled no more!'
 	ld hl, DisabledNoMoreText
 	call StdBattleTextBox
 
+.not_disabled
 
-.CheckConfused
+
 	ld a, [PlayerSubStatus3]
 	add a
-	jr nc, .CheckAttract
+	jr nc, .not_confused
 	ld hl, PlayerConfuseCount
 	dec [hl]
-	jr nz, .Confused
+	jr nz, .confused
 
 	ld hl, PlayerSubStatus3
-	res 7, [hl]
-
-; 'confused no more!'
+	res SUBSTATUS_CONFUSED, [hl]
 	ld hl, ConfusedNoMoreText
 	call StdBattleTextBox
+	jr .not_confused
 
-	jr .CheckAttract
-
-
-.Confused
-; 'confused!'
+.confused
 	ld hl, IsConfusedText
 	call StdBattleTextBox
-
 	xor a
 	ld [$cfca], a
 	ld de, ANIM_CONFUSED
 	call FarPlayBattleAnimation
 
-; 50% chance of hitting itself
+	; 50% chance of hitting itself
 	call BattleRandom
 	cp $80
-	jr nc, .CheckAttract
+	jr nc, .not_confused
 
+	; clear confussion-dependent substatus
 	ld hl, PlayerSubStatus3
 	ld a, [hl]
-	and $80
+	and 1 << SUBSTATUS_CONFUSED
 	ld [hl], a
 
 	call HitConfusion
-
 	call CantMove
 	jp Function34385
 
+.not_confused
 
-.CheckAttract
+
 	ld a, [PlayerSubStatus1]
-	add a ; check bit 7
-	jr nc, .CheckDisabledMove
+	add a ; bit SUBSTATUS_ATTRACT
+	jr nc, .not_infatuated
 
-; 'in love with'
 	ld hl, InLoveWithText
 	call StdBattleTextBox
-
 	xor a
 	ld [$cfca], a
-
 	ld de, ANIM_IN_LOVE
 	call FarPlayBattleAnimation
 
-; 50% chance of infatuation
+	; 50% chance of infatuation
 	call BattleRandom
 	cp $80
-	jr c, .CheckDisabledMove
+	jr c, .not_infatuated
 
-; 'infatuation kept it from attacking!'
 	ld hl, InfatuationText
 	call StdBattleTextBox
-
 	call CantMove
 	jp Function34385
 
+.not_infatuated
 
-.CheckDisabledMove
-; We can't disable a move that doesn't exist.
+
+	; We can't disable a move that doesn't exist.
 	ld a, [DisabledMove]
 	and a
-	jr z, .CheckParalyzed
+	jr z, .no_disabled_move
 
-; Are we using the disabled move?
+	; Are we using the disabled move?
 	ld hl, CurPlayerMove
 	cp [hl]
-	jr nz, .CheckParalyzed
+	jr nz, .no_disabled_move
 
 	call MoveDisabled
 	call CantMove
 	jp Function34385
 
+.no_disabled_move
 
-.CheckParalyzed
+
 	ld hl, BattleMonStatus
-	bit 6, [hl]
+	bit PAR, [hl]
 	ret z
 
-; 25% chance to be fully paralyzed
+	; 25% chance to be fully paralyzed
 	call BattleRandom
 	cp $3f
 	ret nc
 
-; 'fully paralyzed!'
 	ld hl, FullyParalyzedText
 	call StdBattleTextBox
 	call CantMove
@@ -367,13 +355,13 @@
 
 CantMove: ; 341f0
 	ld a, BATTLE_VARS_SUBSTATUS1
-	call _GetBattleVar
-	res 6, [hl]
+	call GetBattleVarAddr
+	res SUBSTATUS_ROLLOUT, [hl]
 
 	ld a, BATTLE_VARS_SUBSTATUS3
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld a, [hl]
-	and $ec
+	and $ff ^ (1<<SUBSTATUS_BIDE + 1<<SUBSTATUS_RAMPAGE + 1<<SUBSTATUS_CHARGED)
 	ld [hl], a
 
 	call ResetFuryCutterCount
@@ -383,12 +371,12 @@
 	cp FLY
 	jr z, .asm_3420f
 
-	cp $5b
+	cp DIG
 	ret nz
 
 .asm_3420f
-	res 5, [hl]
-	res 6, [hl]
+	res SUBSTATUS_UNDERGROUND, [hl]
+	res SUBSTATUS_FLYING, [hl]
 	jp Function37ece
 ; 34216
 
@@ -404,30 +392,29 @@
 
 CheckEnemyTurn: ; 3421f
 
-; check recharge
 	ld hl, EnemySubStatus4
-	bit 5, [hl]
-	jr z, .CheckSleep
-	res 5, [hl]
+	bit SUBSTATUS_RECHARGE, [hl]
+	jr z, .no_recharge
 
-; 'must recharge!'
+	res SUBSTATUS_RECHARGE, [hl]
 	ld hl, MustRechargeText
 	call StdBattleTextBox
 	call CantMove
 	jp Function34385
 
+.no_recharge
 
-.CheckSleep
+
 	ld hl, EnemyMonStatus
 	ld a, [hl]
-	and $7
-	jr z, .CheckFrozen
+	and SLP
+	jr z, .not_asleep
+
 	dec a
 	ld [EnemyMonStatus], a
 	and a
-	jr z, .WokeUp
+	jr z, .woke_up
 
-; 'fast asleep!'
 	ld hl, FastAsleepText
 	call StdBattleTextBox
 	xor a
@@ -434,60 +421,56 @@
 	ld [$cfca], a
 	ld de, ANIM_SLP
 	call FarPlayBattleAnimation
-	jr .FastAsleep
+	jr .fast_asleep
 
-
-.WokeUp
-; 'woke up!'
+.woke_up
 	ld hl, WokeUpText
 	call StdBattleTextBox
 	call CantMove
 	call UpdateEnemyMonInParty
-	ld hl, Function3e036
+	ld hl, UpdateEnemyHUD
 	call CallBattleCore
 	ld a, $1
 	ld [$ffd4], a
 	ld hl, EnemySubStatus1
-	res 0, [hl]
-	jr .CheckFrozen
+	res SUBSTATUS_NIGHTMARE, [hl]
+	jr .not_asleep
 
-
-.FastAsleep
-; Snore and Sleep Talk bypass sleep.
+.fast_asleep
+	; Snore and Sleep Talk bypass sleep.
 	ld a, [CurEnemyMove]
 	cp SNORE
-	jr z, .CheckFrozen
+	jr z, .not_asleep
 	cp SLEEP_TALK
-	jr z, .CheckFrozen
+	jr z, .not_asleep
 	call CantMove
 	jp Function34385
 
+.not_asleep
 
-.CheckFrozen
+
 	ld hl, EnemyMonStatus
-	bit 5, [hl]
-	jr z, .CheckFlinch
+	bit FRZ, [hl]
+	jr z, .not_frozen
 	ld a, [CurEnemyMove]
-	cp $ac
-	jr z, .CheckFlinch
-	cp $dd
-	jr z, .CheckFlinch
+	cp FLAME_WHEEL
+	jr z, .not_frozen
+	cp SACRED_FIRE
+	jr z, .not_frozen
 
-; 'frozen solid!'
 	ld hl, FrozenSolidText
 	call StdBattleTextBox
 	call CantMove
 	jp Function34385
 
+.not_frozen
 
-.CheckFlinch
+
 	ld hl, EnemySubStatus3
-	bit 3, [hl]
-	jr z, .CheckDisabled
+	bit SUBSTATUS_FLINCHED, [hl]
+	jr z, .not_flinched
 
-	res 3, [hl]
-
-; 'flinched!'
+	res SUBSTATUS_FLINCHED, [hl]
 	ld hl, FlinchedText
 	call StdBattleTextBox
 
@@ -494,47 +477,44 @@
 	call CantMove
 	jp Function34385
 
+.not_flinched
 
-.CheckDisabled
+
 	ld hl, EnemyDisableCount
 	ld a, [hl]
 	and a
-	jr z, .CheckConfused
+	jr z, .not_disabled
 
 	dec a
 	ld [hl], a
 	and $f
-	jr nz, .CheckConfused
+	jr nz, .not_disabled
 
 	ld [hl], a
 	ld [EnemyDisabledMove], a
 
-; 'disabled no more!'
 	ld hl, DisabledNoMoreText
 	call StdBattleTextBox
 
+.not_disabled
 
-.CheckConfused
+
 	ld a, [EnemySubStatus3]
-	add a
-	jr nc, .CheckAttract
+	add a ; bit SUBSTATUS_CONFUSED
+	jr nc, .not_confused
 
 	ld hl, $c67b
 	dec [hl]
-	jr nz, .Confused
+	jr nz, .confused
 
 	ld hl, EnemySubStatus3
-	res 7, [hl]
-
-; 'confused no more!'
+	res SUBSTATUS_CONFUSED, [hl]
 	ld hl, ConfusedNoMoreText
 	call StdBattleTextBox
+	jr .not_confused
 
-	jr .CheckAttract
 
-
-.Confused
-; 'confused!'
+.confused
 	ld hl, IsConfusedText
 	call StdBattleTextBox
 
@@ -543,83 +523,74 @@
 	ld de, ANIM_CONFUSED
 	call FarPlayBattleAnimation
 
-; 50% chance of hitting itself
+	; 50% chance of hitting itself
 	call BattleRandom
 	cp $80
-	jr nc, .CheckAttract
+	jr nc, .not_confused
 
+	; clear confusion-dependent substatus
 	ld hl, EnemySubStatus3
 	ld a, [hl]
-	and %10000000
+	and 1 << SUBSTATUS_CONFUSED
 	ld [hl], a
 
-; 'hurt itself in its confusion!'
 	ld hl, HurtItselfText
 	call StdBattleTextBox
-
 	call Function355dd
-
 	call BattleCommand62
-
 	call BattleCommand0a
-
 	xor a
 	ld [$cfca], a
 
-; Flicker the monster pic unless flying or underground.
-	ld de, $0115
+	; Flicker the monster pic unless flying or underground.
+	ld de, ANIM_HIT_CONFUSION
 	ld a, BATTLE_VARS_SUBSTATUS3_OPP
 	call GetBattleVar
-	and $60
+	and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
 	call z, PlayFXAnimID
 
 	ld c, $1
 	call Function35d1c
-
 	call BattleCommand0c
-
 	call CantMove
 	jp Function34385
 
+.not_confused
 
-.CheckAttract
+
 	ld a, [EnemySubStatus1]
-	add a ; check bit 7
-	jr nc, .CheckDisabledMove
+	add a ; bit SUBSTATUS_ATTRACT
+	jr nc, .not_infatuated
 
-; 'in love with'
 	ld hl, InLoveWithText
 	call StdBattleTextBox
-
 	xor a
 	ld [$cfca], a
-
 	ld de, ANIM_IN_LOVE
 	call FarPlayBattleAnimation
 
-; 50% chance of infatuation
+	; 50% chance of infatuation
 	call BattleRandom
 	cp $80
-	jr c, .CheckDisabledMove
+	jr c, .not_infatuated
 
-; 'infatuation kept it from attacking!'
 	ld hl, InfatuationText
 	call StdBattleTextBox
-
 	call CantMove
 	jp Function34385
 
+.not_infatuated
 
-.CheckDisabledMove
-; We can't disable a move that doesn't exist.
+
+	; We can't disable a move that doesn't exist.
 	ld a, [EnemyDisabledMove]
 	and a
-	jr z, .CheckParalyzed
+	jr z, .no_disabled_move
 
-; Are we using the disabled move?
+	; Are we using the disabled move?
 	ld hl, CurEnemyMove
 	cp [hl]
-	jr nz, .CheckParalyzed
+	jr nz, .no_disabled_move
 
 	call MoveDisabled
 
@@ -626,21 +597,20 @@
 	call CantMove
 	jp Function34385
 
+.no_disabled_move
 
-.CheckParalyzed
+
 	ld hl, EnemyMonStatus
-	bit 6, [hl]
+	bit PAR, [hl]
 	ret z
 
-; 25% chance to be fully paralyzed
+	; 25% chance to be fully paralyzed
 	call BattleRandom
 	cp $3f
 	ret nc
 
-; 'fully paralyzed!'
 	ld hl, FullyParalyzedText
 	call StdBattleTextBox
-
 	call CantMove
 
 	; fallthrough
@@ -656,10 +626,10 @@
 
 MoveDisabled: ; 3438d
 
-; Make sure any charged moves fail
+	; Make sure any charged moves fail
 	ld a, BATTLE_VARS_SUBSTATUS3
-	call _GetBattleVar
-	res 4, [hl]
+	call GetBattleVarAddr
+	res SUBSTATUS_CHARGED, [hl]
 
 	ld a, BATTLE_VARS_MOVE
 	call GetBattleVar
@@ -666,7 +636,6 @@
 	ld [$d265], a
 	call GetMoveName
 
-; 'disabled!'
 	ld hl, DisabledMoveText
 	jp StdBattleTextBox
 ; 343a5
@@ -674,7 +643,6 @@
 
 HitConfusion: ; 343a5
 
-; 'hurt itself in its confusion!'
 	ld hl, HurtItselfText
 	call StdBattleTextBox
 
@@ -682,30 +650,25 @@
 	ld [CriticalHit], a
 
 	call Function355dd
-
 	call BattleCommand62
-
 	call BattleCommand0a
 
 	xor a
 	ld [$cfca], a
 
-; Flicker the monster pic unless flying or underground.
-	ld de, $0115
+	; Flicker the monster pic unless flying or underground.
+	ld de, ANIM_HIT_CONFUSION
 	ld a, BATTLE_VARS_SUBSTATUS3_OPP
 	call GetBattleVar
-	and $60
+	and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
 	call z, PlayFXAnimID
 
-	ld hl, Function3df48
+	ld hl, UpdatePlayerHUD
 	call CallBattleCore
-
 	ld a, $1
 	ld [$ffd4], a
-
 	ld c, $1
 	call Function35d7e
-
 	jp BattleCommand0c
 ; 343db
 
@@ -713,7 +676,7 @@
 BattleCommand02: ; 343db
 ; checkobedience
 
-; Enemy can't disobey
+	; Enemy can't disobey
 	ld a, [hBattleTurn]
 	and a
 	ret nz
@@ -721,7 +684,7 @@
 	call Function34548
 	ret nz
 
-; If we've already checked this turn
+	; If we've already checked this turn
 	ld a, [AlreadyDisobeyed]
 	and a
 	ret nz
@@ -729,7 +692,8 @@
 	xor a
 	ld [AlreadyDisobeyed], a
 
-; No obedience in link battles (since no handling exists for enemy)
+	; No obedience in link battles
+	; (since no handling exists for enemy)
 	ld a, [InLinkBattle]
 	and a
 	ret nz
@@ -738,8 +702,8 @@
 	and a
 	ret nz
 
-; If the monster's id doesn't match the player's,
-; some conditions need to be met.
+	; If the monster's id doesn't match the player's,
+	; some conditions need to be met.
 	ld a, PartyMon1ID - PartyMon1
 	call BattlePartyAttr
 
@@ -753,30 +717,30 @@
 
 
 .obeylevel
-; The maximum obedience level is constrained by owned badges:
+	; The maximum obedience level is constrained by owned badges:
 	ld hl, JohtoBadges
 
-; risingbadge
+	; risingbadge
 	bit 7, [hl]
-	ld a, 101
+	ld a, MAX_LEVEL + 1
 	jr nz, .getlevel
 
-; stormbadge
+	; stormbadge
 	bit 5, [hl]
 	ld a, 70
 	jr nz, .getlevel
 
-; fogbadge
+	; fogbadge
 	bit 3, [hl]
 	ld a, 50
 	jr nz, .getlevel
 
-; hivebadge
+	; hivebadge
 	bit 1, [hl]
 	ld a, 30
 	jr nz, .getlevel
 
-; no badges
+	; no badges
 	ld a, 10
 
 
@@ -852,25 +816,21 @@
 	cp b
 	jr nc, .DoNothing
 
-; 'won't obey!'
 	ld hl, WontObeyText
 	call StdBattleTextBox
-
 	call HitConfusion
+	jp .asm_3450c
 
-	jp Function3450c
 
-
 .Nap
 	call BattleRandom
 	add a
 	swap a
-	and 7
+	and SLP
 	jr z, .Nap
 
 	ld [BattleMonStatus], a
 
-; 'began to nap!'
 	ld hl, BeganToNapText
 	jr .Print
 
@@ -879,33 +839,29 @@
 	call BattleRandom
 	and 3
 
-; 'loafing around!'
 	ld hl, LoafingAroundText
 	and a
 	jr z, .Print
 
-; 'won't obey!'
 	ld hl, WontObeyText
 	dec a
 	jr z, .Print
 
-; 'turned away!'
 	ld hl, TurnedAwayText
 	dec a
 	jr z, .Print
 
-; 'ignored orders!'
 	ld hl, IgnoredOrdersText
 
 .Print
 	call StdBattleTextBox
-	jp Function3450c
+	jp .asm_3450c
 
 
 .UseInstead
 
 ; Can't use another move if the monster only has one!
-	ld a, [BattleMonMove2]
+	ld a, [BattleMonMoves + 1]
 	and a
 	jr z, .DoNothing
 
@@ -965,7 +921,7 @@
 
 .RandomMove
 	call BattleRandom
-	and 3
+	and 3 ; TODO NUM_MOVES
 
 	cp b
 	jr nc, .RandomMove
@@ -1003,19 +959,15 @@
 	pop af
 	ld [CurMoveNum], a
 
-	; fallthrough
-; 3450c
 
-
-Function3450c: ; 3450c
+.asm_3450c
 	xor a
 	ld [LastPlayerMove], a
 	ld [LastEnemyCounterMove], a
 
+	; Break Encore too.
 	ld hl, PlayerSubStatus5
-	res 4, [hl]
-
-; Break encore too.
+	res SUBSTATUS_ENCORED, [hl]
 	xor a
 	ld [PlayerEncoreCount], a
 
@@ -1038,7 +990,7 @@
 .CheckSleep
 	ld a, BATTLE_VARS_STATUS
 	call GetBattleVar
-	and 7
+	and SLP
 	ret z
 
 ; 'ignored orders…sleeping!'
@@ -1113,7 +1065,7 @@
 	inc de
 
 	ld a, [de]
-	bit 3, a
+	bit SUBSTATUS_TRANSFORMED, a
 	ret nz
 
 	ld a, [hBattleTurn]
@@ -1147,13 +1099,13 @@
 
 .asm_345b8
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [hl]
 	and $3f
 	jr z, .asm_345e3
 	dec [hl]
-	ld b, $0
+	ld b, 0
 	ret
 
 .asm_345c5
@@ -1160,7 +1112,7 @@
 	ld hl, EnemyMonMoves
 	ld a, [CurEnemyMoveNum]
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [hl]
 	cp MIMIC
@@ -1289,7 +1241,7 @@
 .FocusEnergy
 	ld a, BATTLE_VARS_SUBSTATUS4
 	call GetBattleVar
-	bit 2, a
+	bit SUBSTATUS_FOCUS_ENERGY, a
 	jr z, .CheckCritical
 
 ; +1 critical level
@@ -1410,7 +1362,7 @@
 
 .go
 	ld a, BATTLE_VARS_MOVE_TYPE
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld [$d265], a
 
 	push hl
@@ -1467,12 +1419,12 @@
 	cp $ff
 	jr z, .end
 
-; foresight
+	; foresight
 	cp $fe
 	jr nz, .asm_34757
 	ld a, BATTLE_VARS_SUBSTATUS1_OPP
 	call GetBattleVar
-	bit 3, a
+	bit SUBSTATUS_IDENTIFIED, a
 	jr nz, .end
 
 	jr .asm_34743
@@ -1584,7 +1536,7 @@
 	ld b, [hl]
 	inc hl
 	ld c, [hl]
-	ld a, $a
+	ld a, 10 ; 1.0
 	ld [$d265], a
 	ld hl, TypeMatchup
 .asm_347e7
@@ -1643,8 +1595,8 @@
 	call Function347c8
 	ld a, [$d265]
 	and a
-	ld a, $a
-	jr nz, .asm_3484a ; 3483c $c
+	ld a, 10 ; 1.0
+	jr nz, .asm_3484a
 	call ResetDamage
 	xor a
 	ld [TypeModifier], a
@@ -1666,75 +1618,86 @@
 	ld hl, PlayerUsedMoves
 	ld a, [hl]
 	and a
-	jr z, .asm_348b0 ; 0x3485b $53
-	ld d, $4
-	ld e, $0
-.asm_34861
+	jr z, .unknown_moves
+
+	ld d, NUM_MOVES
+	ld e, 0
+.loop
 	ld a, [hli]
 	and a
-	jr z, .asm_3489f ; 0x34863 $3a
+	jr z, .exit
 	push hl
 	dec a
-	ld hl, Moves + PlayerMovePower - PlayerMoveStruct
+	ld hl, Moves + MOVE_POWER
 	call GetMoveAttr
 	and a
-	jr z, .asm_3489b ; 0x3486e $2b
+	jr z, .next
+
 	inc hl
 	call GetMoveByte
-	ld hl, EnemyMonType1
+	ld hl, EnemyMonType
 	call Function347d3
 	ld a, [$d265]
-	cp $b
-	jr nc, .asm_34895 ; 0x3487f $14
+	cp 10 + 1 ; 1.0 + 0.1
+	jr nc, .super_effective
 	and a
-	jr z, .asm_3489b ; 0x34882 $17
-	cp $a
-	jr nc, .asm_34891 ; 0x34886 $9
+	jr z, .next
+	cp 10 ; 1.0
+	jr nc, .neutral
+
+.not_very_effective
 	ld a, e
-	cp $1
-	jr nc, .asm_3489b ; 0x3488b $e
-	ld e, $1
-	jr .asm_3489b ; 0x3488f $a
-.asm_34891
-	ld e, $2
-	jr .asm_3489b ; 0x34893 $6
-.asm_34895
+	cp 1 ; 0.1
+	jr nc, .next
+	ld e, 1
+	jr .next
+
+.neutral
+	ld e, 2
+	jr .next
+
+.super_effective
 	call Function34931
 	pop hl
-	jr .asm_348d7 ; 0x34899 $3c
-.asm_3489b
+	jr .done
+
+.next
 	pop hl
 	dec d
-	jr nz, .asm_34861 ; 0x3489d $c2
-.asm_3489f
+	jr nz, .loop
+
+.exit
 	ld a, e
-	cp $2
-	jr z, .asm_348d7 ; 0x348a2 $33
+	cp 2
+	jr z, .done
 	call Function34939
 	ld a, e
 	and a
-	jr nz, .asm_348d7 ; 0x348a9 $2c
+	jr nz, .done
 	call Function34939
-	jr .asm_348d7 ; 0x348ae $27
-.asm_348b0
+	jr .done
+
+.unknown_moves
 	ld a, [BattleMonType1]
 	ld b, a
 	ld hl, EnemyMonType1
 	call Function347d3
 	ld a, [$d265]
-	cp $b
-	jr c, .asm_348c4 ; 0x348bf $3
+	cp 10 + 1 ; 1.0 + 0.1
+	jr c, .ok
 	call Function34931
-.asm_348c4
+.ok
 	ld a, [BattleMonType2]
 	cp b
-	jr z, .asm_348d7 ; 0x348c8 $d
+	jr z, .ok2
 	call Function347d3
 	ld a, [$d265]
-	cp $b
-	jr c, .asm_348d7 ; 0x348d2 $3
+	cp 10 + 1 ; 1.0 + 0.1
+	jr c, .ok2
 	call Function34931
-.asm_348d7
+.ok2
+
+.done
 	call Function348de
 	pop bc
 	pop de
@@ -1744,13 +1707,12 @@
 
 
 Function348de: ; 348de
-	ld de, EnemyMonMove1
-	ld b, 5
+	ld de, EnemyMonMoves
+	ld b, NUM_MOVES + 1
 	ld c, 0
 
 	ld a, [$d265]
 	push af
-
 .loop
 	dec b
 	jr z, .exit
@@ -1761,7 +1723,7 @@
 
 	inc de
 	dec a
-	ld hl, Moves + PlayerMovePower - PlayerMoveStruct
+	ld hl, Moves + MOVE_POWER
 	call GetMoveAttr
 	and a
 	jr z, .loop
@@ -1770,27 +1732,31 @@
 	call GetMoveByte
 	ld hl, BattleMonType1
 	call Function347d3
+
 	ld a, [$d265]
+	; immune
 	and a
 	jr z, .loop
 
+	; not very effective
 	inc c
-	cp $a
+	cp 10
 	jr c, .loop
 
+	; neutral
 	inc c
 	inc c
 	inc c
 	inc c
 	inc c
-
-	cp $a
+	cp 10
 	jr z, .loop
 
-	ld c, $64
+	; super effective
+	ld c, 100
 	jr .loop
-.exit
 
+.exit
 	pop af
 	ld [$d265], a
 
@@ -1797,9 +1763,9 @@
 	ld a, c
 	and a
 	jr z, .doubledown ; double down
-	cp $5
+	cp 5
 	jr c, Function34931 ; down
-	cp $64
+	cp 100
 	ret c
 	jr Function34939 ; up
 
@@ -1833,11 +1799,11 @@
 	ret c
 
 	ld a, [EnemySubStatus1]
-	bit 4, a
+	bit SUBSTATUS_PERISH, a
 	jr z, .asm_34986
 
-	ld a, [$c67f]
-	cp $1
+	ld a, [EnemyPerishCount]
+	cp 1
 	jr nz, .asm_34986
 
 	call Function349f4
@@ -1945,18 +1911,18 @@
 Function349f4: ; 349f4
 	ld a, [OTPartyCount]
 	cp 2
-	jr c, .asm_34a26
+	jr c, .only_one
 
 	ld d, a
 	ld e, 0
-	ld b, $20
+	ld b, 1 << (PARTY_LENGTH - 1)
 	ld c, 0
 	ld hl, OTPartyMon1HP
 
-.asm_34a05
+.loop
 	ld a, [CurOTMon]
 	cp e
-	jr z, .asm_34a16
+	jr z, .next
 
 	push bc
 	ld b, [hl]
@@ -1964,30 +1930,31 @@
 	ld a, [hld]
 	or b
 	pop bc
-	jr z, .asm_34a16
+	jr z, .next
 
 	ld a, c
 	or b
 	ld c, a
-.asm_34a16
+
+.next
 	srl b
 	push bc
-	ld bc, $30
+	ld bc, PartyMon2 - PartyMon1
 	add hl, bc
 	pop bc
 	inc e
 	dec d
-	jr nz, .asm_34a05
+	jr nz, .loop
 
 	ld a, c
 	and a
-	jr nz, .asm_34a28
+	jr nz, .more_than_one
 
-.asm_34a26
+.only_one
 	scf
 	ret
 
-.asm_34a28
+.more_than_one
 	and a
 	ret
 ; 34a2a
@@ -2010,7 +1977,7 @@
 
 	push hl
 	push bc
-	ld bc, $0022
+	ld bc, PartyMon1HP - PartyMon1
 	add hl, bc
 	pop bc
 	ld a, [hli]
@@ -2023,7 +1990,7 @@
 	call GetBaseData
 	ld a, [LastEnemyCounterMove]
 	dec a
-	ld hl, Moves + PlayerMovePower - PlayerMoveStruct
+	ld hl, Moves + MOVE_POWER
 	call GetMoveAttr
 	and a
 	jr z, .asm_34a77
@@ -2045,7 +2012,7 @@
 	ret z
 
 	push bc
-	ld bc, $30
+	ld bc, PartyMon2 - PartyMon1
 	add hl, bc
 	pop bc
 
@@ -2074,7 +2041,7 @@
 .asm_34a98
 	srl b
 	push bc
-	ld bc, $2f
+	ld bc, PartyMon2HP - (PartyMon1HP + 1)
 	add hl, bc
 	pop bc
 	dec e
@@ -2093,7 +2060,7 @@
 
 	ld a, $ff
 	ld [$c716], a
-	ld hl, OTPartyMon1Move1
+	ld hl, OTPartyMon1Moves
 	ld b, $20
 	ld d, $0
 	ld e, $0
@@ -2104,7 +2071,7 @@
 
 	push hl
 	push bc
-	ld b, $4
+	ld b, NUM_MOVES
 	ld c, $0
 .asm_34abf
 	ld a, [hli]
@@ -2113,7 +2080,7 @@
 	jr z, .asm_34aef
 
 	dec a
-	ld hl, Moves + PlayerMovePower - PlayerMoveStruct
+	ld hl, Moves + MOVE_POWER
 	call GetMoveAttr
 	and a
 	jr z, .asm_34ae9
@@ -2159,7 +2126,7 @@
 
 .asm_34b00
 	push bc
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	add hl, bc
 	pop bc
 	srl b
@@ -2206,7 +2173,7 @@
 	jr z, .asm_34b4a
 
 	dec a
-	ld hl, Moves + PlayerMovePower - PlayerMoveStruct
+	ld hl, Moves + MOVE_POWER
 	call GetMoveAttr
 	and a
 	jr z, .asm_34b4a
@@ -2252,15 +2219,15 @@
 Function34b77: ; 34b77
 	push bc
 	ld de, OTPartySpecies
-	ld b, $20
+	ld b, 1 << (PARTY_LENGTH - 1)
 	ld c, 0
 	ld hl, OTPartyMon1HP
 
-.asm_34b82
+.loop
 	ld a, [de]
 	inc de
 	cp $ff
-	jr z, .asm_34bac
+	jr z, .done
 
 	push hl
 	push bc
@@ -2278,22 +2245,22 @@
 	ld a, [hl]
 	sbc b
 	pop bc
-	jr nc, .asm_34ba1
+	jr nc, .next
 
 	ld a, b
 	or c
 	ld c, a
 
-.asm_34ba1
+.next
 	srl b
 	pop hl
 	push bc
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	add hl, bc
 	pop bc
-	jr .asm_34b82
+	jr .loop
 
-.asm_34bac
+.done
 	ld a, c
 	pop bc
 	and c
@@ -2386,7 +2353,7 @@
 	call .UnleashedEnergy
 	ret nz
 
-; Perfect-accuracy moves
+	; Perfect-accuracy moves
 	ld a, BATTLE_VARS_MOVE_EFFECT
 	call GetBattleVar
 	cp EFFECT_ALWAYS_HIT
@@ -2394,12 +2361,12 @@
 
 	call .StatModifiers
 
-	ld a, [PlayerMoveAccuracy]
+	ld a, [wPlayerMoveStruct + MOVE_ACC]
 	ld b, a
 	ld a, [hBattleTurn]
 	and a
 	jr z, .BrightPowder
-	ld a, [EnemyMoveAccuracy]
+	ld a, [wEnemyMoveStruct + MOVE_ACC]
 	ld b, a
 
 .BrightPowder
@@ -2485,7 +2452,7 @@
 ; Return nz if we are locked-on and aren't trying to use Earthquake,
 ; Fissure or Magnitude on a monster that is flying.
 	ld a, BATTLE_VARS_SUBSTATUS5_OPP
-	call _GetBattleVar
+	call GetBattleVarAddr
 	bit SUBSTATUS_LOCK_ON, [hl]
 	res SUBSTATUS_LOCK_ON, [hl]
 	ret z
@@ -2591,7 +2558,7 @@
 	ld a, [hBattleTurn]
 	and a
 
-	ld hl, PlayerMoveAccuracy
+	ld hl, wPlayerMoveStruct + MOVE_ACC
 	ld a, [PlayerAccLevel]
 	ld b, a
 	ld a, [EnemyEvaLevel]
@@ -2599,7 +2566,7 @@
 
 	jr z, .asm_34e60
 
-	ld hl, EnemyMoveAccuracy
+	ld hl, wEnemyMoveStruct + MOVE_ACC
 	ld a, [EnemyAccLevel]
 	ld b, a
 	ld a, [PlayerEvaLevel]
@@ -2694,11 +2661,11 @@
 	jr nz, .failed
 
 	push hl
-	ld hl, PlayerMoveEffectChance
+	ld hl, wPlayerMoveStruct + MOVE_CHANCE
 	ld a, [hBattleTurn]
 	and a
 	jr z, .asm_34ee1
-	ld hl, EnemyMoveEffectChance
+	ld hl, wEnemyMoveStruct + MOVE_CHANCE
 .asm_34ee1
 
 	call BattleRandom
@@ -2937,12 +2904,12 @@
 
 	call Function350e4
 	ld a, BATTLE_VARS_MOVE_ANIM
-	call _GetBattleVar
+	call GetBattleVarAddr
 
 	cp FLY
-	jr z, .asm_3504f ; 35032 $1b
+	jr z, .asm_3504f
 	cp DIG
-	jr z, .asm_3504f ; 35036 $17
+	jr z, .asm_3504f
 
 ; Move effect:
 	inc hl
@@ -2962,7 +2929,7 @@
 
 .asm_3504f
 	ld a, BATTLE_VARS_SUBSTATUS3
-	call _GetBattleVar
+	call GetBattleVarAddr
 	res SUBSTATUS_UNDERGROUND, [hl]
 	res SUBSTATUS_FLYING, [hl]
 	call Function37ece
@@ -2976,12 +2943,12 @@
 	ld a, BATTLE_VARS_SUBSTATUS1_OPP
 	call GetBattleVar
 	bit SUBSTATUS_ENDURE, a
-	jr z, .asm_35072 ; 35065 $b
+	jr z, .asm_35072
 	call BattleCommand4b
 	ld b, $0
-	jr nc, .asm_3508b ; 3506c $1d
+	jr nc, .asm_3508b
 	ld b, $1
-	jr .asm_3508b ; 35070 $19
+	jr .asm_3508b
 
 .asm_35072
 	call GetOpponentItem
@@ -2988,13 +2955,13 @@
 	ld a, b
 	cp HELD_FOCUS_BAND
 	ld b, $0
-	jr nz, .asm_3508b ; 3507a $f
+	jr nz, .asm_3508b
 	call BattleRandom
 	cp c
-	jr nc, .asm_3508b ; 35080 $9
+	jr nc, .asm_3508b
 	call BattleCommand4b
 	ld b, $0
-	jr nc, .asm_3508b ; 35087 $2
+	jr nc, .asm_3508b
 	ld b, $2
 .asm_3508b
 	push bc
@@ -3015,7 +2982,7 @@
 	and a
 	ret z
 	dec a
-	jr nz, .asm_350ab ; 350a3 $6
+	jr nz, .asm_350ab
 	ld hl, EnduredText
 	jp StdBattleTextBox
 
@@ -3066,23 +3033,24 @@
 	ld de, DoesntAffectText
 	ld a, [TypeModifier]
 	and $7f
-	jr z, .asm_35110 ; 0x350ef $1f
+	jr z, .asm_35110
 	ld a, BATTLE_VARS_MOVE_EFFECT
 	call GetBattleVar
 	cp EFFECT_FUTURE_SIGHT
 	ld hl, ButItFailedText
 	ld de, ItFailedText
-	jr z, .asm_35110 ; 0x350fe $10
+	jr z, .asm_35110
 	ld hl, AttackMissedText
 	ld de, AttackMissed2Text
 	ld a, [CriticalHit]
 	cp $ff
-	jr nz, .asm_35110 ; 0x3510b $3
+	jr nz, .asm_35110
 	ld hl, UnaffectedText
 .asm_35110
 	call Function35157
 	xor a
 	ld [CriticalHit], a
+
 	ld a, BATTLE_VARS_MOVE_EFFECT
 	call GetBattleVar
 	cp EFFECT_JUMP_KICK
@@ -3093,17 +3061,15 @@
 	ld hl, CurDamage
 	ld a, [hli]
 	ld b, [hl]
+	rept 3
 	srl a
 	rr b
-	srl a
-	rr b
-	srl a
-	rr b
+	endr
 	ld [hl], b
 	dec hl
 	ld [hli], a
 	or b
-	jr nz, .asm_3513e ; 0x3513a $2
+	jr nz, .asm_3513e
 	inc a
 	ld [hl], a
 .asm_3513e
@@ -3153,7 +3119,7 @@
 
 	dec a
 	add a
-	ld hl, .ptrs
+	ld hl, .texts
 	ld b, 0
 	ld c, a
 	add hl, bc
@@ -3169,9 +3135,9 @@
 	ld c, 20
 	jp DelayFrames
 
-.ptrs
-	dw CriticalHitText ; 'critical hit'
-	dw OneHitKOText    ; 'one-hit ko'
+.texts
+	dw CriticalHitText
+	dw OneHitKOText
 ; 35197
 
 
@@ -3181,10 +3147,9 @@
 	ld hl, PlayerRolloutCount
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_351a2
+	jr z, .ok
 	ld hl, EnemyRolloutCount
-
-.asm_351a2
+.ok
 	xor a
 	ld [hl], a
 	ret
@@ -3195,8 +3160,8 @@
 ; supereffectivelooptext
 
 	ld a, BATTLE_VARS_SUBSTATUS3
-	call _GetBattleVar
-	bit 2, a
+	call GetBattleVarAddr
+	bit SUBSTATUS_IN_LOOP, a
 	ret nz
 
 	; fallthrough
@@ -3210,9 +3175,9 @@
 	and $7f
 	cp 10 ; 1.0
 	ret z
-	ld hl, SuperEffectiveText ; 'super-effective'
+	ld hl, SuperEffectiveText
 	jr nc, .print
-	ld hl, NotVeryEffectiveText ; 'not very effective'
+	ld hl, NotVeryEffectiveText
 .print
 	jp StdBattleTextBox
 ; 351c0
@@ -3223,7 +3188,7 @@
 
 ; Faint the user if it fainted an opponent using Destiny Bond.
 
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld a, [hBattleTurn]
 	and a
 	jr z, .asm_351cb
@@ -3270,8 +3235,7 @@
 	ld [$d1ef], a
 	ld h, b
 	ld l, c
-	ld a, $b
-	call Predef
+	predef Functionc6e0
 	call RefreshBattleHuds
 
 	call SwitchTurn
@@ -3352,14 +3316,14 @@
 	ld a, [hBattleTurn]
 	and a
 	ld a, [$c72b]
-	jr z, .asm_35290 ; 3528b $3
+	jr z, .asm_35290
 	ld a, [$c72c]
 .asm_35290
 	and a
-	jr z, .asm_3529a ; 35291 $7
+	jr z, .asm_3529a
 	dec a
 	add hl, bc
-	jr nc, .asm_35290 ; 35295 $f9
+	jr nc, .asm_35290
 	ld hl, $ffff
 .asm_3529a
 	ld a, h
@@ -3437,7 +3401,7 @@
 
 	call ResetDamage
 
-	ld hl, PlayerMovePower
+	ld hl, wPlayerMoveStruct + MOVE_POWER
 	ld a, [hli]
 	and a
 	ld d, a
@@ -3447,22 +3411,20 @@
 	cp SPECIAL
 	jr nc, .special
 
-
-; Physical
-	ld hl, EnemyMonDef
+.physical
+	ld hl, EnemyMonDefense
 	ld a, [hli]
 	ld b, a
 	ld c, [hl]
 
-; Reflect
 	ld a, [EnemyScreens]
-	bit 4, a
+	bit SCREENS_REFLECT, a
 	jr z, .physicalcrit
 	sla c
 	rl b
 
 .physicalcrit
-	ld hl, BattleMonAtk
+	ld hl, BattleMonAttack
 	call GetDamageStatsCritical
 	jr c, .thickclub
 
@@ -3473,7 +3435,6 @@
 	ld hl, PlayerStats
 	jr .thickclub
 
-
 .special
 	ld hl, EnemyMonSpclDef
 	ld a, [hli]
@@ -3480,9 +3441,8 @@
 	ld b, a
 	ld c, [hl]
 
-; Light Screen
 	ld a, [EnemyScreens]
-	bit 3, a
+	bit SCREENS_LIGHT_SCREEN, a
 	jr z, .specialcrit
 	sla c
 	rl b
@@ -3492,11 +3452,11 @@
 	call GetDamageStatsCritical
 	jr c, .lightball
 
-	ld hl, $c6c9
+	ld hl, EnemyStats + SP_DEFENSE * 2
 	ld a, [hli]
 	ld b, a
 	ld c, [hl]
-	ld hl, $c6bc
+	ld hl, PlayerStats + SP_ATTACK * 2
 
 .lightball
 ; Note: Returns player special attack at hl in hl.
@@ -3585,7 +3545,7 @@
 	ld a, [hBattleTurn]
 	and a
 	jr nz, .enemy
-	ld a, [PlayerMoveType]
+	ld a, [wPlayerMoveStruct + MOVE_TYPE]
 	cp SPECIAL
 ; special
 	ld a, [PlayerSAtkLevel]
@@ -3599,7 +3559,7 @@
 	jr .end
 
 .enemy
-	ld a, [EnemyMoveType]
+	ld a, [wEnemyMoveStruct + MOVE_TYPE]
 	cp SPECIAL
 ; special
 	ld a, [EnemySAtkLevel]
@@ -3698,8 +3658,8 @@
 	call ResetDamage
 
 ; No damage dealt with 0 power.
-	ld hl, EnemyMovePower
-	ld a, [hli] ; hl = EnemyMoveType
+	ld hl, wEnemyMoveStruct + MOVE_POWER
+	ld a, [hli] ; hl = wEnemyMoveStruct + MOVE_TYPE
 	ld d, a
 	and a
 	ret z
@@ -3708,22 +3668,20 @@
 	cp SPECIAL
 	jr nc, .Special
 
-
-; Physical
-	ld hl, BattleMonDef
+.physical
+	ld hl, BattleMonDefense
 	ld a, [hli]
 	ld b, a
 	ld c, [hl]
 
-; Reflect
 	ld a, [PlayerScreens]
-	bit 4, a
+	bit SCREENS_REFLECT, a
 	jr z, .physicalcrit
 	sla c
 	rl b
 
 .physicalcrit
-	ld hl, EnemyMonAtk
+	ld hl, EnemyMonAttack
 	call GetDamageStatsCritical
 	jr c, .thickclub
 
@@ -3734,7 +3692,6 @@
 	ld hl, EnemyStats
 	jr .thickclub
 
-
 .Special
 	ld hl, BattleMonSpclDef
 	ld a, [hli]
@@ -3741,9 +3698,8 @@
 	ld b, a
 	ld c, [hl]
 
-; Light Screen
 	ld a, [PlayerScreens]
-	bit 3, a
+	bit SCREENS_LIGHT_SCREEN, a
 	jr z, .specialcrit
 	sla c
 	rl b
@@ -3786,15 +3742,15 @@
 	and a
 	jp nz, .asm_354ef
 	ld a, [PlayerSubStatus3]
-	bit 2, a
-	jr nz, .asm_35482 ; 3546f $11
-	ld c, $14
+	bit SUBSTATUS_IN_LOOP, a
+	jr nz, .asm_35482
+	ld c, 20
 	call DelayFrames
 	xor a
 	ld [PlayerRolloutCount], a
 	ld [DefaultFlypoint], a
 	ld [$c72d], a
-	jr .asm_3548d ; 35480 $b
+	jr .asm_3548d
 .asm_35482
 	ld a, [PlayerRolloutCount]
 	ld b, a
@@ -3803,7 +3759,7 @@
 	ld [DefaultFlypoint], a
 .asm_3548d
 	ld a, [DefaultFlypoint]
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call GetNick
 	ld a, $22
 	call Function355bd
@@ -3815,7 +3771,7 @@
 	ld a, [CurBattleMon]
 	cp [hl]
 	ld hl, BattleMonStatus
-	jr z, .asm_354b2 ; 354ab $5
+	jr z, .asm_354b2
 	ld a, $20
 	call Function355bd
 .asm_354b2
@@ -3846,13 +3802,13 @@
 	ld a, [hl]
 	ld e, a
 	pop bc
-	ld a, [PlayerMovePower]
+	ld a, [wPlayerMoveStruct + MOVE_POWER]
 	ld d, a
 	ret
 
 .asm_354ef
 	ld a, [EnemySubStatus3]
-	bit 2, a
+	bit SUBSTATUS_IN_LOOP, a
 	jr nz, .asm_35502
 
 	xor a
@@ -3882,7 +3838,7 @@
 
 	ld a, [DefaultFlypoint]
 	ld c, a
-	ld b, $0
+	ld b, 0
 	ld hl, OTPartySpecies
 	add hl, bc
 	ld a, [hl]
@@ -3892,8 +3848,8 @@
 
 .asm_35532
 	ld a, [DefaultFlypoint]
-	ld hl, OTPartyMon1Nickname
-	ld bc, $000b
+	ld hl, OTPartyMonNicknames
+	ld bc, NAME_LENGTH
 	call AddNTimes
 	ld de, StringBuffer1
 	call CopyBytes
@@ -3951,7 +3907,7 @@
 	ld a, [hl]
 	ld e, a
 	pop bc
-	ld a, [EnemyMovePower]
+	ld a, [wEnemyMoveStruct + MOVE_POWER]
 	ld d, a
 	ret
 ; 355b0
@@ -4003,12 +3959,12 @@
 	call ResetDamage
 	ld a, [hBattleTurn]
 	and a
-	ld hl, BattleMonDef
+	ld hl, BattleMonDefense
 	ld de, PlayerScreens
 	ld a, [BattleMonLevel]
 	jr z, .asm_355f7
 
-	ld hl, EnemyMonDef
+	ld hl, EnemyMonDefense
 	ld de, EnemyScreens
 	ld a, [EnemyMonLevel]
 .asm_355f7
@@ -4017,7 +3973,7 @@
 	ld b, a
 	ld c, [hl]
 	ld a, [de]
-	bit 4, a
+	bit SCREENS_REFLECT, a
 	jr z, .asm_35604
 
 	sla c
@@ -4077,7 +4033,6 @@
 	ld c, 1
 .asm_35631
 
-
 	xor a
 	ld hl, hDividend
 	ld [hli], a
@@ -4124,7 +4079,6 @@
 	ld b, $4
 	call Divide
 
-
 ; Item boosts
 	call GetUserItem
 
@@ -4344,7 +4298,7 @@
 	ld a, $0
 	jr .asm_3578c ; 35769 $21
 .asm_3576b
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld a, [hBattleTurn]
 	and a
 	jr z, .asm_35776 ; 35771 $3
@@ -4375,7 +4329,7 @@
 	ld a, [hBattleTurn]
 	and a
 	jr z, .asm_3579d ; 35798 $3
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 .asm_3579d
 	xor a
 	ld [$ffb3], a
@@ -4432,7 +4386,7 @@
 	ld a, [hl]
 	jr nz, .asm_357f8
 
-	ld hl, PlayerMovePower
+	ld hl, wPlayerMoveStruct + MOVE_POWER
 	ld [hl], a
 	push hl
 	call PlayerAttackDamage
@@ -4439,7 +4393,7 @@
 	jr .asm_35800
 
 .asm_357f8
-	ld hl, EnemyMovePower
+	ld hl, wEnemyMoveStruct + MOVE_POWER
 	ld [hl], a
 	push hl
 	call EnemyAttackDamage
@@ -4529,20 +4483,20 @@
 	ld de, EnemyEncoreCount
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_35875 ; 3586d $6
+	jr z, .ok
 	ld hl, BattleMonMoves
 	ld de, PlayerEncoreCount
-.asm_35875
+.ok
 	ld a, BATTLE_VARS_LAST_MOVE_OPP
 	call GetBattleVar
 	and a
-	jp z, Function35923
+	jp z, .failed
 	cp STRUGGLE
-	jp z, Function35923
+	jp z, .failed
 	cp ENCORE
-	jp z, Function35923
+	jp z, .failed
 	cp MIRROR_MOVE
-	jp z, Function35923
+	jp z, .failed
 	ld b, a
 
 .asm_3588e
@@ -4554,15 +4508,15 @@
 	add hl, bc
 	ld a, [hl]
 	and $3f
-	jp z, Function35923
+	jp z, .failed
 	ld a, [AttackMissed]
 	and a
-	jp nz, Function35923
+	jp nz, .failed
 	ld a, BATTLE_VARS_SUBSTATUS5_OPP
-	call _GetBattleVar
-	bit 4, [hl]
-	jp nz, Function35923
-	set 4, [hl]
+	call GetBattleVarAddr
+	bit SUBSTATUS_ENCORED, [hl]
+	jp nz, .failed
+	set SUBSTATUS_ENCORED, [hl]
 	call BattleRandom
 	and $3
 	inc a
@@ -4574,10 +4528,11 @@
 	ld a, [hBattleTurn]
 	and a
 	jr z, .asm_358ef
+
 	push hl
 	ld a, [LastPlayerMove]
 	ld b, a
-	ld c, $0
+	ld c, 0
 	ld hl, BattleMonMoves
 .asm_358cc
 	ld a, [hli]
@@ -4585,28 +4540,31 @@
 	jr z, .asm_358dd
 	inc c
 	ld a, c
-	cp $4
+	cp NUM_MOVES
 	jr c, .asm_358cc
 	pop hl
-	res 4, [hl]
+	res SUBSTATUS_ENCORED, [hl]
 	xor a
 	ld [de], a
-	jr Function35923
+	jr .failed
+
 .asm_358dd
 	pop hl
+
 	ld a, c
 	ld [CurMoveNum], a
 	ld a, b
 	ld [CurPlayerMove], a
 	dec a
-	ld de, PlayerMoveStruct
+	ld de, wPlayerMoveStruct
 	call GetMoveData
 	jr .asm_3591a
+
 .asm_358ef
 	push hl
 	ld a, [LastEnemyMove]
 	ld b, a
-	ld c, $0
+	ld c, 0
 	ld hl, EnemyMonMoves
 .asm_358f9
 	ld a, [hli]
@@ -4614,31 +4572,30 @@
 	jr z, .asm_3590a
 	inc c
 	ld a, c
-	cp $4
+	cp NUM_MOVES
 	jr c, .asm_358f9
 	pop hl
-	res 4, [hl]
+	res SUBSTATUS_ENCORED, [hl]
 	xor a
 	ld [de], a
-	jr Function35923
+	jr .failed
 .asm_3590a
 	pop hl
+
 	ld a, c
 	ld [CurEnemyMoveNum], a
 	ld a, b
 	ld [CurEnemyMove], a
 	dec a
-	ld de, EnemyMoveStruct
+	ld de, wEnemyMoveStruct
 	call GetMoveData
+
 .asm_3591a
 	call AnimateCurrentMove
-
 	ld hl, GotAnEncoreText
 	jp StdBattleTextBox
-; 35923
 
-
-Function35923: ; 35923
+.failed
 	jp PrintDidntAffect2
 ; 35926
 
@@ -4653,14 +4610,13 @@
 	jp nz, Function359cd
 	call AnimateCurrentMove
 	ld hl, $c63f
-	ld de, EnemyMonMaxHPLo
+	ld de, EnemyMonMaxHP + 1
 	call .asm_3597d
 	ld a, $1
 	ld [$d10a], a
 	hlcoord 10, 9
-	ld a, $b
-	call Predef
-	ld hl, EnemyMonHPHi
+	predef Functionc6e0
+	ld hl, EnemyMonHP
 	ld a, [hli]
 	ld [$d1ed], a
 	ld a, [hli]
@@ -4674,8 +4630,7 @@
 	ld [$d10a], a
 	call ResetDamage
 	hlcoord 2, 2
-	ld a, $b
-	call Predef
+	predef Functionc6e0
 	callba Function178000
 
 	ld hl, SharedPainText
@@ -4765,43 +4720,43 @@
 
 	ld a, [AttackMissed]
 	and a
-	jr nz, .asm_35a50 ; 359ea $64
+	jr nz, .asm_35a50
 	ld hl, BattleMonType1
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_359f7 ; 359f2 $3
+	jr z, .asm_359f7
 	ld hl, EnemyMonType1
 .asm_359f7
 	ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
 	call GetBattleVar
 	and a
-	jr z, .asm_35a50 ; 359fd $51
+	jr z, .asm_35a50
 	push hl
 	dec a
-	ld hl, Moves + PlayerMoveType - PlayerMoveStruct
+	ld hl, Moves + MOVE_TYPE
 	call GetMoveAttr
 	ld d, a
 	pop hl
 	cp CURSE_T
-	jr z, .asm_35a50 ; 35a0b $43
+	jr z, .asm_35a50
 	call AnimateCurrentMove
-
 	call SwitchTurn
+
 .asm_35a13
 	call BattleRandom
 	and $1f
-	cp $a
-	jr c, .asm_35a24 ; 35a1a $8
-	cp $14
-	jr c, .asm_35a13 ; 35a1e $f3
-	cp $1c
-	jr nc, .asm_35a13 ; 35a22 $ef
+	cp UNUSED_TYPES
+	jr c, .asm_35a24
+	cp UNUSED_TYPES_END
+	jr c, .asm_35a13
+	cp TYPES_END
+	jr nc, .asm_35a13
 .asm_35a24
 	ld [hli], a
 	ld [hld], a
 	push hl
 	ld a, BATTLE_VARS_MOVE_TYPE
-	call _GetBattleVar
+	call GetBattleVarAddr
 	push af
 	push hl
 	ld a, d
@@ -4813,15 +4768,15 @@
 	pop hl
 	ld a, [$d265]
 	cp $a
-	jr nc, .asm_35a13 ; 35a3c $d5
+	jr nc, .asm_35a13
 	call SwitchTurn
 
 	ld a, [hl]
 	ld [$d265], a
-	ld a, $29
-	call Predef
+	predef GetTypeName
 	ld hl, TransformedTypeText
 	jp StdBattleTextBox
+
 .asm_35a50
 	jp Function37354
 ; 35a53
@@ -4832,11 +4787,13 @@
 
 	call CheckSubstituteOpp
 	jr nz, .asm_35a6e
+
 	ld a, [AttackMissed]
 	and a
 	jr nz, .asm_35a6e
+
 	ld a, BATTLE_VARS_SUBSTATUS5_OPP
-	call _GetBattleVar
+	call GetBattleVarAddr
 	set SUBSTATUS_LOCK_ON, [hl]
 	call AnimateCurrentMove
 
@@ -4853,19 +4810,23 @@
 ; sketch
 
 	call Function372d8
+
 	ld a, [InLinkBattle]
 	and a
-	jr z, .asm_35a83 ; 35a7b $6
+	jr z, .asm_35a83
 	call AnimateFailedMove
 	jp PrintNothingHappened
 .asm_35a83
+
 	call CheckSubstituteOpp
 	jp nz, .asm_35b10
+
 	ld a, BATTLE_VARS_SUBSTATUS5_OPP
-	call _GetBattleVar
-	bit 3, [hl]
+	call GetBattleVarAddr
+	bit SUBSTATUS_TRANSFORMED, [hl]
 	jp nz, .asm_35b10
-	ld a, $2
+
+	ld a, PartyMon1Moves - PartyMon1
 	call UserPartyAttr
 	ld d, h
 	ld e, l
@@ -4872,7 +4833,7 @@
 	ld hl, BattleMonMoves
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_35aa5 ; 35aa0 $3
+	jr z, .asm_35aa5
 	ld hl, EnemyMonMoves
 .asm_35aa5
 	ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
@@ -4880,23 +4841,23 @@
 	ld [$d265], a
 	ld b, a
 	and a
-	jr z, .asm_35b10 ; 35aaf $5f
+	jr z, .asm_35b10
 	cp STRUGGLE
-	jr z, .asm_35b10 ; 35ab3 $5b
-	ld c, $4
+	jr z, .asm_35b10
+	ld c, NUM_MOVES
 .asm_35ab7
 	ld a, [hli]
 	cp b
-	jr z, .asm_35b10 ; 35ab9 $55
+	jr z, .asm_35b10
 	dec c
-	jr nz, .asm_35ab7 ; 35abc $f9
+	jr nz, .asm_35ab7
 	dec hl
-	ld c, $4
+	ld c, NUM_MOVES
 .asm_35ac1
 	dec c
 	ld a, [hld]
 	cp SKETCH
-	jr nz, .asm_35ac1 ; 35ac5 $fa
+	jr nz, .asm_35ac1
 	inc hl
 	ld a, b
 	ld [hl], a
@@ -4903,23 +4864,23 @@
 	push bc
 	push hl
 	dec a
-	ld hl, Moves + PlayerMovePP - PlayerMoveStruct
+	ld hl, Moves + MOVE_PP
 	call GetMoveAttr
 	pop hl
-	ld bc, $0006
+	ld bc, BattleMonPP - BattleMonMoves
 	add hl, bc
 	ld [hl], a
 	pop bc
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_35af6 ; 35add $17
+	jr z, .asm_35af6
 	ld a, [IsInBattle]
 	dec a
-	jr nz, .asm_35af6 ; 35ae3 $11
+	jr nz, .asm_35af6
 	ld a, [hl]
 	push bc
 	ld hl, $c739
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld [hl], a
 	ld hl, $c735
@@ -4926,12 +4887,12 @@
 	add hl, bc
 	pop bc
 	ld [hl], b
-	jr .asm_35b04 ; 35af4 $e
+	jr .asm_35b04
 .asm_35af6
 	ld a, [hl]
 	push af
 	ld l, c
-	ld h, $0
+	ld h, 0
 	add hl, de
 	ld a, b
 	ld [hl], a
@@ -4954,24 +4915,22 @@
 
 BattleCommand47: ; 35b16
 ; defrostopponent
+; Thaw the opponent if frozen, and
+; raise the user's Attack one stage.
 
-; If the opponent isn't frozen, raise Attack one stage.
-; If the opponent is frozen, thaw them and raise Accuracy two stages.
-
 	call AnimateCurrentMove
 
 	ld a, BATTLE_VARS_STATUS_OPP
-	call _GetBattleVar
+	call GetBattleVarAddr
 	call Defrost
 
-; Sharply raise accuracy
 	ld a, BATTLE_VARS_MOVE_EFFECT
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld a, [hl]
 	push hl
 	push af
 
-	ld a, $a ; meditate, sharpen
+	ld a, EFFECT_ATTACK_UP
 	ld [hl], a
 	call BattleCommand1c
 
@@ -4988,54 +4947,54 @@
 	call Function372d8
 	ld a, [AttackMissed]
 	and a
-	jr nz, .asm_35ba3 ; 35b3a $67
+	jr nz, .asm_35ba3
 	ld a, [hBattleTurn]
 	and a
-	ld hl, BattleMonMove2
+	ld hl, BattleMonMoves + 1
 	ld a, [DisabledMove]
 	ld d, a
-	jr z, .asm_35b4f ; 35b46 $7
-	ld hl, EnemyMonMove2
+	jr z, .asm_35b4f
+	ld hl, EnemyMonMoves + 1
 	ld a, [EnemyDisabledMove]
 	ld d, a
 .asm_35b4f
 	ld a, BATTLE_VARS_STATUS
 	call GetBattleVar
-	and $7
-	jr z, .asm_35ba3 ; 35b56 $4b
+	and SLP
+	jr z, .asm_35ba3
 	ld a, [hl]
 	and a
-	jr z, .asm_35ba3 ; 35b5a $47
+	jr z, .asm_35ba3
 	call .asm_35ba9
-	jr c, .asm_35ba3 ; 35b5f $42
+	jr c, .asm_35ba3
 	dec hl
 .asm_35b62
 	push hl
 	call BattleRandom
-	and $3
+	and 3 ; TODO factor in NUM_MOVES
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [hl]
 	pop hl
 	and a
-	jr z, .asm_35b62 ; 35b6f $f1
+	jr z, .asm_35b62
 	ld e, a
 	ld a, BATTLE_VARS_MOVE_ANIM
 	call GetBattleVar
 	cp e
-	jr z, .asm_35b62 ; 35b78 $e8
+	jr z, .asm_35b62
 	ld a, e
 	cp d
-	jr z, .asm_35b62 ; 35b7c $e4
+	jr z, .asm_35b62
 	call .asm_35bdf
-	jr z, .asm_35b62 ; 35b81 $df
+	jr z, .asm_35b62
 	ld a, BATTLE_VARS_MOVE
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld a, e
 	ld [hl], a
 	call Function34548
-	jr nz, .asm_35b9a ; 35b8d $b
+	jr nz, .asm_35b9a
 	ld a, [$c689]
 	push af
 	call BattleCommand0a
@@ -5068,11 +5027,11 @@
 	ld a, [EnemyDisabledMove]
 .asm_35bbe
 	ld b, a
-	ld a, $10
+	ld a, BATTLE_VARS_MOVE
 	call GetBattleVar
 	ld c, a
 	dec hl
-	ld d, $4
+	ld d, NUM_MOVES
 .asm_35bc8
 	ld a, [hl]
 	and a
@@ -5112,17 +5071,17 @@
 	pop de
 	pop hl
 
-	cp $91
+	cp EFFECT_SKULL_BASH
 	ret z
-	cp $27
+	cp EFFECT_RAZOR_WIND
 	ret z
-	cp $4b
+	cp EFFECT_SKY_ATTACK
 	ret z
-	cp $97
+	cp EFFECT_SOLARBEAM
 	ret z
-	cp $9b
+	cp EFFECT_FLY
 	ret z
-	cp $1a
+	cp EFFECT_BIDE
 	ret
 ; 35bff
 
@@ -5131,8 +5090,8 @@
 ; destinybond
 
 	ld a, BATTLE_VARS_SUBSTATUS5
-	call _GetBattleVar
-	set 6, [hl]
+	call GetBattleVarAddr
+	set SUBSTATUS_DESTINY_BOND, [hl]
 	call AnimateCurrentMove
 	ld hl, DestinyBondEffectText
 	jp StdBattleTextBox
@@ -5145,40 +5104,40 @@
 	ld a, [AttackMissed]
 	and a
 	jp nz, .asm_35c91
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1 ; ????
 	ld hl, EnemyMonMoves
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_35c24 ; 35c1f $3
+	jr z, .asm_35c24
 	ld hl, BattleMonMoves
 .asm_35c24
 	ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
 	call GetBattleVar
 	and a
-	jr z, .asm_35c91 ; 35c2a $65
-	cp $a5
-	jr z, .asm_35c91 ; 35c2e $61
+	jr z, .asm_35c91
+	cp STRUGGLE
+	jr z, .asm_35c91
 	ld b, a
-	ld c, $ff
+	ld c, -1
 .asm_35c33
 	inc c
 	ld a, [hli]
 	cp b
-	jr nz, .asm_35c33 ; 35c36 $fb
+	jr nz, .asm_35c33
 	ld [$d265], a
 	dec hl
-	ld b, $0
+	ld b, 0
 	push bc
-	ld c, $6
+	ld c, BattleMonPP - BattleMonMoves
 	add hl, bc
 	pop bc
 	ld a, [hl]
 	and $3f
-	jr z, .asm_35c91 ; 35c46 $49
+	jr z, .asm_35c91
 	push bc
 	call GetMoveName
 	call BattleRandom
-	and $3
+	and 3
 	inc a
 	inc a
 	ld b, a
@@ -5185,7 +5144,7 @@
 	ld a, [hl]
 	and $3f
 	cp b
-	jr nc, .asm_35c5b ; 35c58 $1
+	jr nc, .asm_35c5b
 	ld b, a
 .asm_35c5b
 	ld a, [hl]
@@ -5192,7 +5151,7 @@
 	sub b
 	ld [hl], a
 	push af
-	ld a, $17
+	ld a, PartyMon1PP - PartyMon1
 	call OpponentPartyAttr
 	ld d, b
 	pop af
@@ -5201,14 +5160,14 @@
 	ld e, a
 	ld a, BATTLE_VARS_SUBSTATUS5_OPP
 	call GetBattleVar
-	bit 3, a
-	jr nz, .asm_35c82 ; 35c70 $10
+	bit SUBSTATUS_TRANSFORMED, a
+	jr nz, .asm_35c82
 	ld a, [hBattleTurn]
 	and a
-	jr nz, .asm_35c81 ; 35c75 $a
+	jr nz, .asm_35c81
 	ld a, [IsInBattle]
 	dec a
-	jr nz, .asm_35c81 ; 35c7b $4
+	jr nz, .asm_35c81
 	ld hl, $c739
 	add hl, bc
 .asm_35c81
@@ -5229,10 +5188,10 @@
 BattleCommand4b: ; 35c94
 ; falseswipe
 
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_35c9f ; 35c9a $3
+	jr z, .asm_35c9f
 	ld hl, BattleMonHP
 .asm_35c9f
 	ld de, CurDamage
@@ -5242,7 +5201,7 @@
 	call StringCmp
 	pop de
 	pop hl
-	jr c, .asm_35cc7 ; 35cab $1a
+	jr c, .asm_35cc7
 	ld a, [hli]
 	ld [de], a
 	inc de
@@ -5250,7 +5209,7 @@
 	dec a
 	ld [de], a
 	inc a
-	jr nz, .asm_35cba ; 35cb4 $4
+	jr nz, .asm_35cba
 	dec de
 	ld a, [de]
 	dec a
@@ -5258,7 +5217,7 @@
 .asm_35cba
 	ld a, [CriticalHit]
 	cp $2
-	jr nz, .asm_35cc5 ; 35cbf $4
+	jr nz, .asm_35cc5
 	xor a
 	ld [CriticalHit], a
 .asm_35cc5
@@ -5274,22 +5233,22 @@
 ; healbell
 
 	ld a, BATTLE_VARS_SUBSTATUS1
-	call _GetBattleVar
-	res 0, [hl]
+	call GetBattleVarAddr
+	res SUBSTATUS_NIGHTMARE, [hl]
 	ld de, PartyMon1Status
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_35cdb ; 35cd6 $3
+	jr z, .asm_35cdb
 	ld de, OTPartyMon1Status
 .asm_35cdb
 	ld a, BATTLE_VARS_STATUS
-	call _GetBattleVar
+	call GetBattleVarAddr
 	xor a
 	ld [hl], a
 	ld h, d
 	ld l, e
-	ld bc, $30
-	ld d, $6
+	ld bc, PartyMon2 - PartyMon1
+	ld d, PartyEnd - PartySpecies
 .asm_35ce9
 	ld [hl], a
 	add hl, bc
@@ -5310,10 +5269,9 @@
 FarPlayBattleAnimation: ; 35d00
 ; play animation de
 
-; battle animations disabled?
 	ld a, BATTLE_VARS_SUBSTATUS3
 	call GetBattleVar
-	and $60 ; bit 6 | 5
+	and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
 	ret nz
 
 	; fallthrough
@@ -5347,21 +5305,21 @@
 	jr nz, .asm_35d31
 
 	ld a, [EnemySubStatus4]
-	bit 4, a
+	bit SUBSTATUS_SUBSTITUTE, a
 	jp nz, Function35de0
 .asm_35d31
 	ld a, [hld]
 	ld b, a
-	ld a, [EnemyMonHPLo]
+	ld a, [EnemyMonHP + 1]
 	ld [$d1ec], a
 	sub b
-	ld [EnemyMonHPLo], a
+	ld [EnemyMonHP + 1], a
 	ld a, [hl]
 	ld b, a
-	ld a, [EnemyMonHPHi]
-	ld [$d1ed], a
+	ld a, [EnemyMonHP]
+	ld [$d1ec + 1], a
 	sbc b
-	ld [EnemyMonHPHi], a
+	ld [EnemyMonHP], a
 	jr nc, .asm_35d59
 
 	ld a, [$d1ed]
@@ -5368,17 +5326,19 @@
 	ld [hli], a
 	ld a, [$d1ec]
 	ld [hl], a
+
 	xor a
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld [hli], a
 	ld [hl], a
+
 .asm_35d59
-	ld hl, EnemyMonMaxHPHi
+	ld hl, EnemyMonMaxHP
 	ld a, [hli]
 	ld [$d1eb], a
 	ld a, [hl]
 	ld [$d1ea], a
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld a, [hli]
 	ld [$d1ef], a
 	ld a, [hl]
@@ -5386,8 +5346,7 @@
 	hlcoord 2, 2
 	xor a
 	ld [$d10a], a
-	ld a, $b
-	call Predef
+	predef Functionc6e0
 .asm_35d7b
 	jp RefreshBattleHuds
 ; 35d7e
@@ -5406,29 +5365,30 @@
 	jr nz, .asm_35d93
 
 	ld a, [PlayerSubStatus4]
-	bit 4, a
+	bit SUBSTATUS_SUBSTITUTE, a
 	jp nz, Function35de0
 .asm_35d93
 	ld a, [hld]
 	ld b, a
-	ld a, [$c63d]
+	ld a, [BattleMonHP + 1]
 	ld [$d1ec], a
 	sub b
-	ld [$c63d], a
+	ld [BattleMonHP + 1], a
 	ld [$d1ee], a
 	ld b, [hl]
 	ld a, [BattleMonHP]
-	ld [$d1ed], a
+	ld [$d1ec + 1], a
 	sbc b
 	ld [BattleMonHP], a
-	ld [$d1ef], a
+	ld [$d1ee + 1], a
 	jr nc, .asm_35dc5
 
-	ld a, [$d1ed]
+	ld a, [$d1ec + 1]
 	ld [hli], a
 	ld a, [$d1ec]
 	ld [hl], a
 	xor a
+
 	ld hl, BattleMonHP
 	ld [hli], a
 	ld [hl], a
@@ -5435,6 +5395,7 @@
 	ld hl, $d1ee
 	ld [hli], a
 	ld [hl], a
+
 .asm_35dc5
 	ld hl, BattleMonMaxHP
 	ld a, [hli]
@@ -5444,8 +5405,7 @@
 	hlcoord 10, 9
 	ld a, $1
 	ld [$d10a], a
-	ld a, $b
-	call Predef
+	predef Functionc6e0
 .asm_35ddd
 	jp RefreshBattleHuds
 ; 35de0
@@ -5456,29 +5416,28 @@
 	ld hl, SubTookDamageText
 	call StdBattleTextBox
 
-	ld de, $c6e0
+	ld de, EnemySubstituteHP
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_35df1
+	jr z, .got_hp
+	ld de, PlayerSubstituteHP
+.got_hp
 
-	ld de, $c6df
-.asm_35df1
 	ld hl, CurDamage
 	ld a, [hli]
 	and a
-	jr nz, .asm_35dff
+	jr nz, .broke
 
 	ld a, [de]
 	sub [hl]
 	ld [de], a
-	jr z, .asm_35dff
+	jr z, .broke
+	jr nc, .done
 
-	jr nc, .asm_35e3d
-
-.asm_35dff
+.broke
 	ld a, BATTLE_VARS_SUBSTATUS4_OPP
-	call _GetBattleVar
-	res 4, [hl]
+	call GetBattleVarAddr
+	res SUBSTATUS_SUBSTITUTE, [hl]
 
 	ld hl, SubFadedText
 	call StdBattleTextBox
@@ -5487,28 +5446,27 @@
 	call BattleCommanda7
 	ld a, BATTLE_VARS_SUBSTATUS3
 	call GetBattleVar
-	and $60 ; fly | dig
+	and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
 	call z, Function37ec7
 	call SwitchTurn
 
 	ld a, BATTLE_VARS_MOVE_EFFECT
-	call _GetBattleVar
+	call GetBattleVarAddr
 	cp EFFECT_MULTI_HIT
-	jr z, .asm_35e3a
+	jr z, .ok
 	cp EFFECT_DOUBLE_HIT
-	jr z, .asm_35e3a
+	jr z, .ok
 	cp EFFECT_TWINEEDLE
-	jr z, .asm_35e3a
+	jr z, .ok
 	cp EFFECT_TRIPLE_KICK
-	jr z, .asm_35e3a
+	jr z, .ok
 	cp EFFECT_BEAT_UP
-	jr z, .asm_35e3a
-
+	jr z, .ok
 	xor a
 	ld [hl], a
-.asm_35e3a
+.ok
 	call RefreshBattleHuds
-.asm_35e3d
+.done
 	jp ResetDamage
 ; 35e40
 
@@ -5516,7 +5474,7 @@
 UpdateMoveData: ; 35e40
 
 	ld a, BATTLE_VARS_MOVE_ANIM
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld d, h
 	ld e, l
 
@@ -5537,8 +5495,9 @@
 
 	call GetOpponentItem
 	ld a, b
-	cp $17
-	jr nz, .asm_35e70 ; 35e62 $c
+	cp HELD_PREVENT_SLEEP
+	jr nz, .asm_35e70
+
 	ld a, [hl]
 	ld [$d265], a
 	call GetItemName
@@ -5547,11 +5506,11 @@
 
 .asm_35e70
 	ld a, BATTLE_VARS_STATUS_OPP
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld d, h
 	ld e, l
 	ld a, [de]
-	and 7
+	and SLP
 	ld hl, AlreadyAsleepText
 	jr nz, .asm_35ec6
 
@@ -5605,24 +5564,23 @@
 
 
 Function35ece: ; 35ece
-; Enemy turn
+	; Enemy turn
 	ld a, [hBattleTurn]
 	and a
 	jr z, .asm_35eec
 
-; Not in link battle
+	; Not in link battle
 	ld a, [InLinkBattle]
 	and a
 	jr nz, .asm_35eec
 
-
 	ld a, [$cfc0]
 	and a
 	jr nz, .asm_35eec
 
-; Not locked-on by the enemy
+	; Not locked-on by the enemy
 	ld a, [PlayerSubStatus5]
-	bit 5, a
+	bit SUBSTATUS_LOCK_ON, a
 	jr nz, .asm_35eec
 
 	call BattleRandom
@@ -5641,7 +5599,7 @@
 	call CheckSubstituteOpp
 	ret nz
 	ld a, BATTLE_VARS_STATUS_OPP
-	call _GetBattleVar
+	call GetBattleVarAddr
 	and a
 	ret nz
 	ld a, [TypeModifier]
@@ -5651,7 +5609,7 @@
 	ret z
 	call GetOpponentItem
 	ld a, b
-	cp $14
+	cp HELD_PREVENT_POISON
 	ret z
 	ld a, [EffectFailed]
 	and a
@@ -5659,7 +5617,7 @@
 	call Function37962
 	ret nz
 	call Function35ff5
-	ld de, $0106
+	ld de, ANIM_PSN
 	call Function37e54
 	call RefreshBattleHuds
 
@@ -5678,60 +5636,65 @@
 	ld a, [TypeModifier]
 	and $7f
 	jp z, .asm_35fb8
+
 	call Function35fe1
 	jp z, .asm_35fb8
+
 	ld a, BATTLE_VARS_STATUS_OPP
 	call GetBattleVar
 	ld b, a
 	ld hl, AlreadyPoisonedText
-	and $8
+	and 1 << PSN
 	jp nz, .asm_35fb8
+
 	call GetOpponentItem
 	ld a, b
-	cp $14
-	jr nz, .asm_35f5f ; 35f51 $c
+	cp HELD_PREVENT_POISON
+	jr nz, .asm_35f5f
 	ld a, [hl]
 	ld [$d265], a
 	call GetItemName
 	ld hl, ProtectedByText
-	jr .asm_35fb8 ; 35f5d $59
+	jr .asm_35fb8
+
 .asm_35f5f
 	ld hl, DidntAffect1Text
 	ld a, BATTLE_VARS_STATUS_OPP
 	call GetBattleVar
 	and a
-	jr nz, .asm_35fb8 ; 35f68 $4e
+	jr nz, .asm_35fb8
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_35f89 ; 35f6d $1a
+	jr z, .asm_35f89
 	ld a, [InLinkBattle]
 	and a
-	jr nz, .asm_35f89 ; 35f73 $14
+	jr nz, .asm_35f89
 	ld a, [$cfc0]
 	and a
-	jr nz, .asm_35f89 ; 35f79 $e
+	jr nz, .asm_35f89
 	ld a, [PlayerSubStatus5]
-	bit 5, a
-	jr nz, .asm_35f89 ; 35f80 $7
+	bit SUBSTATUS_LOCK_ON, a
+	jr nz, .asm_35f89
 	call BattleRandom
 	cp $40
-	jr c, .asm_35fb8 ; 35f87 $2f
+	jr c, .asm_35fb8
+
 .asm_35f89
 	call CheckSubstituteOpp
-	jr nz, .asm_35fb8 ; 35f8c $2a
+	jr nz, .asm_35fb8
 	ld a, [AttackMissed]
 	and a
-	jr nz, .asm_35fb8 ; 35f92 $24
+	jr nz, .asm_35fb8
 	call Function35fc9
-	jr z, .asm_35fa4 ; 35f97 $b
-	call Function35fc0
+	jr z, .asm_35fa4
 
+	call Function35fc0
 	ld hl, WasPoisonedText
 	call StdBattleTextBox
+	jr .asm_35fb1
 
-	jr .asm_35fb1 ; 35fa2 $d
 .asm_35fa4
-	set 0, [hl]
+	set SUBSTATUS_TOXIC, [hl]
 	xor a
 	ld [de], a
 	call Function35fc0
@@ -5760,13 +5723,13 @@
 
 Function35fc9: ; 35fc9
 	ld a, BATTLE_VARS_SUBSTATUS5_OPP
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld a, [hBattleTurn]
 	and a
-	ld de, $c67c
-	jr z, .asm_35fd9
-	ld de, $c674
-.asm_35fd9
+	ld de, EnemyToxicCount
+	jr z, .ok
+	ld de, PlayerToxicCount
+.ok
 	ld a, BATTLE_VARS_MOVE_EFFECT
 	call GetBattleVar
 	cp EFFECT_TOXIC
@@ -5778,9 +5741,9 @@
 	ld de, EnemyMonType1
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_35fec
+	jr z, .ok
 	ld de, BattleMonType1
-.asm_35fec
+.ok
 	ld a, [de]
 	inc de
 	cp POISON
@@ -5793,7 +5756,7 @@
 
 Function35ff5: ; 35ff5
 	ld a, BATTLE_VARS_STATUS_OPP
-	call _GetBattleVar
+	call GetBattleVarAddr
 	set PSN, [hl]
 	jp UpdateOpponentInParty
 ; 35fff
@@ -5834,8 +5797,8 @@
 	ld a, [hBattleTurn]
 	and a
 	jr z, .asm_36037 ; 0x3602f $6
-	ld hl, EnemyMonHPHi
-	ld de, EnemyMonMaxHPHi
+	ld hl, EnemyMonHP
+	ld de, EnemyMonMaxHP
 .asm_36037
 	ld bc, $d1ed
 	ld a, [hli]
@@ -5891,8 +5854,7 @@
 	xor a
 .asm_3607e
 	ld [$d10a], a
-	ld a, $b
-	call Predef
+	predef Functionc6e0
 	call RefreshBattleHuds
 	jp UpdateBattleMonInParty
 ; 3608c
@@ -5906,7 +5868,7 @@
 	call CheckSubstituteOpp
 	ret nz
 	ld a, BATTLE_VARS_STATUS_OPP
-	call _GetBattleVar
+	call GetBattleVarAddr
 	and a
 	jp nz, Defrost
 	ld a, [TypeModifier]
@@ -5916,7 +5878,7 @@
 	ret z
 	call GetOpponentItem
 	ld a, b
-	cp $15
+	cp HELD_PREVENT_BURN
 	ret z
 	ld a, [EffectFailed]
 	and a
@@ -5924,12 +5886,12 @@
 	call Function37962
 	ret nz
 	ld a, BATTLE_VARS_STATUS_OPP
-	call _GetBattleVar
-	set 4, [hl]
+	call GetBattleVarAddr
+	set BRN, [hl]
 	call UpdateOpponentInParty
 	ld hl, Function3ec76
 	call CallBattleCore
-	ld de, $0105
+	ld de, ANIM_BRN
 	call Function37e54
 	call RefreshBattleHuds
 
@@ -5943,7 +5905,7 @@
 
 Defrost: ; 360dd
 	ld a, [hl]
-	and $20
+	and 1 << FRZ
 	ret z
 
 	xor a
@@ -5976,7 +5938,7 @@
 	call CheckSubstituteOpp
 	ret nz
 	ld a, BATTLE_VARS_STATUS_OPP
-	call _GetBattleVar
+	call GetBattleVarAddr
 	and a
 	ret nz
 	ld a, [TypeModifier]
@@ -5983,13 +5945,13 @@
 	and $7f
 	ret z
 	ld a, [Weather]
-	cp $2
+	cp WEATHER_SUN
 	ret z
 	call Function36e5b
 	ret z
 	call GetOpponentItem
 	ld a, b
-	cp $16
+	cp HELD_PREVENT_FREEZE
 	ret z
 	ld a, [EffectFailed]
 	and a
@@ -5997,10 +5959,10 @@
 	call Function37962
 	ret nz
 	ld a, BATTLE_VARS_STATUS_OPP
-	call _GetBattleVar
-	set 5, [hl]
+	call GetBattleVarAddr
+	set FRZ, [hl]
 	call UpdateOpponentInParty
-	ld de, $0108
+	ld de, ANIM_FRZ
 	call Function37e54
 	call RefreshBattleHuds
 
@@ -6014,7 +5976,7 @@
 	ld hl, $c740
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_36162 ; 3615d $3
+	jr z, .asm_36162
 	ld hl, $c73f
 .asm_36162
 	ld [hl], $1
@@ -6030,7 +5992,7 @@
 	call CheckSubstituteOpp
 	ret nz
 	ld a, BATTLE_VARS_STATUS_OPP
-	call _GetBattleVar
+	call GetBattleVarAddr
 	and a
 	ret nz
 	ld a, [TypeModifier]
@@ -6038,7 +6000,7 @@
 	ret z
 	call GetOpponentItem
 	ld a, b
-	cp $18
+	cp HELD_PREVENT_PARALYZE
 	ret z
 	ld a, [EffectFailed]
 	and a
@@ -6046,12 +6008,12 @@
 	call Function37962
 	ret nz
 	ld a, BATTLE_VARS_STATUS_OPP
-	call _GetBattleVar
-	set 6, [hl]
+	call GetBattleVarAddr
+	set PAR, [hl]
 	call UpdateOpponentInParty
 	ld hl, Function3ec39
 	call CallBattleCore
-	ld de, $0109
+	ld de, ANIM_PAR
 	call Function37e54
 	call RefreshBattleHuds
 	call PrintParalyze
@@ -6144,7 +6106,7 @@
 	ld a, [LoweredStat]
 	and $f
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld b, [hl]
 	inc b
@@ -6175,7 +6137,7 @@
 .asm_36243
 	push bc
 	sla c
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, c
 	add e
@@ -6185,10 +6147,10 @@
 .asm_3624f
 	pop bc
 	ld a, [hld]
-	sub $e7
+	sub 999 % $100
 	jr nz, .asm_3625b ; 0x36253 $6
 	ld a, [hl]
-	sbc $3
+	sbc 999 / $100
 	jp z, Function3626e
 .asm_3625b
 	ld a, [hBattleTurn]
@@ -6393,12 +6355,12 @@
 	jr nc, .Hit
 
 	push hl
-	ld hl, EnemyMonAtk + 1
+	ld hl, EnemyMonAttack + 1
 	ld de, EnemyStats
 	ld a, [hBattleTurn]
 	and a
 	jr z, .asm_36366
-	ld hl, BattleMonAtk + 1
+	ld hl, BattleMonAttack + 1
 	ld de, PlayerStats
 .asm_36366
 	call Function3641a
@@ -6800,8 +6762,8 @@
 BattleCommandaf: ; 365a7
 ; curl
 	ld a, BATTLE_VARS_SUBSTATUS2
-	call _GetBattleVar
-	set 0, [hl]
+	call GetBattleVarAddr
+	set SUBSTATUS_CURLED, [hl]
 	ret
 ; 365af
 
@@ -6837,7 +6799,7 @@
 Function365d7: ; 365d7
 	ld hl, PlayerAtkLevel
 	ld de, PlayerStats
-	ld bc, BattleMonAtk
+	ld bc, BattleMonAttack
 
 	ld a, $5
 	call Function3661d
@@ -6860,7 +6822,7 @@
 Function365fd: ; 365fd
 	ld hl, EnemyAtkLevel
 	ld de, EnemyStats
-	ld bc, EnemyMonAtk
+	ld bc, EnemyMonAttack
 
 	ld a, $5
 	call Function3661d
@@ -6964,7 +6926,7 @@
 	dec [hl]
 	jr nz, .asm_366dc
 	ld a, BATTLE_VARS_SUBSTATUS3
-	call _GetBattleVar
+	call GetBattleVarAddr
 	res 0, [hl]
 
 	ld hl, UnleashedEnergyText
@@ -6971,7 +6933,7 @@
 	call StdBattleTextBox
 
 	ld a, BATTLE_VARS_MOVE_POWER
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld a, 1
 	ld [hl], a
 	ld hl, PlayerDamageTaken + 1
@@ -7005,7 +6967,7 @@
 	ld [de], a
 
 	ld a, BATTLE_VARS_MOVE_ANIM
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld a, BIDE
 	ld [hl], a
 
@@ -7031,14 +6993,14 @@
 	ld bc, EnemyRolloutCount
 .asm_366f6
 	ld a, BATTLE_VARS_SUBSTATUS3
-	call _GetBattleVar
+	call GetBattleVarAddr
 	set 0, [hl]
 	xor a
 	ld [de], a
 	inc de
 	ld [de], a
-	ld [PlayerMoveEffect], a
-	ld [EnemyMoveEffect], a
+	ld [wPlayerMoveStruct + MOVE_EFFECT], a
+	ld [wEnemyMoveStruct + MOVE_EFFECT], a
 	call BattleRandom
 	and $1
 	inc a
@@ -7061,7 +7023,7 @@
 	ld de, EnemyRolloutCount
 .asm_36725
 	ld a, BATTLE_VARS_SUBSTATUS3
-	call _GetBattleVar
+	call GetBattleVarAddr
 	bit 1, [hl]
 	ret z
 	ld a, [de]
@@ -7094,20 +7056,20 @@
 ; No rampage during Sleep Talk.
 	ld a, BATTLE_VARS_STATUS
 	call GetBattleVar
-	and 7
+	and SLP
 	ret nz
 
 	ld de, PlayerRolloutCount
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_36764 ; 3675f $3
+	jr z, .ok
 	ld de, EnemyRolloutCount
-.asm_36764
+.ok
 	ld a, BATTLE_VARS_SUBSTATUS3
-	call _GetBattleVar
-	set 1, [hl]
+	call GetBattleVarAddr
+	set SUBSTATUS_RAMPAGE, [hl]
 	call BattleRandom
-	and $1
+	and 1
 	inc a
 	ld [de], a
 	ld a, 1
@@ -7121,24 +7083,24 @@
 
 	ld a, [BattleType]
 	cp BATTLETYPE_SHINY
-	jr z, .asm_367b9
-	cp $9
-	jr z, .asm_367b9
-	cp $b
-	jr z, .asm_367b9
+	jr z, .failed
+	cp BATTLETYPE_TRAP
+	jr z, .failed
+	cp BATTLETYPE_CELEBI
+	jr z, .failed
 	cp BATTLETYPE_SUICUNE
-	jr z, .asm_367b9
+	jr z, .failed
 
 	ld a, BATTLE_VARS_SUBSTATUS5_OPP
 	call GetBattleVar
 	bit SUBSTATUS_CANT_RUN, a
-	jr nz, .asm_367b9
+	jr nz, .failed
 	ld a, [hBattleTurn]
 	and a
 	jr nz, .asm_367bf
 	ld a, [IsInBattle]
 	dec a
-	jr nz, .asm_367b9
+	jr nz, .failed
 	ld a, [$d143]
 	ld b, a
 	ld a, [BattleMonLevel]
@@ -7156,7 +7118,7 @@
 	cp b
 	jr nc, .asm_367df ; 367b7 $26
 
-.asm_367b9
+.failed
 	call AnimateFailedMove
 	jp PrintButItFailed
 
@@ -7163,7 +7125,7 @@
 .asm_367bf
 	ld a, [IsInBattle]
 	dec a
-	jr nz, .asm_367b9 ; 367c3 $f4
+	jr nz, .failed
 	ld a, [BattleMonLevel]
 	ld b, a
 	ld a, [$d143]
@@ -7216,7 +7178,7 @@
 	jp z, .asm_36969
 	cp $9
 	jp z, .asm_36969
-	cp $b
+	cp BATTLETYPE_CELEBI
 	jp z, .asm_36969
 	cp BATTLETYPE_SUICUNE
 	jp z, .asm_36969
@@ -7254,7 +7216,7 @@
 	inc a
 	ld [$d232], a
 	call Function36804
-	ld a, [PlayerMoveAnimation]
+	ld a, [wPlayerMoveStruct + MOVE_ANIM]
 	jp .asm_36975
 .asm_36869
 	call Function349f4
@@ -7345,7 +7307,7 @@
 	inc a
 	ld [$d232], a
 	call Function36804
-	ld a, [EnemyMoveAnimation]
+	ld a, [wEnemyMoveStruct + MOVE_ANIM]
 	jr .asm_36975
 
 .asm_36908
@@ -7430,7 +7392,7 @@
 	ld a, [PartyCount]
 	ld d, a
 	ld e, 0
-	ld bc, $30
+	ld bc, PartyMon2 - PartyMon1
 .asm_3699d
 	ld a, [CurBattleMon]
 	cp e
@@ -7472,12 +7434,12 @@
 .asm_369c7
 
 	ld a, BATTLE_VARS_SUBSTATUS3
-	call _GetBattleVar
-	bit 2, [hl]
+	call GetBattleVarAddr
+	bit SUBSTATUS_IN_LOOP, [hl]
 	jp nz, .asm_36a43
-	set 2, [hl]
+	set SUBSTATUS_IN_LOOP, [hl]
 	ld a, BATTLE_VARS_MOVE_EFFECT
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld a, [hl]
 	cp EFFECT_TWINEEDLE
 	jr z, .asm_36a3f
@@ -7519,8 +7481,8 @@
 
 .asm_36a1e
 	ld a, BATTLE_VARS_SUBSTATUS3
-	call _GetBattleVar
-	res 2, [hl]
+	call GetBattleVarAddr
+	res SUBSTATUS_IN_LOOP, [hl]
 	call BattleCommanda8
 	jp EndMoveEffect
 .asm_36a2b
@@ -7527,7 +7489,7 @@
 	call BattleRandom
 	and $3
 	cp $2
-	jr c, .asm_36a39 ; 36a32 $5
+	jr c, .asm_36a39
 	call BattleRandom
 	and $3
 .asm_36a39
@@ -7536,20 +7498,20 @@
 	ld [de], a
 	inc a
 	ld [bc], a
-	jr .asm_36a6b ; 36a3d $2c
+	jr .asm_36a6b
 .asm_36a3f
 	ld a, $1
-	jr .asm_36a3a ; 36a41 $f7
+	jr .asm_36a3a
 
 .asm_36a43
 	ld a, [de]
 	dec a
 	ld [de], a
-	jr nz, .asm_36a6b ; 36a46 $23
+	jr nz, .asm_36a6b
 .asm_36a48
 	ld a, BATTLE_VARS_SUBSTATUS3
-	call _GetBattleVar
-	res 2, [hl]
+	call GetBattleVarAddr
+	res SUBSTATUS_IN_LOOP, [hl]
 
 	ld hl, PlayerHitTimesText
 	ld a, [hBattleTurn]
@@ -7580,7 +7542,7 @@
 .asm_36a73
 	ld a, [hld]
 	cp $5 ; critical
-	jr nz, .asm_36a73 ; 36a76 $fb
+	jr nz, .asm_36a73
 	inc hl
 	ld a, h
 	ld [BattleScriptBufferLoc + 1], a
@@ -7594,14 +7556,18 @@
 	ld a, [AttackMissed]
 	and a
 	ret nz
+
 	call CheckSubstituteOpp
-	jr nz, .asm_36a9a ; 36a8a $e
+	jr nz, .asm_36a9a
+
 	ld a, BATTLE_VARS_STATUS_OPP
 	call GetBattleVar
-	and $27
-	jr nz, .asm_36a9a ; 36a93 $5
+	and 1 << FRZ | SLP
+	jr nz, .asm_36a9a
+
 	call Function36abf
-	jr z, Function36ab5 ; 36a98 $1b
+	jr z, Function36ab5
+
 .asm_36a9a
 	ld a, 1
 	ld [AttackMissed], a
@@ -7612,12 +7578,15 @@
 BattleCommand25: ; 36aa0
 	call CheckSubstituteOpp
 	ret nz
+
 	ld a, BATTLE_VARS_STATUS_OPP
 	call GetBattleVar
-	and $27
+	and 1 << FRZ | SLP
 	ret nz
+
 	call Function36abf
 	ret nz
+
 	ld a, [EffectFailed]
 	and a
 	ret nz
@@ -7628,8 +7597,8 @@
 
 Function36ab5: ; 36ab5
 	ld a, BATTLE_VARS_SUBSTATUS3_OPP
-	call _GetBattleVar
-	set 3, [hl]
+	call GetBattleVarAddr
+	set SUBSTATUS_FLINCHED, [hl]
 	jp EndRechargeOpp
 ; 36abf
 
@@ -7654,13 +7623,13 @@
 
 	call GetUserItem
 	ld a, b
-	cp HELD_TRADE_EVOLVE ; king's rock
+	cp HELD_TRADE_EVOLVE ; Only King's Rock has this effect
 	ret nz
 
 	call CheckSubstituteOpp
 	ret nz
 	ld a, BATTLE_VARS_MOVE_EFFECT
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld d, h
 	ld e, l
 	call GetUserItem
@@ -7669,8 +7638,8 @@
 	ret nc
 	call EndRechargeOpp
 	ld a, BATTLE_VARS_SUBSTATUS3_OPP
-	call _GetBattleVar
-	set 3, [hl]
+	call GetBattleVarAddr
+	set SUBSTATUS_FLINCHED, [hl]
 	ret
 ; 36af3
 
@@ -7681,27 +7650,27 @@
 	call ResetDamage
 	ld a, [TypeModifier]
 	and $7f
-	jr z, .asm_36b2f ; 36afb $32
+	jr z, .asm_36b2f
 	ld hl, EnemyMonLevel
 	ld de, BattleMonLevel
-	ld bc, PlayerMoveAccuracy
+	ld bc, wPlayerMoveStruct + MOVE_ACC
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_36b12 ; 36b09 $7
+	jr z, .asm_36b12
 	push hl
 	ld h, d
 	ld l, e
 	pop de
-	ld bc, EnemyMoveAccuracy
+	ld bc, wEnemyMoveStruct + MOVE_ACC
 .asm_36b12
 	ld a, [de]
 	sub [hl]
-	jr c, .asm_36b2f ; 36b14 $19
+	jr c, .asm_36b2f
 	add a
 	ld e, a
 	ld a, [bc]
 	add e
-	jr nc, .asm_36b1e ; 36b1a $2
+	jr nc, .asm_36b1e
 	ld a, $ff
 .asm_36b1e
 	ld [bc], a
@@ -7725,15 +7694,13 @@
 BattleCommand3a: ; 36b3a
 ; checkcharge
 
-; charged?
 	ld a, BATTLE_VARS_SUBSTATUS3
-	call _GetBattleVar
-	bit 4, [hl]
+	call GetBattleVarAddr
+	bit SUBSTATUS_CHARGED, [hl]
 	ret z
-; go to town
-	res 4, [hl]
-	res 5, [hl]
-	res 6, [hl]
+	res SUBSTATUS_CHARGED, [hl]
+	res SUBSTATUS_UNDERGROUND, [hl]
+	res SUBSTATUS_FLYING, [hl]
 	ld b, $39 ; charge
 	jp SkipToBattleCommand
 ; 36b4d
@@ -7745,7 +7712,7 @@
 	call BattleCommand38
 	ld a, BATTLE_VARS_STATUS
 	call GetBattleVar
-	and $7
+	and SLP
 	jr z, .asm_36b65
 
 	call BattleCommandaa
@@ -7755,8 +7722,8 @@
 
 .asm_36b65
 	ld a, BATTLE_VARS_SUBSTATUS3
-	call _GetBattleVar
-	set 4, [hl]
+	call GetBattleVarAddr
+	set SUBSTATUS_CHARGED, [hl]
 
 	ld hl, IgnoredOrders2Text
 	ld a, [AlreadyDisobeyed]
@@ -7771,44 +7738,44 @@
 	call Function37e36
 	ld a, BATTLE_VARS_MOVE_ANIM
 	call GetBattleVar
-	cp $13
-	jr z, .asm_36b96 ; 36b8b $9
-	cp $5b
-	jr z, .asm_36b96 ; 36b8f $5
+	cp FLY
+	jr z, .asm_36b96
+	cp DIG
+	jr z, .asm_36b96
 	call BattleCommand0c
-	jr .asm_36b99 ; 36b94 $3
+	jr .asm_36b99
 .asm_36b96
 	call Function37ec0
 .asm_36b99
 	ld a, BATTLE_VARS_SUBSTATUS3
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld a, BATTLE_VARS_MOVE_ANIM
 	call GetBattleVar
 	ld b, a
-	cp $13
-	jr z, .asm_36bb0 ; 36ba6 $8
-	cp $5b
-	jr nz, .asm_36bb2 ; 36baa $6
-	set 5, [hl]
-	jr .asm_36bb2 ; 36bae $2
+	cp FLY
+	jr z, .asm_36bb0
+	cp DIG
+	jr nz, .asm_36bb2
+	set SUBSTATUS_UNDERGROUND, [hl]
+	jr .asm_36bb2
 
 .asm_36bb0
-	set 6, [hl]
+	set SUBSTATUS_FLYING, [hl]
 
 .asm_36bb2
 	call Function34548
-	jr nz, .asm_36bc3 ; 36bb5 $c
+	jr nz, .asm_36bc3
 	ld a, BATTLE_VARS_LAST_COUNTER_MOVE
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld [hl], b
 	ld a, BATTLE_VARS_LAST_MOVE
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld [hl], b
 
 .asm_36bc3
 	call ResetDamage
 
-	ld hl, .text_36bdb
+	ld hl, .UsedText
 	call BattleTextBox
 
 	ld a, BATTLE_VARS_MOVE_EFFECT
@@ -7818,9 +7785,8 @@
 	jp z, SkipToBattleCommand
 	jp EndMoveEffect
 
-.text_36bdb
-; [user]
-	TX_FAR UnknownText_0x1c0d0e
+.UsedText
+	TX_FAR UnknownText_0x1c0d0e ; "[USER]"
 	start_asm
 
 	ld a, BATTLE_VARS_MOVE_ANIM
@@ -7827,28 +7793,28 @@
 	call GetBattleVar
 	cp RAZOR_WIND
 	ld hl, .RazorWind
-	jr z, .asm_36c0d
+	jr z, .done
 
 	cp SOLARBEAM
 	ld hl, .Solarbeam
-	jr z, .asm_36c0d
+	jr z, .done
 
 	cp SKULL_BASH
 	ld hl, .SkullBash
-	jr z, .asm_36c0d
+	jr z, .done
 
 	cp SKY_ATTACK
 	ld hl, .SkyAttack
-	jr z, .asm_36c0d
+	jr z, .done
 
 	cp FLY
 	ld hl, .Fly
-	jr z, .asm_36c0d
+	jr z, .done
 
 	cp DIG
 	ld hl, .Dig
 
-.asm_36c0d
+.done
 	ret
 
 .RazorWind
@@ -7909,7 +7875,7 @@
 	ret nz
 	ld a, BATTLE_VARS_SUBSTATUS4_OPP
 	call GetBattleVar
-	bit 4, a
+	bit SUBSTATUS_SUBSTITUTE, a
 	ret nz
 	call BattleRandom
 	and 3
@@ -7950,10 +7916,10 @@
 ; mist
 
 	ld a, BATTLE_VARS_SUBSTATUS4
-	call _GetBattleVar
-	bit 1, [hl]
-	jr nz, .asm_36c92 ; 36c85 $b
-	set 1, [hl]
+	call GetBattleVarAddr
+	bit SUBSTATUS_MIST, [hl]
+	jr nz, .asm_36c92
+	set SUBSTATUS_MIST, [hl]
 	call AnimateCurrentMove
 	ld hl, MistText
 	jp StdBattleTextBox
@@ -7967,10 +7933,10 @@
 ; focusenergy
 
 	ld a, BATTLE_VARS_SUBSTATUS4
-	call _GetBattleVar
-	bit 2, [hl]
-	jr nz, .asm_36cac ; 36c9f $b
-	set 2, [hl]
+	call GetBattleVarAddr
+	bit SUBSTATUS_FOCUS_ENERGY, [hl]
+	jr nz, .asm_36cac
+	set SUBSTATUS_FOCUS_ENERGY, [hl]
 	call AnimateCurrentMove
 	ld hl, GettingPumpedText
 	jp StdBattleTextBox
@@ -7986,8 +7952,8 @@
 	ld hl, BattleMonMaxHP
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_36cbd ; 36cb8 $3
-	ld hl, EnemyMonMaxHPHi
+	jr z, .asm_36cbd
+	ld hl, EnemyMonMaxHP
 .asm_36cbd
 	ld a, BATTLE_VARS_MOVE_ANIM
 	call GetBattleVar
@@ -8002,7 +7968,7 @@
 	rr c
 	ld a, b
 	or c
-	jr nz, .asm_36cd8 ; 36cd5 $1
+	jr nz, .asm_36cd8
 	inc c
 .asm_36cd8
 	ld a, [hli]
@@ -8021,7 +7987,7 @@
 	sbc b
 	ld [hl], a
 	ld [$d1ef], a
-	jr nc, .asm_36cfe ; 36cf4 $8
+	jr nc, .asm_36cfe
 	xor a
 	ld [hli], a
 	ld [hl], a
@@ -8033,13 +7999,12 @@
 	ld a, [hBattleTurn]
 	and a
 	ld a, $1
-	jr z, .asm_36d0c ; 36d06 $4
+	jr z, .asm_36d0c
 	hlcoord 2, 2
 	xor a
 .asm_36d0c
 	ld [$d10a], a
-	ld a, $b
-	call Predef
+	predef Functionc6e0
 	call RefreshBattleHuds
 	ld hl, RecoilText
 	jp StdBattleTextBox
@@ -8051,7 +8016,7 @@
 
 	call GetOpponentItem
 	ld a, b
-	cp $19
+	cp HELD_PREVENT_CONFUSE
 	ret z
 	ld a, [EffectFailed]
 	and a
@@ -8061,8 +8026,8 @@
 	call CheckSubstituteOpp
 	ret nz
 	ld a, BATTLE_VARS_SUBSTATUS3_OPP
-	call _GetBattleVar
-	bit 7, [hl]
+	call GetBattleVarAddr
+	bit SUBSTATUS_CONFUSED, [hl]
 	ret nz
 	jr Function36d70
 
@@ -8072,7 +8037,7 @@
 
 	call GetOpponentItem
 	ld a, b
-	cp $19
+	cp HELD_PREVENT_CONFUSE
 	jr nz, .asm_36d53
 	ld a, [hl]
 	ld [$d265], a
@@ -8083,8 +8048,8 @@
 
 .asm_36d53
 	ld a, BATTLE_VARS_SUBSTATUS3_OPP
-	call _GetBattleVar
-	bit 7, [hl]
+	call GetBattleVarAddr
+	bit SUBSTATUS_CONFUSED, [hl]
 	jr z, .asm_36d65
 	call AnimateFailedMove
 	ld hl, AlreadyConfusedText
@@ -8109,7 +8074,7 @@
 	ld bc, PlayerConfuseCount
 
 .asm_36d7b
-	set 7, [hl]
+	set SUBSTATUS_CONFUSED, [hl]
 	call BattleRandom
 	and 3
 	inc a
@@ -8127,7 +8092,7 @@
 	call AnimateCurrentMove
 
 .asm_36d99
-	ld de, $0103
+	ld de, ANIM_CONFUSED
 	call Function37e54
 
 	ld hl, BecameConfusedText
@@ -8135,9 +8100,9 @@
 
 	call GetOpponentItem
 	ld a, b
-	cp $f
+	cp HELD_HEAL_STATUS
 	jr z, .asm_36db0
-	cp $10
+	cp HELD_HEAL_CONFUSION
 	ret nz
 .asm_36db0
 	ld hl, Function3de51
@@ -8162,15 +8127,15 @@
 
 	ld a, BATTLE_VARS_STATUS_OPP
 	call GetBattleVar
-	bit 6, a
-	jr nz, .asm_36e49 ; 36dce $79
+	bit PAR, a
+	jr nz, .asm_36e49
 	ld a, [TypeModifier]
 	and $7f
-	jr z, .asm_36e55 ; 36dd5 $7e
+	jr z, .asm_36e55
 	call GetOpponentItem
 	ld a, b
-	cp $18
-	jr nz, .asm_36def ; 36ddd $10
+	cp HELD_PREVENT_PARALYZE
+	jr nz, .asm_36def
 	ld a, [hl]
 	ld [$d265], a
 	call GetItemName
@@ -8177,40 +8142,41 @@
 	call AnimateFailedMove
 	ld hl, ProtectedByText
 	jp StdBattleTextBox
+
 .asm_36def
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_36e0e ; 36df2 $1a
+	jr z, .asm_36e0e
 	ld a, [InLinkBattle]
 	and a
-	jr nz, .asm_36e0e ; 36df8 $14
+	jr nz, .asm_36e0e
 	ld a, [$cfc0]
 	and a
-	jr nz, .asm_36e0e ; 36dfe $e
+	jr nz, .asm_36e0e
 	ld a, [PlayerSubStatus5]
-	bit 5, a
-	jr nz, .asm_36e0e ; 36e05 $7
+	bit SUBSTATUS_LOCK_ON, a
+	jr nz, .asm_36e0e
 	call BattleRandom
 	cp $40
-	jr c, .asm_36e52 ; 36e0c $44
+	jr c, .asm_36e52
 .asm_36e0e
 	ld a, BATTLE_VARS_STATUS_OPP
-	call _GetBattleVar
+	call GetBattleVarAddr
 	and a
-	jr nz, .asm_36e52 ; 36e14 $3c
+	jr nz, .asm_36e52
 	ld a, [AttackMissed]
 	and a
-	jr nz, .asm_36e52 ; 36e1a $36
+	jr nz, .asm_36e52
 	call CheckSubstituteOpp
-	jr nz, .asm_36e52 ; 36e1f $31
-	ld c, $1e
+	jr nz, .asm_36e52
+	ld c, 30
 	call DelayFrames
 	call AnimateCurrentMove
 	ld a, $1
 	ld [$ffd4], a
 	ld a, BATTLE_VARS_STATUS_OPP
-	call _GetBattleVar
-	set 6, [hl]
+	call GetBattleVarAddr
+	set PAR, [hl]
 	call UpdateOpponentInParty
 	ld hl, Function3ec39
 	call CallBattleCore
@@ -8231,8 +8197,9 @@
 
 
 Function36e5b: ; 36e5b
-; Compare move type to user type.
-; Return z if matching the user type (unless the move is Normal).
+; Compare move type to opponent type.
+; Return z if matching the opponent type,
+; unless the move is Normal (Tri Attack).
 
 	push hl
 
@@ -8271,17 +8238,19 @@
 
 	call BattleCommandaa
 	ld hl, BattleMonMaxHP
-	ld de, $c6df
+	ld de, PlayerSubstituteHP
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_36e90 ; 36e88 $6
-	ld hl, EnemyMonMaxHPHi
-	ld de, $c6e0
-.asm_36e90
+	jr z, .got_hp
+	ld hl, EnemyMonMaxHP
+	ld de, EnemySubstituteHP
+.got_hp
+
 	ld a, BATTLE_VARS_SUBSTATUS4
 	call GetBattleVar
-	bit 4, a
-	jr nz, .asm_36ef4 ; 36e97 $5b
+	bit SUBSTATUS_SUBSTITUTE, a
+	jr nz, .asm_36ef4
+
 	ld a, [hli]
 	ld b, [hl]
 	srl a
@@ -8296,38 +8265,43 @@
 	sub b
 	ld e, a
 	ld a, [hl]
-	sbc $0
+	sbc 0
 	ld d, a
-	jr c, .asm_36eff ; 36eae $4f
+	jr c, .asm_36eff
 	ld a, d
 	or e
-	jr z, .asm_36eff ; 36eb2 $4b
+	jr z, .asm_36eff
 	ld [hl], d
 	inc hl
 	ld [hl], e
+
 	ld a, BATTLE_VARS_SUBSTATUS4
-	call _GetBattleVar
-	set 4, [hl]
+	call GetBattleVarAddr
+	set SUBSTATUS_SUBSTITUTE, [hl]
+
 	ld hl, $c730
 	ld de, $c72e
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_36ecf ; 36ec7 $6
+	jr z, .asm_36ecf
 	ld hl, $c731
 	ld de, $c72f
 .asm_36ecf
+
 	xor a
 	ld [hl], a
 	ld [de], a
 	call Function37ed5
-	jr c, .asm_36ee8 ; 36ed5 $11
+	jr c, .asm_36ee8
+
 	xor a
 	ld [$cfca], a
 	ld [FXAnimIDHi], a
 	ld [$c689], a
-	ld a, $a4
+	ld a, SUBSTITUTE
 	call Function37e44
-	jr .asm_36eeb ; 36ee6 $3
+	jr .asm_36eeb
+
 .asm_36ee8
 	call BattleCommanda6
 .asm_36eeb
@@ -8334,11 +8308,13 @@
 	ld hl, MadeSubstituteText
 	call StdBattleTextBox
 	jp RefreshBattleHuds
+
 .asm_36ef4
 	call Function34548
 	call nz, BattleCommand0c
 	ld hl, HasSubstituteText
-	jr .asm_36f08 ; 36efd $9
+	jr .asm_36f08
+
 .asm_36eff
 	call Function34548
 	call nz, BattleCommand0c
@@ -8350,8 +8326,8 @@
 BattleCommand32: ; 36f0b
 ; rechargenextturn
 	ld a, BATTLE_VARS_SUBSTATUS4
-	call _GetBattleVar
-	set 5, [hl]
+	call GetBattleVarAddr
+	set SUBSTATUS_RECHARGE, [hl]
 	ret
 ; 36f13
 
@@ -8359,8 +8335,8 @@
 EndRechargeOpp: ; 36f13
 	push hl
 	ld a, BATTLE_VARS_SUBSTATUS4_OPP
-	call _GetBattleVar
-	res 5, [hl]
+	call GetBattleVarAddr
+	res SUBSTATUS_RECHARGE, [hl]
 	pop hl
 	ret
 ; 36f1d
@@ -8369,8 +8345,8 @@
 BattleCommand97: ; 36f1d
 ; rage
 	ld a, BATTLE_VARS_SUBSTATUS4
-	call _GetBattleVar
-	set 6, [hl]
+	call GetBattleVarAddr
+	set SUBSTATUS_RAGE, [hl]
 	ret
 ; 36f25
 
@@ -8418,42 +8394,42 @@
 	call BattleCommandaa
 	ld a, [AttackMissed]
 	and a
-	jr nz, .asm_36f9a ; 36f50 $48
+	jr nz, .asm_36f9a
 	ld hl, BattleMonMoves
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_36f5d ; 36f58 $3
+	jr z, .asm_36f5d
 	ld hl, EnemyMonMoves
 .asm_36f5d
 	call CheckHiddenOpponent
-	jr nz, .asm_36f9a ; 36f60 $38
+	jr nz, .asm_36f9a
 	ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
 	call GetBattleVar
 	and a
-	jr z, .asm_36f9a ; 36f68 $30
-	cp $a5
-	jr z, .asm_36f9a ; 36f6c $2c
+	jr z, .asm_36f9a
+	cp STRUGGLE
+	jr z, .asm_36f9a
 	ld b, a
-	ld c, $4
+	ld c, NUM_MOVES
 .asm_36f71
 	ld a, [hli]
 	cp b
-	jr z, .asm_36f9a ; 36f73 $25
+	jr z, .asm_36f9a
 	dec c
-	jr nz, .asm_36f71 ; 36f76 $f9
+	jr nz, .asm_36f71
 	dec hl
 .asm_36f79
 	ld a, [hld]
-	cp $66
-	jr nz, .asm_36f79 ; 36f7c $fb
+	cp MIMIC
+	jr nz, .asm_36f79
 	inc hl
 	ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
 	call GetBattleVar
 	ld [hl], a
 	ld [$d265], a
-	ld bc, $0006
+	ld bc, BattleMonPP - BattleMonMoves
 	add hl, bc
-	ld [hl], $5
+	ld [hl], 5
 	call GetMoveName
 	call AnimateCurrentMove
 	ld hl, LearnedMoveText
@@ -8467,34 +8443,39 @@
 ; leechseed
 	ld a, [AttackMissed]
 	and a
-	jr nz, .asm_36fd8 ; 36fa1 $35
+	jr nz, .evaded
 	call CheckSubstituteOpp
-	jr nz, .asm_36fd8 ; 36fa6 $30
+	jr nz, .evaded
+
 	ld de, EnemyMonType1
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_36fb3 ; 36fae $3
+	jr z, .ok
 	ld de, BattleMonType1
-.asm_36fb3
+.ok
+
 	ld a, [de]
-	cp $16
-	jr z, .asm_36fd2 ; 36fb6 $1a
+	cp GRASS
+	jr z, .grass
 	inc de
 	ld a, [de]
-	cp $16
-	jr z, .asm_36fd2 ; 36fbc $14
+	cp GRASS
+	jr z, .grass
+
 	ld a, BATTLE_VARS_SUBSTATUS4_OPP
-	call _GetBattleVar
-	bit 7, [hl]
-	jr nz, .asm_36fd8 ; 36fc5 $11
-	set 7, [hl]
+	call GetBattleVarAddr
+	bit SUBSTATUS_LEECH_SEED, [hl]
+	jr nz, .evaded
+	set SUBSTATUS_LEECH_SEED, [hl]
 	call AnimateCurrentMove
 	ld hl, WasSeededText
 	jp StdBattleTextBox
-.asm_36fd2
+
+.grass
 	call AnimateFailedMove
 	jp PrintDoesntAffect
-.asm_36fd8
+
+.evaded
 	call AnimateFailedMove
 	ld hl, EvadedText
 	jp StdBattleTextBox
@@ -8513,24 +8494,28 @@
 
 	ld a, [AttackMissed]
 	and a
-	jr nz, .asm_37059 ; 36ff1 $66
+	jr nz, .asm_37059
+
 	ld de, EnemyDisableCount
 	ld hl, EnemyMonMoves
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_37004 ; 36ffc $6
+	jr z, .asm_37004
 	ld de, PlayerDisableCount
 	ld hl, BattleMonMoves
 .asm_37004
+
 	ld a, [de]
 	and a
-	jr nz, .asm_37059 ; 37006 $51
+	jr nz, .asm_37059
+
 	ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
 	call GetBattleVar
 	and a
-	jr z, .asm_37059 ; 3700e $49
-	cp $a5
-	jr z, .asm_37059 ; 37012 $45
+	jr z, .asm_37059
+	cp STRUGGLE
+	jr z, .asm_37059
+
 	ld b, a
 	ld c, $ff
 .asm_37017
@@ -8537,22 +8522,23 @@
 	inc c
 	ld a, [hli]
 	cp b
-	jr nz, .asm_37017 ; 3701a $fb
+	jr nz, .asm_37017
+
 	ld a, [hBattleTurn]
 	and a
-	ld hl, EnemyMonPPMove1
-	jr z, .asm_37027 ; 37022 $3
+	ld hl, EnemyMonPP
+	jr z, .asm_37027
 	ld hl, BattleMonPP
 .asm_37027
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [hl]
 	and a
-	jr z, .asm_37059 ; 3702c $2b
+	jr z, .asm_37059
 .asm_3702e
 	call BattleRandom
-	and $7
-	jr z, .asm_3702e ; 37033 $f9
+	and 7
+	jr z, .asm_3702e
 	inc a
 	inc c
 	swap c
@@ -8562,7 +8548,7 @@
 	ld hl, DisabledMove
 	ld a, [hBattleTurn]
 	and a
-	jr nz, .asm_37047 ; 37044 $1
+	jr nz, .asm_37047
 	inc hl
 .asm_37047
 	ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
@@ -8583,22 +8569,24 @@
 	xor a
 	ld hl, StringBuffer1
 	ld [hli], a
+
 	ld a, [hBattleTurn]
 	and a
 	ld a, [BattleMonLevel]
-	jr z, .asm_3706c ; 37067 $3
+	jr z, .ok
 	ld a, [EnemyMonLevel]
-.asm_3706c
+.ok
+
 	add a
-	ld hl, $c6ee
+	ld hl, wPayDayMoney + 2
 	add [hl]
 	ld [hld], a
-	jr nc, .asm_37079 ; 37072 $5
+	jr nc, .done
 	inc [hl]
 	dec hl
-	jr nz, .asm_37079 ; 37076 $1
+	jr nz, .done
 	inc [hl]
-.asm_37079
+.done
 	ld hl, CoinsScatteredText
 	jp StdBattleTextBox
 ; 3707f
@@ -8611,25 +8599,25 @@
 	ld de, BattleMonType1
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_37090 ; 37088 $6
+	jr z, .asm_37090
 	ld hl, EnemyMonMoves
 	ld de, EnemyMonType1
 .asm_37090
 	push de
-	ld c, $0
+	ld c, 0
 	ld de, StringBuffer1
 .asm_37096
 	push hl
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [hl]
 	pop hl
 	and a
-	jr z, .asm_370b2 ; 3709d $13
+	jr z, .asm_370b2
 	push hl
 	push bc
 	dec a
-	ld hl, Moves + PlayerMoveType - PlayerMoveStruct
+	ld hl, Moves + MOVE_TYPE
 	call GetMoveAttr
 	ld [de], a
 	inc de
@@ -8637,8 +8625,8 @@
 	pop hl
 	inc c
 	ld a, c
-	cp $4
-	jr c, .asm_37096 ; 370b0 $e4
+	cp NUM_MOVES
+	jr c, .asm_37096
 .asm_370b2
 	ld a, $ff
 	ld [de], a
@@ -8651,43 +8639,44 @@
 .asm_370bd
 	ld a, [hl]
 	cp $ff
-	jr z, .asm_370d3 ; 370c0 $11
-	cp $13
-	jr z, .asm_370d0 ; 370c4 $a
+	jr z, .asm_370d3
+	cp CURSE_T
+	jr z, .asm_370d0
 	ld a, [de]
 	cp [hl]
-	jr z, .asm_370d0 ; 370c8 $6
+	jr z, .asm_370d0
 	inc de
 	ld a, [de]
 	dec de
 	cp [hl]
-	jr nz, .asm_370d9 ; 370ce $9
+	jr nz, .asm_370d9_a
 .asm_370d0
 	inc hl
-	jr .asm_370bd ; 370d1 $ea
+	jr .asm_370bd
 .asm_370d3
 	call AnimateFailedMove
 	jp PrintButItFailed
-.asm_370d9
+.asm_370d9_a
+.asm_370d9_b
 	call BattleRandom
-	and $3
+	and 3 ; TODO factor in NUM_MOVES
 	ld c, a
-	ld b, $0
+	ld b, 0
 	ld hl, StringBuffer1
 	add hl, bc
 	ld a, [hl]
 	cp $ff
-	jr z, .asm_370d9 ; 370e8 $ef
-	cp $13
-	jr z, .asm_370d9 ; 370ec $eb
+	jr z, .asm_370d9_b
+	cp CURSE_T
+	jr z, .asm_370d9_b
 	ld a, [de]
 	cp [hl]
-	jr z, .asm_370d9 ; 370f0 $e7
+	jr z, .asm_370d9_b
 	inc de
 	ld a, [de]
 	dec de
 	cp [hl]
-	jr z, .asm_370d9 ; 370f6 $e1
+	jr z, .asm_370d9_b
 	ld a, [hl]
 	ld [de], a
 	inc de
@@ -8727,10 +8716,10 @@
 
 .Fill
 	ld b, PlayerStatLevelsEnd - PlayerStatLevels
-.asm_37139
+.next
 	ld [hli], a
 	dec b
-	jr nz, .asm_37139
+	jr nz, .next
 	ret
 ; 3713e
 
@@ -8742,9 +8731,9 @@
 	ld hl, BattleMonMaxHP
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_3714f ; 37147 $6
-	ld de, EnemyMonHPHi
-	ld hl, EnemyMonMaxHPHi
+	jr z, .asm_3714f
+	ld de, EnemyMonHP
+	ld hl, EnemyMonMaxHP
 .asm_3714f
 	ld a, BATTLE_VARS_MOVE_ANIM
 	call GetBattleVar
@@ -8752,7 +8741,7 @@
 	push hl
 	push de
 	push bc
-	ld c, $2
+	ld c, 2
 	call StringCmp
 	pop bc
 	pop de
@@ -8759,30 +8748,30 @@
 	pop hl
 	jp z, .asm_371c4
 	ld a, b
-	cp $9c
-	jr nz, .asm_37199 ; 37166 $31
+	cp REST
+	jr nz, .asm_37199
 	push hl
 	push de
 	push af
 	call BattleCommandaa
 	ld a, BATTLE_VARS_SUBSTATUS5
-	call _GetBattleVar
-	res 0, [hl]
+	call GetBattleVarAddr
+	res SUBSTATUS_TOXIC, [hl]
 	ld a, BATTLE_VARS_STATUS
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld a, [hl]
 	and a
-	ld [hl], $3
+	ld [hl], REST_TURNS + 1
 	ld hl, WentToSleepText
-	jr z, .asm_37186 ; 37181 $3
+	jr z, .asm_37186
 	ld hl, RestedText
 .asm_37186
 	call StdBattleTextBox
 	ld a, [hBattleTurn]
 	and a
-	jr nz, .asm_37193 ; 3718c $5
+	jr nz, .asm_37193
 	call Function365d7
-	jr .asm_37196 ; 37191 $3
+	jr .asm_37196
 .asm_37193
 	call Function365fd
 .asm_37196
@@ -8790,10 +8779,10 @@
 	pop de
 	pop hl
 .asm_37199
-	jr z, .asm_371a3 ; 37199 $8
+	jr z, .asm_371a3
 	ld hl, GetHalfMaxHP
 	call CallBattleCore
-	jr .asm_371a9 ; 371a1 $6
+	jr .asm_371a9
 .asm_371a3
 	ld hl, GetMaxHP
 	call CallBattleCore
@@ -8820,8 +8809,8 @@
 
 	call Function372d8
 	ld a, BATTLE_VARS_SUBSTATUS5_OPP
-	call _GetBattleVar
-	bit 3, [hl]
+	call GetBattleVarAddr
+	bit SUBSTATUS_TRANSFORMED, [hl]
 	jp nz, Function372d2
 	call CheckHiddenOpponent
 	jp nz, Function372d2
@@ -8831,24 +8820,24 @@
 	ld a, $1
 	ld [$c689], a
 	ld a, BATTLE_VARS_SUBSTATUS4
-	call _GetBattleVar
-	bit 4, [hl]
+	call GetBattleVarAddr
+	bit SUBSTATUS_SUBSTITUTE, [hl]
 	push af
-	jr z, .asm_37200 ; 371f4 $a
+	jr z, .asm_37200
 	call Function34548
-	jr nz, .asm_37200 ; 371f9 $5
-	ld a, $a4
+	jr nz, .asm_37200
+	ld a, SUBSTITUTE
 	call Function37e44
 .asm_37200
 	ld a, BATTLE_VARS_SUBSTATUS5
-	call _GetBattleVar
-	set 3, [hl]
+	call GetBattleVarAddr
+	set SUBSTATUS_TRANSFORMED, [hl]
 	call ResetActorDisable
 	ld hl, BattleMonSpecies
 	ld de, EnemyMonSpecies
 	ld a, [hBattleTurn]
 	and a
-	jr nz, .asm_3721f ; 37213 $a
+	jr nz, .asm_3721f
 	ld hl, EnemyMonSpecies
 	ld de, BattleMonSpecies
 	xor a
@@ -8860,11 +8849,11 @@
 	inc hl
 	inc de
 	inc de
-	ld bc, $0004
+	ld bc, NUM_MOVES
 	call CopyBytes
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_3723a ; 3722e $a
+	jr z, .asm_3723a
 	ld a, [de]
 	ld [$c6f2], a
 	inc de
@@ -8897,20 +8886,20 @@
 	pop hl
 	ld bc, $ffe8
 	add hl, bc
-	ld b, $4
+	ld b, NUM_MOVES
 .asm_3725f
 	ld a, [de]
 	inc de
 	and a
-	jr z, .asm_3726c ; 37262 $8
+	jr z, .asm_3726c
 	cp SKETCH
 	ld a, 1
-	jr z, .asm_3726c ; 37268 $2
+	jr z, .asm_3726c
 	ld a, 5
 .asm_3726c
 	ld [hli], a
 	dec b
-	jr nz, .asm_3725f ; 3726e $ef
+	jr nz, .asm_3725f
 	pop hl
 	ld a, [hl]
 	ld [$d265], a
@@ -8924,17 +8913,17 @@
 	ld bc, $0008
 	call BattleSideCopy
 	call Function37ed5
-	jr c, .asm_372a8 ; 37293 $13
+	jr c, .asm_372a8
 	ld a, [hBattleTurn]
 	and a
 	ld a, [$c6fe]
-	jr z, .asm_372a0 ; 3729b $3
+	jr z, .asm_372a0
 	ld a, [$c6fa]
 .asm_372a0
 	and a
-	jr nz, .asm_372a8 ; 372a1 $5
+	jr nz, .asm_372a8
 	call Function37e36
-	jr .asm_372ae ; 372a6 $6
+	jr .asm_372ae
 .asm_372a8
 	call BattleCommandaa
 	call BattleCommanda6
@@ -8945,7 +8934,7 @@
 	ld a, $2
 	ld [$c689], a
 	pop af
-	ld a, $a4
+	ld a, SUBSTITUTE
 	call nz, Function37e44
 	ld hl, TransformedText
 	jp StdBattleTextBox
@@ -8977,12 +8966,12 @@
 
 Function372d8: ; 372d8
 	ld a, BATTLE_VARS_LAST_COUNTER_MOVE
-	call _GetBattleVar
+	call GetBattleVarAddr
 	xor a
 	ld [hl], a
 
 	ld a, BATTLE_VARS_LAST_MOVE
-	call _GetBattleVar
+	call GetBattleVarAddr
 	xor a
 	ld [hl], a
 	ret
@@ -9024,23 +9013,23 @@
 	cp EFFECT_LIGHT_SCREEN
 	jr nz, .Reflect
 
-	bit 3, [hl]
-	jr nz, .asm_37337
-	set 3, [hl]
-	ld a, $5
+	bit SCREENS_LIGHT_SCREEN, [hl]
+	jr nz, .failed
+	set SCREENS_LIGHT_SCREEN, [hl]
+	ld a, 5
 	ld [bc], a
 	ld hl, LightScreenEffectText
 	jr .asm_37331
 
 .Reflect
-	bit 4, [hl]
-	jr nz, .asm_37337
-	set 4, [hl]
+	bit SCREENS_REFLECT, [hl]
+	jr nz, .failed
+	set SCREENS_REFLECT, [hl]
 
-; LightScreenCount -> ReflectCount
+	; LightScreenCount -> ReflectCount
 	inc bc
 
-	ld a, $5
+	ld a, 5
 	ld [bc], a
 	ld hl, ReflectEffectText
 
@@ -9048,7 +9037,7 @@
 	call AnimateCurrentMove
 	jp StdBattleTextBox
 
-.asm_37337
+.failed
 	call AnimateFailedMove
 	jp PrintButItFailed
 ; 3733d
@@ -9121,7 +9110,7 @@
 CheckSubstituteOpp: ; 37378
 	ld a, BATTLE_VARS_SUBSTATUS4_OPP
 	call GetBattleVar
-	bit 4, a
+	bit SUBSTATUS_SUBSTITUTE, a
 	ret
 ; 37380
 
@@ -9133,7 +9122,7 @@
 	ld c, $3
 	call DelayFrames
 	ld a, BATTLE_VARS_STATUS
-	call _GetBattleVar
+	call GetBattleVarAddr
 	xor a
 	ld [hli], a
 	inc hl
@@ -9144,15 +9133,15 @@
 	call BattleCommand0a
 	call Function37e36
 	ld a, BATTLE_VARS_SUBSTATUS4
-	call _GetBattleVar
-	res 7, [hl]
+	call GetBattleVarAddr
+	res SUBSTATUS_LEECH_SEED, [hl]
 	ld a, BATTLE_VARS_SUBSTATUS5_OPP
-	call _GetBattleVar
-	res 6, [hl]
+	call GetBattleVarAddr
+	res SUBSTATUS_DESTINY_BOND, [hl]
 	call Function37ed5
 	ret nc
 	callba DrawPlayerHUD
-	callba Function3e043
+	callba DrawEnemyHUD
 	call WaitBGMap
 	jp RefreshBattleHuds
 ; 373c9
@@ -9219,7 +9208,7 @@
 ; Don't trap if the opponent is already trapped.
 
 	ld a, BATTLE_VARS_SUBSTATUS5
-	call _GetBattleVar
+	call GetBattleVarAddr
 	bit SUBSTATUS_CANT_RUN, [hl]
 	jr nz, .failed
 
@@ -9245,7 +9234,7 @@
 ; Thaw the user.
 
 	ld a, BATTLE_VARS_STATUS
-	call _GetBattleVar
+	call GetBattleVarAddr
 	bit FRZ, [hl]
 	ret z
 	res FRZ, [hl]
@@ -9360,17 +9349,17 @@
 ; attract
 	ld a, [AttackMissed]
 	and a
-	jr nz, .asm_377f2
+	jr nz, .failed
 	call Function377f5
-	jr c, .asm_377f2
+	jr c, .failed
 	call CheckHiddenOpponent
-	jr nz, .asm_377f2
+	jr nz, .failed
 	ld a, BATTLE_VARS_SUBSTATUS1_OPP
-	call _GetBattleVar
-	bit 7, [hl]
-	jr nz, .asm_377f2
+	call GetBattleVarAddr
+	bit SUBSTATUS_IN_LOVE, [hl]
+	jr nz, .failed
 
-	set 7, [hl]
+	set SUBSTATUS_IN_LOVE, [hl]
 	call AnimateCurrentMove
 
 ; 'fell in love!'
@@ -9377,13 +9366,13 @@
 	ld hl, FellInLoveText
 	jp StdBattleTextBox
 
-.asm_377f2
+.failed
 	jp Function37354
 ; 377f5
 
 
 Function377f5: ; 377f5
-	ld a, 0
+	ld a, PartyMon1Species - PartyMon1
 	call BattlePartyAttr
 	ld a, [hl]
 	ld [CurPartySpecies], a
@@ -9404,12 +9393,11 @@
 	push bc
 	ld a, [TempEnemyMonSpecies]
 	ld [CurPartySpecies], a
-	ld hl, EnemyMonAtkDefDV
+	ld hl, EnemyMonDVs
 	ld a, [EnemySubStatus5]
-	bit 3, a
+	bit SUBSTATUS_TRANSFORMED, a
 	jr z, .asm_37829
 	ld hl, $c6f2
-
 .asm_37829
 	ld a, [hli]
 	ld [$d123], a
@@ -9444,22 +9432,22 @@
 	ld hl, BattleMonHappiness
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_37857 ; 37852 $3
+	jr z, .ok
 	ld hl, EnemyMonHappiness
-.asm_37857
+.ok
 	xor a
-	ld [$ffb4], a
-	ld [$ffb5], a
+	ld [hMultiplicand], a
+	ld [hMultiplicand + 1], a
 	ld a, [hl]
-	ld [$ffb6], a
-	ld a, $a
-	ld [$ffb7], a
+	ld [hMultiplicand + 2], a
+	ld a, 10
+	ld [hMultiplier], a
 	call Multiply
-	ld a, $19
-	ld [$ffb7], a
-	ld b, $4
+	ld a, 25
+	ld [hDivisor], a
+	ld b, 4
 	call Divide
-	ld a, [$ffb6]
+	ld a, [hQuotient + 2]
 	ld d, a
 	pop bc
 	ret
@@ -9471,17 +9459,20 @@
 
 	ld a, [InLinkBattle]
 	cp $3
-	jr z, .asm_3787d ; 37879 $2
+	jr z, .asm_3787d
 	push bc
 	push de
 .asm_3787d
+
 	call BattleCommand07
+
 	ld a, [InLinkBattle]
 	cp $3
-	jr z, .asm_37889 ; 37885 $2
+	jr z, .asm_37889
 	pop de
 	pop bc
 .asm_37889
+
 	ld a, [$d265]
 	and a
 	jp z, AnimateFailedMove
@@ -9488,6 +9479,7 @@
 	ld a, [AttackMissed]
 	and a
 	jp nz, AnimateFailedMove
+
 	push bc
 	call BattleRandom
 	ld b, a
@@ -9502,6 +9494,7 @@
 	inc c
 	inc hl
 	jr .asm_378a1 ; 378ab $f4
+
 .asm_378ad
 	ld a, c
 	ld [$c689], a
@@ -9509,6 +9502,7 @@
 	ld d, [hl]
 	pop bc
 	ret
+
 .asm_378b7
 	pop bc
 	ld a, $3
@@ -9524,6 +9518,7 @@
 	ld a, BANK(AICheckPlayerMaxHP)
 	rst FarCall
 	jr c, .asm_378f3 ; 378d1 $20
+
 	ld hl, GetQuarterMaxHP
 	call CallBattleCore
 	call SwitchTurn
@@ -9535,6 +9530,7 @@
 	call SwitchTurn
 	call UpdateOpponentInParty
 	jr .asm_37904 ; 378f1 $11
+
 .asm_378f3
 	call SwitchTurn
 	call Function37ed5
@@ -9546,9 +9542,9 @@
 	jp EndMoveEffect
 
 .table_37907
-	db $66,  40
-	db $b3,  80
-	db $cc, 120
+	db 40 percent,     40
+	db 70 percent + 1, 80
+	db 80 percent,    120
 	db $ff
 ; 3790e
 
@@ -9569,12 +9565,12 @@
 	xor a
 	ld [$ffb4], a
 	ld [$ffb5], a
-	ld a, $a
+	ld a, 10
 	ld [$ffb7], a
 	call Multiply
-	ld a, $19
+	ld a, 25
 	ld [$ffb7], a
-	ld b, $4
+	ld b, 4
 	call Divide
 	ld a, [$ffb6]
 	ld d, a
@@ -9587,22 +9583,22 @@
 ; safeguard
 
 	ld hl, PlayerScreens
-	ld de, $c701
+	ld de, PlayerSafeguardCount
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_3794a ; 37942 $6
+	jr z, .ok
 	ld hl, EnemyScreens
-	ld de, $c705
-.asm_3794a
-	bit 2, [hl]
-	jr nz, .asm_3795c ; 3794c $e
-	set 2, [hl]
-	ld a, $5
+	ld de, EnemySafeguardCount
+.ok
+	bit SCREENS_SAFEGUARD, [hl]
+	jr nz, .failed
+	set SCREENS_SAFEGUARD, [hl]
+	ld a, 5
 	ld [de], a
 	call AnimateCurrentMove
 	ld hl, CoveredByVeilText
 	jp StdBattleTextBox
-.asm_3795c
+.failed
 	call AnimateFailedMove
 	jp PrintButItFailed
 ; 37962
@@ -9617,7 +9613,7 @@
 	ld hl, PlayerScreens
 
 .asm_3796e
-	bit 2, [hl]
+	bit SCREENS_SAFEGUARD, [hl]
 	pop hl
 	ret
 ; 37972
@@ -9631,9 +9627,9 @@
 	jr z, .asm_3797d ; 37978 $3
 	ld hl, PlayerScreens
 .asm_3797d
-	bit 2, [hl]
+	bit SCREENS_SAFEGUARD, [hl]
 	ret z
-	ld a, $1
+	ld a, 1
 	ld [AttackMissed], a
 	call BattleCommandaa
 	ld hl, SafeguardProtectText
@@ -9649,14 +9645,14 @@
 	call BattleRandom
 	ld b, a
 	ld hl, .Magnitudes
-.asm_37999
+.loop
 	ld a, [hli]
 	cp b
-	jr nc, .asm_379a1 ; 3799b $4
+	jr nc, .ok
 	inc hl
 	inc hl
-	jr .asm_37999 ; 3799f $f8
-.asm_379a1
+	jr .loop
+.ok
 	ld d, [hl]
 	push de
 	inc hl
@@ -9795,10 +9791,10 @@
 	call CallBattleCore
 
 	ld a, [OTPartyCount]
-	add 4
+	add NUM_MOVES
 	ld b, a
-	ld a, [$d430]
-	cp 4
+	ld a, [wBattleAction]
+	cp NUM_MOVES
 	jr c, .asm_37aa0
 	cp b
 	jr c, .asm_37aa8
@@ -9805,8 +9801,8 @@
 
 .asm_37aa0
 	ld a, [CurOTMon]
-	add 4
-	ld [$d430], a
+	add NUM_MOVES
+	ld [wBattleAction], a
 .asm_37aa8
 	jp Function1c17
 ; 37aab
@@ -9821,7 +9817,7 @@
 ResetBatonPassStatus: ; 37ab1
 ; Reset status changes that aren't passed by Baton Pass.
 
-; Nightmare isn't passed.
+	; Nightmare isn't passed.
 	ld a, BATTLE_VARS_STATUS
 	call GetBattleVar
 	and SLP
@@ -9828,14 +9824,14 @@
 	jr nz, .ok
 
 	ld a, BATTLE_VARS_SUBSTATUS1
-	call _GetBattleVar
+	call GetBattleVarAddr
 	res SUBSTATUS_NIGHTMARE, [hl]
 .ok
 
-; Disable isn't passed.
+	; Disable isn't passed.
 	call ResetActorDisable
 
-; Attraction isn't passed.
+	; Attraction isn't passed.
 	ld hl, PlayerSubStatus1
 	res SUBSTATUS_IN_LOVE, [hl]
 	ld hl, EnemySubStatus1
@@ -9843,13 +9839,13 @@
 	ld hl, PlayerSubStatus5
 
 	ld a, BATTLE_VARS_SUBSTATUS5
-	call _GetBattleVar
-	res 3, [hl]
-	res 4, [hl]
+	call GetBattleVarAddr
+	res SUBSTATUS_TRANSFORMED, [hl]
+	res SUBSTATUS_ENCORED, [hl]
 
-; New mon hasn't used a move yet.
+	; New mon hasn't used a move yet.
 	ld a, BATTLE_VARS_LAST_MOVE
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld [hl], 0
 
 	xor a
@@ -9918,20 +9914,25 @@
 
 
 BattleCommand68: ; 37b1d
-	ld hl, $c711
+; pursuit
+; Double damage if the opponent is switching.
+
+	ld hl, wEnemyIsSwitching
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_37b28 ; 37b23 $3
-	ld hl, $c710
-.asm_37b28
+	jr z, .ok
+	ld hl, wPlayerIsSwitching
+.ok
 	ld a, [hl]
 	and a
 	ret z
+
 	ld hl, CurDamage + 1
 	sla [hl]
 	dec hl
 	rl [hl]
 	ret nc
+
 	ld a, $ff
 	ld [hli], a
 	ld [hl], a
@@ -9943,13 +9944,14 @@
 ; clearhazards
 
 	ld a, BATTLE_VARS_SUBSTATUS4
-	call _GetBattleVar
-	bit 7, [hl]
+	call GetBattleVarAddr
+	bit SUBSTATUS_LEECH_SEED, [hl]
 	jr z, .asm_37b4a ; 37b40 $8
-	res 7, [hl]
+	res SUBSTATUS_LEECH_SEED, [hl]
 	ld hl, ShedLeechSeedText
 	call StdBattleTextBox
 .asm_37b4a
+
 	ld hl, PlayerScreens
 	ld de, $c730
 	ld a, [hBattleTurn]
@@ -9958,14 +9960,15 @@
 	ld hl, EnemyScreens
 	ld de, $c731
 .asm_37b5b
-	bit 0, [hl]
+	bit SCREENS_SPIKES, [hl]
 	jr z, .asm_37b69 ; 37b5d $a
-	res 0, [hl]
+	res SCREENS_SPIKES, [hl]
 	ld hl, BlewSpikesText
 	push de
 	call StdBattleTextBox
 	pop de
 .asm_37b69
+
 	ld a, [de]
 	and a
 	ret z
@@ -10130,7 +10133,7 @@
 	pop bc
 	callab Function3cc3f
 	call UpdateUserInParty
-	ld a, $5
+	ld a, 5
 
 .asm_37c41
 	push af
@@ -10137,7 +10140,7 @@
 	call BattleCommand77
 	pop af
 	dec a
-	jr nz, .asm_37c41 ; 37c47 $f8
+	jr nz, .asm_37c41
 
 	ld hl, BellyDrumText
 	jp StdBattleTextBox
@@ -10262,9 +10265,9 @@
 	ld hl, $c6fa
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_37cf1 ; 37cec $3
+	jr z, .ok
 	ld hl, $c6fe
-.asm_37cf1
+.ok
 	ld a, [hl]
 	and a
 	ret z
@@ -10327,10 +10330,10 @@
 	call GetBattleVar
 	ld b, a
 	ld a, BATTLE_VARS_LAST_COUNTER_MOVE
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld [hl], b
 	ld a, BATTLE_VARS_LAST_MOVE
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld [hl], b
 .asm_37d4b
 	ld hl, $c71d
@@ -10358,12 +10361,12 @@
 	ld hl, CurDamage
 	ld a, [hl]
 	ld [de], a
-	ld [hl], $0
+	ld [hl], 0
 	inc hl
 	inc de
 	ld a, [hl]
 	ld [de], a
-	ld [hl], $0
+	ld [hl], 0
 	jp EndMoveEffect
 .asm_37d87
 	pop bc
@@ -10378,17 +10381,17 @@
 ; thunderaccuracy
 
 	ld a, BATTLE_VARS_MOVE_TYPE
-	call _GetBattleVar
+	call GetBattleVarAddr
 	inc hl
 	ld a, [Weather]
 	cp WEATHER_RAIN
-	jr z, .asm_37da7 ; 37d9f $6
+	jr z, .rain
 	cp WEATHER_SUN
 	ret nz
-	ld [hl], $80
+	ld [hl], 50 percent + 1
 	ret
-.asm_37da7
-	ld [hl], $ff
+.rain
+	ld [hl], 100 percent
 	ret
 ; 37daa
 
@@ -10396,7 +10399,7 @@
 CheckHiddenOpponent: ; 37daa
 	ld a, BATTLE_VARS_SUBSTATUS3_OPP
 	call GetBattleVar
-	and $60 ; fly | dig
+	and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
 	ret
 ; 37db2
 
@@ -10621,7 +10624,7 @@
 GetMoveAttr: ; 37ea1
 ; Assuming hl = Moves + x, return attribute x of move a.
 	push bc
-	ld bc, Move2 - Move1
+	ld bc, MOVE_LENGTH
 	call AddNTimes
 	call GetMoveByte
 	pop bc
@@ -10632,7 +10635,7 @@
 GetMoveData: ; 37ead
 ; Copy move struct a to de.
 	ld hl, Moves
-	ld bc, Move2 - Move1
+	ld bc, MOVE_LENGTH
 	call AddNTimes
 	ld a, Bank(Moves)
 	jp FarCopyBytes
@@ -10674,6 +10677,4 @@
 	pop hl
 	ret
 ; 37ee2
-
-
 
--- a/battle/effects/curse.asm
+++ b/battle/effects/curse.asm
@@ -66,11 +66,11 @@
 	jr nz, .failed
 
 	ld a, BATTLE_VARS_SUBSTATUS1_OPP
-	call _GetBattleVar
-	bit 1, [hl]
+	call GetBattleVarAddr
+	bit SUBSTATUS_CURSE, [hl]
 	jr nz, .failed
 
-	set 1, [hl]
+	set SUBSTATUS_CURSE, [hl]
 	call AnimateCurrentMove
 	ld hl, GetHalfMaxHP
 	call CallBattleCore
--- a/battle/effects/endure.asm
+++ b/battle/effects/endure.asm
@@ -7,7 +7,7 @@
 	ret c
 
 	ld a, BATTLE_VARS_SUBSTATUS1
-	call _GetBattleVar
+	call GetBattleVarAddr
 	set SUBSTATUS_ENDURE, [hl]
 
 	call AnimateCurrentMove
--- a/battle/effects/foresight.asm
+++ b/battle/effects/foresight.asm
@@ -9,7 +9,7 @@
 	jr nz, .failed
 
 	ld a, BATTLE_VARS_SUBSTATUS1_OPP
-	call _GetBattleVar
+	call GetBattleVarAddr
 	bit SUBSTATUS_IDENTIFIED, [hl]
 	jr nz, .failed
 
--- a/battle/effects/metronome.asm
+++ b/battle/effects/metronome.asm
@@ -36,7 +36,7 @@
 
 
 	ld a, BATTLE_VARS_MOVE
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld [hl], b
 	call UpdateMoveData
 	jp ResetTurn
--- a/battle/effects/mirror_move.asm
+++ b/battle/effects/mirror_move.asm
@@ -4,7 +4,7 @@
 	call Function372d8
 
 	ld a, BATTLE_VARS_MOVE
-	call _GetBattleVar
+	call GetBattleVarAddr
 
 	ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
 	call GetBattleVar
@@ -28,7 +28,7 @@
 
 	push af
 	ld a, BATTLE_VARS_MOVE_ANIM
-	call _GetBattleVar
+	call GetBattleVarAddr
 	ld d, h
 	ld e, l
 	pop af
--- a/battle/effects/nightmare.asm
+++ b/battle/effects/nightmare.asm
@@ -14,7 +14,7 @@
 ; Only works on a sleeping opponent.
 
 	ld a, BATTLE_VARS_STATUS_OPP
-	call _GetBattleVar
+	call GetBattleVarAddr
 	and SLP
 	jr z, .failed
 
@@ -21,7 +21,7 @@
 ; Bail if the opponent is already having a nightmare.
 
 	ld a, BATTLE_VARS_SUBSTATUS1_OPP
-	call _GetBattleVar
+	call GetBattleVarAddr
 	bit SUBSTATUS_NIGHTMARE, [hl]
 	jr nz, .failed
 
--- a/battle/effects/protect.asm
+++ b/battle/effects/protect.asm
@@ -4,7 +4,7 @@
 	ret c
 
 	ld a, BATTLE_VARS_SUBSTATUS1
-	call _GetBattleVar
+	call GetBattleVarAddr
 	set SUBSTATUS_PROTECT, [hl]
 
 	call AnimateCurrentMove
--- a/battle/effects/rollout.asm
+++ b/battle/effects/rollout.asm
@@ -1,3 +1,6 @@
+MAX_ROLLOUT_COUNT EQU 5
+
+
 BattleCommand5b: ; 37718
 ; checkcurl
 
@@ -4,19 +7,18 @@
 	ld de, PlayerRolloutCount
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_37723
+	jr z, .ok
 	ld de, EnemyRolloutCount
-
-.asm_37723
+.ok
 	ld a, BATTLE_VARS_SUBSTATUS1
 	call GetBattleVar
-	bit SUBSTATUS_ENCORED, a
-	jr z, .asm_37731
+	bit SUBSTATUS_ROLLOUT, a
+	jr z, .reset
 
 	ld b, $4 ; doturn
 	jp SkipToBattleCommand
 
-.asm_37731
+.reset
 	xor a
 	ld [de], a
 	ret
@@ -28,7 +30,7 @@
 
 	ld a, BATTLE_VARS_STATUS
 	call GetBattleVar
-	and 7
+	and SLP
 	ret nz
 
 	ld hl, PlayerRolloutCount
@@ -50,7 +52,7 @@
 	jr z, .hit
 
 	ld a, BATTLE_VARS_SUBSTATUS1
-	call _GetBattleVar
+	call GetBattleVarAddr
 	res 6, [hl]
 	ret
 
@@ -58,23 +60,23 @@
 	inc [hl]
 	ld a, [hl]
 	ld b, a
-	cp $5
+	cp MAX_ROLLOUT_COUNT
 	jr c, .asm_3776e
 
 	ld a, BATTLE_VARS_SUBSTATUS1
-	call _GetBattleVar
-	res 6, [hl]
+	call GetBattleVarAddr
+	res SUBSTATUS_ROLLOUT, [hl]
 	jr .asm_37775
 
 .asm_3776e
 	ld a, BATTLE_VARS_SUBSTATUS1
-	call _GetBattleVar
-	set 6, [hl]
+	call GetBattleVarAddr
+	set SUBSTATUS_ROLLOUT, [hl]
 
 .asm_37775
 	ld a, BATTLE_VARS_SUBSTATUS2
 	call GetBattleVar
-	bit 0, a
+	bit SUBSTATUS_CURLED, a
 	jr z, .asm_3777f
 	inc b
 .asm_3777f
--- a/battle/hidden_power.asm
+++ b/battle/hidden_power.asm
@@ -96,7 +96,7 @@
 ; Overwrite the current move type.
 	push af
 	ld a, BATTLE_VARS_MOVE_TYPE
-	call _GetBattleVar
+	call GetBattleVarAddr
 	pop af
 	ld [hl], a
 
--- a/battle/moves/moves.asm
+++ b/battle/moves/moves.asm
@@ -1,22 +1,17 @@
 Moves: ; 41afb
+; Characteristics of each move.
 
-; Characteristics of each move
-
-; animation, effect, power, type, accuracy, PP, effect chance
-
 move: MACRO
 	db \1 ; animation
 	db \2 ; effect
 	db \3 ; power
 	db \4 ; type
-	db \5 * $ff / 100 ; accuracy (percent)
+	db \5 percent ; accuracy
 	db \6 ; pp
-	db \7 * $ff / 100  ; effect chance (percent)
+	db \7 percent ; effect chance
 ENDM
 
-Move1:
 	move POUND,        EFFECT_NORMAL_HIT,         40, NORMAL,   100, 35,   0
-Move2:
 	move KARATE_CHOP,  EFFECT_NORMAL_HIT,         50, FIGHTING, 100, 25,   0
 	move DOUBLESLAP,   EFFECT_MULTI_HIT,          15, NORMAL,    85, 10,   0
 	move COMET_PUNCH,  EFFECT_MULTI_HIT,          18, NORMAL,    85, 15,   0
--- a/constants/battle_constants.asm
+++ b/constants/battle_constants.asm
@@ -1,6 +1,8 @@
 MAX_LEVEL EQU 100
 NUM_MOVES EQU 4
 
+REST_TURNS EQU 2
+
 ATTACK EQU 0
 DEFENSE EQU 1
 SPEED EQU 2
@@ -44,9 +46,12 @@
 BATTLETYPE_TUTORIAL EQU $03
 BATTLETYPE_FISH EQU $04
 BATTLETYPE_ROAMING EQU $05
+BATTLETYPE_CONTEST EQU $06
 BATTLETYPE_SHINY EQU $07
 BATTLETYPE_TREE EQU $08
+BATTLETYPE_TRAP EQU $09
 BATTLETYPE_FORCEITEM EQU $0a
+BATTLETYPE_CELEBI EQU $0b
 BATTLETYPE_SUICUNE EQU $0c
 
 ; battle variables
@@ -81,7 +86,7 @@
 
 ; substatus
 SUBSTATUS_IN_LOVE      EQU 7
-SUBSTATUS_ENCORED      EQU 6
+SUBSTATUS_ROLLOUT      EQU 6
 SUBSTATUS_ENDURE       EQU 5
 SUBSTATUS_PERISH       EQU 4
 SUBSTATUS_IDENTIFIED   EQU 3
@@ -96,7 +101,8 @@
 SUBSTATUS_UNDERGROUND  EQU 5
 SUBSTATUS_CHARGED      EQU 4
 SUBSTATUS_FLINCHED     EQU 3
-SUBSTATUS_ROLLOUT      EQU 1
+SUBSTATUS_IN_LOOP      EQU 2
+SUBSTATUS_RAMPAGE      EQU 1
 SUBSTATUS_BIDE         EQU 0
 
 SUBSTATUS_LEECH_SEED   EQU 7
@@ -110,6 +116,8 @@
 SUBSTATUS_CANT_RUN     EQU 7
 SUBSTATUS_DESTINY_BOND EQU 6
 SUBSTATUS_LOCK_ON      EQU 5
+SUBSTATUS_ENCORED      EQU 4
+SUBSTATUS_TRANSFORMED  EQU 3
 SUBSTATUS_TOXIC        EQU 0
 
 ; environmental
@@ -119,6 +127,7 @@
 SCREENS_SPIKES       EQU 0
 
 ; weather
+WEATHER_NONE EQU 0
 WEATHER_RAIN EQU 1
 WEATHER_SUN EQU 2
 WEATHER_SANDSTORM EQU 3
--- a/constants/item_constants.asm
+++ b/constants/item_constants.asm
@@ -267,6 +267,7 @@
 HELD_LEFTOVERS      EQU $03
 HELD_RESTORE_PP     EQU $06
 HELD_CLEANSE_TAG    EQU $08
+
 HELD_HEAL_POISON    EQU $0a
 HELD_HEAL_FREEZE    EQU $0b
 HELD_HEAL_BURN      EQU $0c
@@ -274,7 +275,24 @@
 HELD_HEAL_PARALYZE  EQU $0e
 HELD_HEAL_STATUS    EQU $0f
 HELD_HEAL_CONFUSION EQU $10
+
+HELD_PREVENT_POISON   EQU $14
+HELD_PREVENT_BURN     EQU $15
+HELD_PREVENT_FREEZE   EQU $16
+HELD_PREVENT_SLEEP    EQU $17
+HELD_PREVENT_PARALYZE EQU $18
+HELD_PREVENT_CONFUSE  EQU $19
+
+HELD_ATTACK_UP      EQU $1f
+HELD_DEFENSE_UP     EQU $20
+HELD_SPEED_UP       EQU $21
+HELD_SP_ATTACK_UP   EQU $22
+HELD_SP_DEFENSE_UP  EQU $23
+HELD_ACCURACY_UP    EQU $24
+HELD_EVASION_UP     EQU $25
+
 HELD_METAL_POWDER   EQU $2a
+
 HELD_NORMAL_BOOST   EQU $32
 HELD_FIGHTING_BOOST EQU $33
 HELD_FLYING_BOOST   EQU $34
@@ -292,6 +310,7 @@
 HELD_DRAGON_BOOST   EQU $40
 HELD_DARK_BOOST     EQU $41
 HELD_STEEL_BOOST    EQU $42
+
 HELD_ESCAPE         EQU $48
 HELD_CRITICAL_UP    EQU $49
 HELD_QUICK_CLAW     EQU $4a
--- a/constants/misc_constants.asm
+++ b/constants/misc_constants.asm
@@ -1,42 +1,30 @@
+PARTY_LENGTH EQU 6
 
 ; strings
 PLAYER_NAME_LENGTH EQU 8
 PKMN_NAME_LENGTH EQU 11
+MOVE_NAME_LENGTH EQU 13
 NAME_LENGTH EQU 11
 LV_CHAR EQU $6e
 
+; GetName types
+PKMN_NAME     EQU 1
+MOVE_NAME     EQU 2
+ITEM_NAME     EQU 4
+PARTY_OT_NAME EQU 5
+ENEMY_OT_NAME EQU 6
+TRAINER_NAME  EQU 7
 
+; hp
+HP_GREEN  EQU 0
+HP_YELLOW EQU 1
+HP_RED    EQU 2
+
 ; boxes
-NUM_BOXES EQU 14
+MONS_PER_BOX EQU 20
+NUM_BOXES    EQU 14
 
 
-; predefs
-PREDEF_FLAG EQU $03
-PREDEF_FILLPP EQU $05
-PREDEF_ADDPARTYMON EQU $06
-PREDEF_FILLSTATS EQU $0C
-PREDEF_PRINT_MOVE_DESCRIPTION EQU $11
-PREDEF_UPDATE_PLAYER_HUD EQU $12
-PREDEF_FILL_BOX EQU $13
-PREDEF_UPDATE_ENEMY_HUD EQU $15
-PREDEF_START_BATTLE EQU $16
-PREDEF_FILL_IN_EXP_BAR EQU $17
-PREDEF_FILLMOVES EQU $1B
-PREDEF_GET_GENDER EQU $24
-PREDEF_STATS_SCREEN EQU $25
-PREDEF_DRAW_PLAYER_HP EQU $26
-PREDEF_DRAW_ENEMY_HP EQU $27
-PREDEF_GET_TYPE_NAME EQU $29
-PREDEF_PRINT_MOVE_TYPE EQU $2A
-PREDEF_PRINT_TYPE EQU $2B
-PREDEF_GET_UNOWN_LETTER EQU $2D
-PREDEF_LOAD_SGB_LAYOUT EQU $31
-PREDEF_CHECK_CONTEST_MON EQU $33
-PREDEF_BATTLE_TRANSITION EQU $34
-PREDEF_PARTYMON_ITEM_NAME EQU $3B
-PREDEF_DECOMPRESS EQU $40
-
-
 ; flag manipulation
 RESET_FLAG EQU 0
 SET_FLAG   EQU 1
@@ -60,9 +48,9 @@
 
 ; screen
 HP_BAR_LENGTH EQU 6
-HP_BAR_LENGTH_PX EQU 48
+HP_BAR_LENGTH_PX EQU HP_BAR_LENGTH * 8
 EXP_BAR_LENGTH EQU 8
-EXP_BAR_LENGTH_PX EQU 64
+EXP_BAR_LENGTH_PX EQU EXP_BAR_LENGTH * 8
 
 SCREEN_WIDTH EQU 20
 SCREEN_HEIGHT EQU 18
--- a/constants/type_constants.asm
+++ b/constants/type_constants.asm
@@ -25,8 +25,8 @@
 	const TYPE_17
 	const TYPE_18
 	const CURSE_T
+UNUSED_TYPES_END EQU const_value
 
-
 SPECIAL EQU const_value
 	const FIRE
 	const WATER
@@ -37,3 +37,4 @@
 	const DRAGON
 	const DARK
 
+TYPES_END EQU const_value
--- a/data/battle_tower.asm
+++ b/data/battle_tower.asm
@@ -70,9 +70,11 @@
 
 Function1f8081: ; 1f8081
 	ld c, $3
+.loop
 	push bc
 	ld a, $1
 	call GetSRAMBank
+
 .asm_1f8089
 	ld a, [$d800]
 	dec a
@@ -150,7 +152,7 @@
 	ld h, d
 	ld l, e
 	pop de
-	ld bc, $000b
+	ld bc, PKMN_NAME_LENGTH
 	call CopyBytes
 	pop de
 	pop af
@@ -157,7 +159,8 @@
 	ld [$d265], a
 	pop bc
 	dec c
-	jp nz, $4083
+	jp nz, .loop
+
 	ld a, [$be51]
 	ld [$be54], a
 	ld a, [$be52]
--- a/data/odd_eggs.asm
+++ b/data/odd_eggs.asm
@@ -35,7 +35,7 @@
 	ld hl, OddEggs
 	ld a, OddEgg2 - OddEgg1
 	call AddNTimes
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld bc, $0046
 	call CopyBytes
 	ld a, EGG_TICKET
--- a/engine/engine_flags.asm
+++ b/engine/engine_flags.asm
@@ -9,13 +9,13 @@
 	dwb $d957, %00001000 ; expn card
 	dwb $d957, %10000000 ; on/off
 	
-	;   DaycareMan, %10000000 ; daycare 1 on
-	dwb DaycareMan, %01000000 ; monster 1 and 2 are compatible
-	;   DaycareMan, %00100000 ; egg is ready
-	dwb DaycareMan, %00000001 ; monster 1 in daycare
+	;   wDaycareMan, %10000000 ; daycare 1 on
+	dwb wDaycareMan, %01000000 ; monster 1 and 2 are compatible
+	;   wDaycareMan, %00100000 ; egg is ready
+	dwb wDaycareMan, %00000001 ; monster 1 in daycare
 	
-	;   DaycareLady, %10000000 = daycare 2 on
-	dwb DaycareLady, %00000001 ; monster 2 in daycare
+	;   wDaycareLady, %10000000 = daycare 2 on
+	dwb wDaycareLady, %00000001 ; monster 2 in daycare
 	
 	dwb $d854, %00000001 ; mom saving money ; $8
 	dwb $d854, %10000000 ; dst
--- a/engine/scripting.asm
+++ b/engine/scripting.asm
@@ -1531,8 +1531,7 @@
 ; script command 0x5f
 
 	call Function2879
-	ld a, PREDEF_START_BATTLE
-	call Predef
+	predef StartBattle
 	ld a, [$d0ee]
 	and $3f
 	ld [ScriptVar], a
@@ -1545,7 +1544,7 @@
 ;     byte (SingleByteParam)
 
 	call GetScriptByte
-	ld [$d230], a
+	ld [BattleType], a
 	call Function2879
 	callba Function4e554
 	jp Script_reloadmap
@@ -1573,8 +1572,8 @@
 	ld a, [$d0ee]
 	bit 7, a
 	jr z, .asm_9748e ; 0x97481 $b
-	ld b, $24
-	ld de, $4255
+	ld b, BANK(UnknownScript_0x90255)
+	ld de, UnknownScript_0x90255
 	callba Function97c4f
 .asm_9748e
 	jp Script_reloadmap
@@ -2659,7 +2658,7 @@
 	ld [CurPartySpecies], a
 	call GetScriptByte
 	ld [CurPartyLevel], a
-	callba Functiondf8c
+	callba GiveEgg
 	ret nc
 	ld a, $2
 	ld [ScriptVar], a
--- a/event/dratini.asm
+++ b/event/dratini.asm
@@ -51,8 +51,8 @@
 
 	; get the PP of the new move
 	dec a
-	ld hl, Moves + PlayerMovePP - PlayerMoveStruct
-	ld bc, Move2 - Move1
+	ld hl, Moves + MOVE_PP
+	ld bc, MOVE_LENGTH
 	call AddNTimes
 	ld a, BANK(Moves)
 	call GetFarByte
--- a/event/name_rater.asm
+++ b/event/name_rater.asm
@@ -34,7 +34,7 @@
 	call Functionfb7d3
 	ld hl, UnknownText_0xfb837
 	jr c, .asm_fb76c
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld bc, $000b
 	ld a, [CurPartyMon]
 	call AddNTimes
@@ -70,12 +70,12 @@
 ; fb78a
 
 Functionfb78a: ; fb78a
-	ld hl, PartyMon1OT
-	ld bc, $000b
+	ld hl, PartyMonOT
+	ld bc, NAME_LENGTH
 	ld a, [CurPartyMon]
 	call AddNTimes
 	ld de, PlayerName
-	ld c, $b
+	ld c, NAME_LENGTH
 	call .asm_fb7b1
 	jr c, .asm_fb7bc
 	ld hl, PartyMon1ID
@@ -122,7 +122,7 @@
 ; fb7d3
 
 Functionfb7d3: ; fb7d3
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld bc, $000b
 	ld a, [CurPartyMon]
 	call AddNTimes
--- a/event/poke_seer.asm
+++ b/event/poke_seer.asm
@@ -139,7 +139,7 @@
 
 GetCaughtName: ; 4f176
 	ld a, [CurPartyMon]
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld bc, PKMN_NAME_LENGTH
 	call AddNTimes
 	ld de, $d003
@@ -258,8 +258,8 @@
 
 GetCaughtOT: ; 4f242
 	ld a, [CurPartyMon]
-	ld hl, PartyMon1OT
-	ld bc, $000b
+	ld hl, PartyMonOT
+	ld bc, NAME_LENGTH
 	call AddNTimes
 	ld de, $d02a
 	ld bc, $000b
--- a/gfx/pics/animation.asm
+++ b/gfx/pics/animation.asm
@@ -1007,8 +1007,7 @@
 	push bc
 	push hl
 	ld de, VTiles2
-	ld a, $3e
-	call Predef
+	predef Function5108b
 	pop hl
 	pop bc
 	ld d, $0
--- a/home.asm
+++ b/home.asm
@@ -753,15 +753,14 @@
 
 	ld a, [hCGB]
 	and a
-	jr nz, .dosgb
+	jr nz, .sgb
 	
 	ld a, [hSGB]
 	and a
 	ret z
 	
-.dosgb
-	ld a, $31 ; LoadSGBLayout
-	jp Predef
+.sgb
+	predef_jump Function864c ; LoadSGBLayout
 ; 334e
 
 
@@ -776,7 +775,7 @@
 GetHPPal:: ; 3353
 ; Get palette for hp bar pixel length e in d.
 
-	ld d, 0 ; green
+	ld d, HP_GREEN
 	ld a, e
 	cp 24
 	ret nc
@@ -1583,7 +1582,7 @@
 
 Function3718:: ; 3718
 	ld a, [BattleType]
-	cp $1
+	cp BATTLETYPE_CANLOSE
 	jr .asm_3724
 
 	ld hl, WalkingTile
@@ -1697,22 +1696,21 @@
 Function378b:: ; 378b
 	ld a, [CurPartySpecies]
 	call IsAPokemon
-	jr c, .asm_37ad
+	jr c, .not_pokemon
+
 	push hl
 	ld de, VTiles2
-	ld a, $3c
-	call Predef
+	predef GetFrontpic
 	pop hl
 	xor a
 	ld [$ffad], a
-	ld bc, $0707
-	ld a, $13
-	call Predef
+	lb bc, 7, 7
+	predef FillBox
 	xor a
 	ld [$c2c6], a
 	ret
 
-.asm_37ad
+.not_pokemon
 	xor a
 	ld [$c2c6], a
 	inc a
--- a/home/battle.asm
+++ b/home/battle.asm
@@ -130,8 +130,8 @@
 ; 39d4
 
 UpdateBattleHuds:: ; 39d4
-	callba Function3df48
-	callba Function3e036
+	callba UpdatePlayerHUD
+	callba UpdateEnemyHUD
 	ret
 ; 39e1
 
@@ -139,12 +139,12 @@
 GetBattleVar:: ; 39e1
 ; Preserves hl.
 	push hl
-	call _GetBattleVar
+	call GetBattleVarAddr
 	pop hl
 	ret
 ; 39e7
 
-_GetBattleVar:: ; 39e7
+GetBattleVarAddr:: ; 39e7
 ; Get variable from pair a, depending on whose turn it is.
 ; There are 21 variable pairs.
 
@@ -250,10 +250,10 @@
 	dw PlayerSubStatus4,     EnemySubStatus4
 	dw PlayerSubStatus5,     EnemySubStatus5
 	dw BattleMonStatus,      EnemyMonStatus
-	dw PlayerMoveAnimation,  EnemyMoveAnimation
-	dw PlayerMoveEffect,     EnemyMoveEffect
-	dw PlayerMovePower,      EnemyMovePower
-	dw PlayerMoveType,       EnemyMoveType
+	dw wPlayerMoveStruct + MOVE_ANIM,   wEnemyMoveStruct + MOVE_ANIM
+	dw wPlayerMoveStruct + MOVE_EFFECT, wEnemyMoveStruct + MOVE_EFFECT
+	dw wPlayerMoveStruct + MOVE_POWER,  wEnemyMoveStruct + MOVE_POWER
+	dw wPlayerMoveStruct + MOVE_TYPE,   wEnemyMoveStruct + MOVE_TYPE
 	dw CurPlayerMove,        CurEnemyMove
 	dw LastEnemyCounterMove, LastPlayerCounterMove
 	dw LastPlayerMove,       LastEnemyMove
--- a/home/init.asm
+++ b/home/init.asm
@@ -167,8 +167,7 @@
 
 	call DelayFrame
 
-	ld a, $30
-	call Predef
+	predef Function9853
 
 	call SoundRestart
 	xor a
--- a/home/map.asm
+++ b/home/map.asm
@@ -120,7 +120,7 @@
 	ld e, a
 	ld a, [$d195]
 	ld d, a
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	ld b, $5
 
 .asm_21a5
--- a/home/map_objects.asm
+++ b/home/map_objects.asm
@@ -454,7 +454,7 @@
 Function1a13:: ; 1a13
 	push bc
 	push de
-	ld hl, $d4d6
+	ld hl, ObjectStructs
 	ld de, $0028
 	ld c, $d
 .asm_1a1d
@@ -641,7 +641,7 @@
 
 Function1ae5:: ; 1ae5
 	ld bc, $0028
-	ld hl, $d4d6
+	ld hl, ObjectStructs
 	call AddNTimes
 	ld b, h
 	ld c, l
--- a/home/pokedex_flags.asm
+++ b/home/pokedex_flags.asm
@@ -31,8 +31,7 @@
 
 PokedexFlagAction:: ; 33a1
 	ld d, 0
-	ld a, PREDEF_FLAG
-	call Predef
+	predef FlagPredef
 	ld a, c
 	and a
 	ret
--- a/items/item_descriptions.asm
+++ b/items/item_descriptions.asm
@@ -8,8 +8,7 @@
 	pop hl
 	ld a, [$d265]
 	ld [$cf60], a
-	ld a, $11
-	call Predef
+	predef PrintMoveDesc
 	ret
 
 .nomovedesc
--- a/items/item_effects.asm
+++ b/items/item_effects.asm
@@ -238,10 +238,10 @@
 	ld a, [EnemyMonCatchRate]
 	ld b, a
 	ld a, [BattleType]
-	cp $3
+	cp BATTLETYPE_TUTORIAL
 	jp z, .asm_e99c
 	ld a, [CurItem]
-	cp $1
+	cp MASTER_BALL
 	jp z, .asm_e99c
 	ld a, [CurItem]
 	ld c, a
@@ -274,7 +274,7 @@
 	ld a, b
 	ld [$ffb6], a
 
-	ld hl, EnemyMonHPHi
+	ld hl, EnemyMonHP
 	ld b, [hl]
 	inc hl
 	ld c, [hl]
@@ -366,7 +366,7 @@
 
 .asm_e98e
 	ld b, a
-	ld [MagikarpLength], a
+	ld [Buffer1], a
 	call Random
 
 	cp b
@@ -399,8 +399,7 @@
 	ld [hBattleTurn], a
 	ld [Buffer2], a
 	ld [$cfca], a
-	ld a, $37
-	call Predef
+	predef PlayBattleAnim
 
 	ld a, [$c64e]
 	and a
@@ -449,9 +448,9 @@
 .asm_ea1a
 	set 3, [hl]
 	ld hl, $c6f2
-	ld a, [EnemyMonAtkDefDV]
+	ld a, [EnemyMonDVs]
 	ld [hli], a
-	ld a, [EnemyMonSpdSpclDV]
+	ld a, [EnemyMonDVs + 1]
 	ld [hl], a
 
 .asm_ea27
@@ -478,13 +477,13 @@
 	bit 3, [hl]
 	jr nz, .asm_ea67
 	ld hl, $c735
-	ld de, EnemyMonMove1
-	ld bc, $0004
+	ld de, EnemyMonMoves
+	ld bc, NUM_MOVES
 	call CopyBytes
 
 	ld hl, $c739
-	ld de, EnemyMonPPMove1
-	ld bc, $0004
+	ld de, EnemyMonPP
+	ld bc, NUM_MOVES
 	call CopyBytes
 
 .asm_ea67
@@ -525,8 +524,7 @@
 
 	ld a, [EnemyMonSpecies]
 	ld [$d265], a
-	ld a, $43
-	call Predef
+	predef Functionfb877
 
 .asm_eab7
 	ld a, [BattleType]
@@ -546,8 +544,7 @@
 	ld [MonType], a
 	call ClearSprites
 
-	ld a, $6
-	call Predef
+	predef Functiond88c
 
 	callba Function4db49
 
@@ -579,7 +576,7 @@
 	ld a, [PartyCount]
 	dec a
 	ld [CurPartyMon], a
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld bc, PKMN_NAME_LENGTH
 	call AddNTimes
 
@@ -604,8 +601,7 @@
 .asm_eb3c
 	call ClearSprites
 
-	ld a, $9
-	call Predef
+	predef Functionde6e
 
 	callba Function4db83
 
@@ -1265,8 +1261,7 @@
 	ld a, PartyMon1HPExp - 1 - PartyMon1
 	call GetPartyParamLocation
 	ld b, $1
-	ld a, $c
-	jp Predef
+	predef_jump Functione167
 ; ee9f
 
 Functionee9f: ; ee9f
@@ -1316,11 +1311,11 @@
 ; eeeb
 
 Table_eeeb: ; eeeb
-	db HP_UP,   PartyMon1HPExp   - PartyMon1StatExp
-	db PROTEIN, PartyMon1AtkExp  - PartyMon1StatExp
-	db IRON,    PartyMon1DefExp  - PartyMon1StatExp
-	db CARBOS,  PartyMon1SpdExp  - PartyMon1StatExp
-	db CALCIUM, PartyMon1SpclExp - PartyMon1StatExp
+	db HP_UP,   PartyMon1HPExp  - PartyMon1StatExp
+	db PROTEIN, PartyMon1AtkExp - PartyMon1StatExp
+	db IRON,    PartyMon1DefExp - PartyMon1StatExp
+	db CARBOS,  PartyMon1SpdExp - PartyMon1StatExp
+	db CALCIUM, PartyMon1SpcExp - PartyMon1StatExp
 ; eef5
 
 
@@ -1334,7 +1329,7 @@
 	ld [CurPartyLevel], a
 	call GetBaseData
 	ld a, [CurPartyMon]
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call GetNick
 	ret
 ; 0xef14
@@ -1405,8 +1400,7 @@
 
 	xor a
 	ld [MonType], a
-	ld a, $1f
-	call Predef
+	predef Function5084a
 
 	hlcoord 9, 0
 	ld b, 10
@@ -1415,8 +1409,7 @@
 
 	hlcoord 11, 1
 	ld bc, $0004
-	ld a, $28
-	call Predef
+	predef Function50b7b
 
 	call Functiona80
 
@@ -1424,8 +1417,7 @@
 	ld [MonType], a
 	ld a, [CurPartySpecies]
 	ld [$d265], a
-	ld a, $1a
-	call Predef
+	predef LearnLevelMoves
 
 	xor a
 	ld [$d1e9], a
@@ -1654,8 +1646,7 @@
 	ld d, 0
 	ld hl, $c6fc
 	ld b, CHECK_FLAG
-	ld a, PREDEF_FLAG
-	call Predef
+	predef FlagPredef
 	ld a, c
 	and a
 	jr z, .asm_f104
@@ -1664,8 +1655,7 @@
 	ld c, a
 	ld hl, $c664
 	ld b, SET_FLAG
-	ld a, PREDEF_FLAG
-	call Predef
+	predef FlagPredef
 
 .asm_f104
 	xor a
@@ -1834,8 +1824,7 @@
 	call AddNTimes
 	ld a, $2
 	ld [$d10a], a
-	ld a, $b
-	jp Predef
+	predef_jump Functionc6e0
 
 ; known jump sources: ee11 (3:6e11), ee3f (3:6e3f), ef16 (3:6f16), efaf (3:6faf), efce (3:6fce), f0ab (3:70ab), f0ca (3:70ca), f12a (3:712a), f1ab (3:71ab), f5c7 (3:75c7)
 Functionf1f9: ; f1f9 (3:71f9)
@@ -2367,10 +2356,10 @@
 ; f504
 
 Tablef504: ; f504
-	db X_ATTACK,  0
-	db X_DEFEND,  1
-	db X_SPEED,   2
-	db X_SPECIAL, 3
+	db X_ATTACK,  ATTACK
+	db X_DEFEND,  DEFENSE
+	db X_SPEED,   SPEED
+	db X_SPECIAL, SP_ATTACK
 ; f50c
 
 
@@ -2378,21 +2367,23 @@
 	ld a, [IsInBattle]
 	and a
 	jr nz, .asm_f512
-
 .asm_f512
+
 	xor a
 	ld [$d002], a
-	ld b, $f8
+
+	ld b, $ff ^ SLP
+
 	ld hl, PartyMon1Status
-	call .asm_f554
+	call .Functionf554
 
 	ld a, [IsInBattle]
-	cp $1
+	cp WILD_BATTLE
 	jr z, .asm_f52b
 	ld hl, OTPartyMon1Status
-	call .asm_f554
-
+	call .Functionf554
 .asm_f52b
+
 	ld hl, BattleMonStatus
 	ld a, [hl]
 	and b
@@ -2401,6 +2392,7 @@
 	ld a, [hl]
 	and b
 	ld [hl], a
+
 	ld a, [$d002]
 	and a
 	ld hl, UnknownText_0xf56c
@@ -2411,24 +2403,22 @@
 	ld a, [Danger]
 	and $80
 	jr nz, .asm_f54e
-
 .asm_f54e
 	ld hl, UnknownText_0xf571
 	jp PrintText
 
 
-.asm_f554
-	ld de, $0030
-	ld c, $6
+.Functionf554
+	ld de, PartyMon2 - PartyMon1
+	ld c, PARTY_LENGTH
 
-.asm_f559
+.loop
 	ld a, [hl]
 	push af
-	and $7
+	and SLP
 	jr z, .asm_f564
-	ld a, $1
+	ld a, 1
 	ld [$d002], a
-
 .asm_f564
 	pop af
 	and b
@@ -2435,7 +2425,7 @@
 	ld [hl], a
 	add hl, de
 	dec c
-	jr nz, .asm_f559
+	jr nz, .loop
 	ret
 ; f56c
 
@@ -2633,11 +2623,11 @@
 
 .asm_f677
 	ld a, [CurPartyMon]
-	ld hl, PartyMon1Move1
-	ld bc, $0030
+	ld hl, PartyMon1Moves
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
-	ld de, BattleMonMove1
-	ld b, $4
+	ld de, BattleMonMoves
+	ld b, NUM_MOVES
 .asm_f688
 	ld a, [de]
 	and a
@@ -2647,13 +2637,10 @@
 	push hl
 	push de
 	push bc
+	rept NUM_MOVES + 2 ; BattleMonPP - BattleMonMoves
 	inc de
-	inc de
-	inc de
-	inc de
-	inc de
-	inc de
-	ld bc, $0015
+	endr
+	ld bc, PartyMon1PP - PartyMon1Moves
 	add hl, bc
 	ld a, [hl]
 	ld [de], a
@@ -2682,15 +2669,16 @@
 	ld hl, $cfa9
 	ld [hli], a
 	ld [hl], a
-	ld b, $4
+	ld b, NUM_MOVES
 .asm_f6b7
 	push bc
-	ld hl, PartyMon1Move1
-	ld bc, $0030
+	ld hl, PartyMon1Moves
+	ld bc, PartyMon2 - PartyMon1
 	call Functionf963
 	ld a, [hl]
 	and a
 	jr z, .asm_f6ce
+
 	call Functionf6e8
 	jr z, .asm_f6ce
 	ld hl, $cfaa
@@ -2721,7 +2709,7 @@
 	ld [MonType], a
 	call Functionf8ec
 	ld hl, PartyMon1PP
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call Functionf963
 	ld a, [$d265]
 	ld b, a
@@ -2739,6 +2727,7 @@
 	ld c, 5
 	cp MYSTERYBERRY
 	jr z, .asm_f715
+
 	ld c, 10
 
 .asm_f715
@@ -2972,8 +2961,7 @@
 	ld [$c689], a
 	ld [hBattleTurn], a
 	ld [$cfca], a
-	ld a, $37
-	call Predef
+	predef PlayBattleAnim
 	ld hl, BlockedTheBallText
 	call PrintText
 	ld hl, DontBeAThiefText
@@ -2985,7 +2973,7 @@
 	ld hl, WontHaveAnyEffectText
 	call PrintText
 
-; Item wasn't used.
+	; Item wasn't used.
 	ld a, $2
 	ld [$d0ec], a
 	ret
@@ -3000,7 +2988,7 @@
 	ld hl, Ball_BoxIsFullText
 	call PrintText
 
-; Item wasn't used.
+	; Item wasn't used.
 	ld a, $2
 	ld [$d0ec], a
 	ret
@@ -3116,21 +3104,20 @@
 
 
 Functionf84c: ; f84c
-	ld a, $2
+	ld a, PartyMon1Moves - PartyMon1
 	call GetPartyParamLocation
 	push hl
-	ld de, MagikarpLength
-	ld a, $5
-	call Predef
+	ld de, Buffer1
+	predef FillPP
 	pop hl
-	ld bc, $0015
+	ld bc, PartyMon1PP - PartyMon1Moves
 	add hl, bc
-	ld de, MagikarpLength
-	ld b, $0
+	ld de, Buffer1
+	ld b, 0
 .asm_f864
 	inc b
 	ld a, b
-	cp $5
+	cp NUM_MOVES + 1
 	ret z
 	ld a, [$d265]
 	dec a
@@ -3157,14 +3144,14 @@
 Functionf881: ; f881
 	push bc
 	ld a, [de]
-	ld [$ffb6], a
+	ld [hDividend + 3], a
 	xor a
-	ld [hProduct], a
-	ld [hMultiplicand], a
-	ld [$ffb5], a
-	ld a, $5
-	ld [hMultiplier], a
-	ld b, $4
+	ld [hDividend], a
+	ld [hDividend + 1], a
+	ld [hDividend + 2], a
+	ld a, 5
+	ld [hDivisor], a
+	ld b, 4
 	call Divide
 	ld a, [hl]
 	ld b, a
@@ -3197,17 +3184,17 @@
 ; f8b9
 
 Functionf8b9: ; f8b9
-	ld a, $17
+	ld a, PartyMon1PP - PartyMon1
 	call GetPartyParamLocation
 	push hl
-	ld a, $2
+	ld a, PartyMon1Moves - PartyMon1
 	call GetPartyParamLocation
 	pop de
 	xor a
 	ld [$cfa9], a
 	ld [MonType], a
-	ld c, $4
-.asm_f8ce
+	ld c, NUM_MOVES
+.loop
 	ld a, [hli]
 	and a
 	ret z
@@ -3228,30 +3215,36 @@
 	inc [hl]
 	pop hl
 	dec c
-	jr nz, .asm_f8ce
+	jr nz, .loop
 	ret
 ; f8ec
 
 
 Functionf8ec: ; f8ec
-	ld a, [StringBuffer1]
+	ld a, [StringBuffer1 + 0]
 	push af
-	ld a, [$d074]
+	ld a, [StringBuffer1 + 1]
 	push af
+
 	ld a, [MonType]
 	and a
+
 	ld hl, PartyMon1Moves
 	ld bc, PartyMon2 - PartyMon1
 	jr z, .asm_f91a
+
 	ld hl, OTPartyMon1Moves
 	dec a
 	jr z, .asm_f91a
+
 	ld hl, TempMonMoves
 	dec a
 	jr z, .asm_f915
+
 	ld hl, TempMonMoves
 	dec a
 	jr z, .asm_f915
+
 	ld hl, BattleMonMoves
 
 .asm_f915
@@ -3264,28 +3257,30 @@
 .asm_f91d
 	ld a, [hl]
 	dec a
+
 	push hl
-	ld hl, $5b00
-	ld bc, $0007
+	ld hl, Moves + MOVE_PP
+	ld bc, MOVE_LENGTH
 	call AddNTimes
-	ld a, $10
+	ld a, BANK(Moves)
 	call GetFarByte
 	ld b, a
 	ld de, StringBuffer1
 	ld [de], a
 	pop hl
+
 	push bc
-	ld bc, $0015
+	ld bc, PartyMon1PP - PartyMon1Moves
 	ld a, [MonType]
 	cp WILDMON
 	jr nz, .asm_f942
-	ld bc, $0006
-
+	ld bc, EnemyMonPP - EnemyMonMoves
 .asm_f942
 	add hl, bc
 	ld a, [hl]
 	and $c0
 	pop bc
+
 	or b
 	ld hl, $d074
 	ld [hl], a
@@ -3296,10 +3291,11 @@
 	ld a, [hl]
 	and $3f
 	ld [$d265], a
+
 	pop af
-	ld [$d074], a
+	ld [StringBuffer1 + 1], a
 	pop af
-	ld [StringBuffer1], a
+	ld [StringBuffer1 + 0], a
 	ret
 ; f963
 
@@ -3310,7 +3306,7 @@
 Functionf969: ; f969
 	ld a, [$cfa9]
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ret
 ; f971
--- a/macros.asm
+++ b/macros.asm
@@ -13,6 +13,8 @@
 dex    EQUS "db $e8, $50" ; End a Pokedex entry.
 
 
+percent EQUS "* $ff / 100"
+
 ; macros require rst vectors to be defined
 FarCall    EQU $08
 Bankswitch EQU $10
@@ -118,15 +120,15 @@
 
 
 bccoord: MACRO
-	ld bc, TileMap + SCREEN_WIDTH * \2 + \1
+	ld bc, TileMap + SCREEN_WIDTH * (\2) + (\1)
 	ENDM
 	
 decoord: MACRO
-	ld de, TileMap + SCREEN_WIDTH * \2 + \1
+	ld de, TileMap + SCREEN_WIDTH * (\2) + (\1)
 	ENDM
 
 hlcoord: MACRO
-	ld hl, TileMap + SCREEN_WIDTH * \2 + \1
+	ld hl, TileMap + SCREEN_WIDTH * (\2) + (\1)
 	ENDM
 
 
@@ -194,3 +196,25 @@
 	endr
 ENDM
 
+
+add_predef: MACRO
+\1Predef::
+	dw \1
+	db BANK(\1)
+ENDM
+
+predef_id: MACRO
+; Some functions load the predef id
+; without immediately calling Predef.
+	ld a, (\1Predef - PredefPointers) / 3
+ENDM
+
+predef: MACRO
+	predef_id \1
+	call Predef
+ENDM
+
+predef_jump: MACRO
+	predef_id \1
+	jp Predef
+ENDM
--- a/main.asm
+++ b/main.asm
@@ -17,8 +17,7 @@
 	jr .asm_4017
 
 .asm_4012
-	ld a, $10
-	call Predef
+	predef Function28eef
 
 .asm_4017
 	hlcoord 4, 11
@@ -110,7 +109,7 @@
 	push af
 	ld h, b
 	ld l, c
-	ld bc, $0028
+	ld bc, ObjectStruct2 - ObjectStruct1
 	xor a
 	call ByteFill
 	pop af
@@ -137,12 +136,12 @@
 ; 4386
 
 Function4386: ; 4386
-	ld hl, $0005
+	ld hl, OBJECT_FLAGS
 	add hl, bc
 	res 6, [hl]
 	ld a, [XCoord]
 	ld e, a
-	ld hl, $0010
+	ld hl, OBJECT_MAP_X
 	add hl, bc
 	ld a, [hl]
 	add $1
@@ -152,7 +151,7 @@
 	jr nc, .asm_43b2
 	ld a, [YCoord]
 	ld e, a
-	ld hl, $0011
+	ld hl, OBJECT_MAP_Y
 	add hl, bc
 	ld a, [hl]
 	add $1
@@ -163,7 +162,7 @@
 	jr .asm_43dc
 
 .asm_43b2
-	ld hl, $0005
+	ld hl, OBJECT_FLAGS
 	add hl, bc
 	set 6, [hl]
 	ld a, [XCoord]
@@ -201,7 +200,7 @@
 	ret
 
 .asm_43eb
-	ld hl, $0005
+	ld hl, OBJECT_FLAGS
 	add hl, bc
 	set 6, [hl]
 	and a
@@ -214,7 +213,7 @@
 	ld a, [hl]
 	and a
 	jr z, .asm_4409
-	ld hl, $0005
+	ld hl, OBJECT_FLAGS
 	add hl, bc
 	bit 5, [hl]
 	jr nz, .asm_4426
@@ -224,7 +223,7 @@
 
 .asm_4409
 	call Function47bc
-	ld hl, $0005
+	ld hl, OBJECT_FLAGS
 	add hl, bc
 	bit 5, [hl]
 	jr nz, .asm_4426
@@ -254,7 +253,7 @@
 	bit 0, [hl]
 	jr nz, Function44a3
 
-	ld hl, $0005
+	ld hl, OBJECT_FLAGS
 	add hl, bc
 	bit 6, [hl]
 	jr nz, Function44a3
@@ -970,16 +969,16 @@
 ; 47bc
 
 Function47bc: ; 47bc
-	ld hl, $0010
+	ld hl, OBJECT_MAP_X
 	add hl, bc
 	ld d, [hl]
-	ld hl, $0011
+	ld hl, OBJECT_MAP_Y
 	add hl, bc
 	ld e, [hl]
 	push bc
 	call Function2a3c
 	pop bc
-	ld hl, $000e
+	ld hl, OBJECT_STANDING_TILE
 	add hl, bc
 	ld [hl], a
 	call Function4600
@@ -1554,7 +1553,7 @@
 	add hl, bc
 	ld [hl], $2
 	ld hl, $d4cf
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	cp [hl]
 	jr z, .asm_4b10
 	ld hl, $0009
@@ -2241,10 +2240,10 @@
 	dec [hl]
 	ret nz
 	push bc
-	ld hl, $0010
+	ld hl, OBJECT_MAP_X
 	add hl, bc
 	ld d, [hl]
-	ld hl, $0011
+	ld hl, OBJECT_MAP_Y
 	add hl, bc
 	ld e, [hl]
 	ld hl, $0001
@@ -2253,7 +2252,7 @@
 	ld b, a
 	callba Function807e
 	pop bc
-	ld hl, $0005
+	ld hl, OBJECT_FLAGS
 	add hl, bc
 	res 2, [hl]
 	call Function4600
@@ -2563,7 +2562,7 @@
 	ret z
 	ld a, [$d4cd]
 	ld d, a
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	cp d
 	ret nz
 	ld a, e
@@ -2706,7 +2705,7 @@
 
 Function5579: ; 5579
 	push bc
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	ld c, a
 	call Function5582
 	pop bc
@@ -2714,7 +2713,7 @@
 ; 5582
 
 Function5582: ; 5582
-	ld de, $d4d6
+	ld de, ObjectStructs
 	ld a, $d
 .asm_5587
 	push af
@@ -2729,12 +2728,12 @@
 	jr z, .asm_55a1
 	push bc
 	xor a
-	ld bc, $0028
+	ld bc, ObjectStruct2 - ObjectStruct1
 	call ByteFill
 	pop bc
 
 .asm_55a1
-	ld hl, $0028
+	ld hl, ObjectStruct2 - ObjectStruct1
 	add hl, de
 	ld d, h
 	ld e, l
@@ -2767,7 +2766,7 @@
 	ld [hli], a
 	ld a, [de]
 	ld [hli], a
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	ld [hli], a
 	push hl
 	ld hl, $0010
@@ -2789,20 +2788,20 @@
 	ld a, [VramState]
 	bit 0, a
 	ret z
-	ld bc, $d4d6
+	ld bc, ObjectStructs
 	xor a
 .asm_55ea
-	ld [hConnectionStripLength], a
+	ld [$ffaf], a
 	call Function1af1
 	jr z, .asm_55f4
 	call Function565c
 
 .asm_55f4
-	ld hl, $0028
+	ld hl, ObjectStruct2 - ObjectStruct1
 	add hl, bc
 	ld b, h
 	ld c, l
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	inc a
 	cp $d
 	jr nz, .asm_55ea
@@ -2854,15 +2853,15 @@
 
 Function5645: ; 5645
 	xor a
-	ld bc, $d4d6
+	ld bc, ObjectStructs
 .asm_5649
-	ld [hConnectionStripLength], a
+	ld [$ffaf], a
 	call Function5680
-	ld hl, $0028
+	ld hl, ObjectStruct2 - ObjectStruct1
 	add hl, bc
 	ld b, h
 	ld c, l
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	inc a
 	cp $d
 	jr nz, .asm_5649
@@ -3084,20 +3083,20 @@
 ; 5781
 
 Function5781: ; 5781
-	ld bc, $d4d6
+	ld bc, ObjectStructs
 	xor a
 .asm_5785
-	ld [hConnectionStripLength], a
+	ld [$ffaf], a
 	call Function1af1
 	jr z, .asm_578f
 	call Function437b
 
 .asm_578f
-	ld hl, $0028
+	ld hl, ObjectStruct2 - ObjectStruct1
 	add hl, bc
 	ld b, h
 	ld c, l
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	inc a
 	cp $d
 	jr nz, .asm_5785
@@ -3147,7 +3146,7 @@
 ; 57db
 
 Function57db: ; 57db
-	ld bc, $d4d6
+	ld bc, PlayerStruct
 	call Function1af8
 	ret
 ; 57e2
@@ -3166,7 +3165,7 @@
 	swap a
 	and $7
 	ld d, a
-	ld bc, $d4d6
+	ld bc, PlayerStruct
 	ld hl, $0006
 	add hl, bc
 	ld a, [hl]
@@ -3191,7 +3190,7 @@
 Function5815: ; 5815
 	call Function18de
 	ret c
-	ld a, [hConnectedMapWidth]
+	ld a, [$ffb0]
 	ld [$d4cd], a
 	ret
 ; 581f
@@ -3220,7 +3219,7 @@
 	ld hl, $0009
 	add hl, bc
 	ld [hl], $0
-	ld a, [hConnectedMapWidth]
+	ld a, [$ffb0]
 	ld [$d4ce], a
 	ret
 ; 5847
@@ -3261,7 +3260,7 @@
 ; 587a
 
 Function587a: ; 587a
-	ld bc, $d4d6
+	ld bc, ObjectStructs
 	xor a
 .asm_587e
 	push af
@@ -3272,7 +3271,7 @@
 	set 5, [hl]
 
 .asm_588a
-	ld hl, $0028
+	ld hl, ObjectStruct2 - ObjectStruct1
 	add hl, bc
 	ld b, h
 	ld c, l
@@ -3307,7 +3306,7 @@
 
 Function58b9:: ; 58b9
 	push bc
-	ld bc, $d4d6
+	ld bc, ObjectStructs
 	xor a
 .asm_58be
 	push af
@@ -3318,7 +3317,7 @@
 	res 5, [hl]
 
 .asm_58ca
-	ld hl, $0028
+	ld hl, ObjectStruct2 - ObjectStruct1
 	add hl, bc
 	ld b, h
 	ld c, l
@@ -3430,7 +3429,7 @@
 	ld d, a
 	ld a, [$d14d]
 	ld e, a
-	ld bc, $d4d6
+	ld bc, ObjectStructs
 	ld a, $d
 
 .asm_5968
@@ -3451,7 +3450,7 @@
 	ld [hl], a
 
 .asm_597c
-	ld hl, $0028
+	ld hl, ObjectStruct2 - ObjectStruct1
 	add hl, bc
 	ld b, h
 	ld c, l
@@ -3891,7 +3890,7 @@
 
 	ld a, 1
 	call GetSRAMBank
-	ld hl, BoxCount
+	ld hl, sBoxCount
 	call Function5ca1
 	call CloseSRAM
 	
@@ -3908,16 +3907,16 @@
 	call Function5ca1
 
 	xor a
-	ld [RoamMon1Species], a
-	ld [RoamMon2Species], a
-	ld [RoamMon3Species], a
+	ld [wRoamMon1Species], a
+	ld [wRoamMon2Species], a
+	ld [wRoamMon3Species], a
 	ld a, -1
-	ld [RoamMon1MapGroup], a
-	ld [RoamMon2MapGroup], a
-	ld [RoamMon3MapGroup], a
-	ld [RoamMon1MapNumber], a
-	ld [RoamMon2MapNumber], a
-	ld [RoamMon3MapNumber], a
+	ld [wRoamMon1MapGroup], a
+	ld [wRoamMon2MapGroup], a
+	ld [wRoamMon3MapGroup], a
+	ld [wRoamMon1MapNumber], a
+	ld [wRoamMon2MapNumber], a
+	ld [wRoamMon3MapNumber], a
 
 	ld a, 0
 	call GetSRAMBank
@@ -3977,8 +3976,8 @@
 ; 5ca6
 
 Function5ca6: ; 5ca6
-	ld hl, Box1Name
-	ld c, $0
+	ld hl, wBoxNames
+	ld c, 0
 .asm_5cab
 	push hl
 	ld de, .Box
@@ -3986,22 +3985,22 @@
 	dec hl
 	ld a, c
 	inc a
-	cp $a
+	cp 10
 	jr c, .asm_5cbe
-	sub $a
-	ld [hl], $f7
+	sub 10
+	ld [hl], "1"
 	inc hl
 
 .asm_5cbe
-	add $f6
+	add "0"
 	ld [hli], a
-	ld [hl], $50
+	ld [hl], "@"
 	pop hl
-	ld de, $0009
+	ld de, 9
 	add hl, de
 	inc c
 	ld a, c
-	cp $e
+	cp NUM_BOXES
 	jr c, .asm_5cab
 	ret
 
@@ -4041,18 +4040,14 @@
 	ld de, GreensName
 
 .Copy
-	ld bc, $000b
+	ld bc, NAME_LENGTH
 	call CopyBytes
 	ret
 
-.Rival
-	db "???@"
-.Red
-	db "RED@"
-.Green
-	db "GREEN@"
-.Mom
-	db "MOM@"
+.Rival  db "???@"
+.Red    db "RED@"
+.Green  db "GREEN@"
+.Mom    db "MOM@"
 ; 5d23
 
 Function5d23: ; 5d23
@@ -4677,13 +4672,12 @@
 
 Function619c: ; 619c
 	ld de, VTiles2
-	callba Function5120d
+	callba GetTrainerPic
 	xor a
 	ld [$ffad], a
 	hlcoord 6, 4
 	ld bc, $0707
-	ld a, $13
-	call Predef
+	predef FillBox
 	ret
 ; 61b4
 
@@ -4690,14 +4684,12 @@
 Function61b4: ; 61b4
 	ld de, VTiles2
 	ld c, $31
-	ld a, $40
-	call Predef
+	predef DecompressPredef
 	xor a
 	ld [$ffad], a
 	hlcoord 6, 4
 	ld bc, $0707
-	ld a, $13
-	call Predef
+	predef FillBox
 	ret
 ; 61cd
 
@@ -5255,50 +5247,53 @@
 	ret
 ; 6508
 
-Function6508: ; 6508
+LearnMove: ; 6508
 	call Function309d
 	ld a, [CurPartyMon]
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call GetNick
 	ld hl, StringBuffer1
 	ld de, $d050
-	ld bc, $000b
+	ld bc, PKMN_NAME_LENGTH
 	call CopyBytes
 
-Function6520: ; 6520
-	ld hl, PartyMon1Move1
-	ld bc, $0030
+.loop
+	ld hl, PartyMon1Moves
+	ld bc, PartyMon2 - PartyMon1
 	ld a, [CurPartyMon]
 	call AddNTimes
 	ld d, h
 	ld e, l
-	ld b, $4
-.asm_6530
+	ld b, NUM_MOVES
+.next
 	ld a, [hl]
 	and a
-	jr z, .asm_6564
+	jr z, .learn
 	inc hl
 	dec b
-	jr nz, .asm_6530
+	jr nz, .next
+
 	push de
 	call Function65d3
 	pop de
-	jp c, Function65b5
+	jp c, .cancel
+
 	push hl
 	push de
 	ld [$d265], a
+
 	ld b, a
 	ld a, [IsInBattle]
 	and a
-	jr z, .asm_6559
+	jr z, .not_disabled
 	ld a, [DisabledMove]
 	cp b
-	jr nz, .asm_6559
+	jr nz, .not_disabled
 	xor a
 	ld [DisabledMove], a
 	ld [PlayerDisableCount], a
+.not_disabled
 
-.asm_6559
 	call GetMoveName
 	ld hl, UnknownText_0x6684
 	call PrintText
@@ -5305,61 +5300,66 @@
 	pop de
 	pop hl
 
-.asm_6564
+.learn
 	ld a, [$d262]
 	ld [hl], a
-	ld bc, $0015
+	ld bc, PartyMon1PP - PartyMon1Moves
 	add hl, bc
+
 	push hl
 	push de
 	dec a
 	ld hl, Moves + MOVE_PP
-	ld bc, Move2 - Move1
+	ld bc, MOVE_LENGTH
 	call AddNTimes
 	ld a, BANK(Moves)
 	call GetFarByte
 	pop de
 	pop hl
+
 	ld [hl], a
+
 	ld a, [IsInBattle]
 	and a
-	jp z, Function65ca
+	jp z, .learned
+
 	ld a, [CurPartyMon]
 	ld b, a
 	ld a, [CurBattleMon]
 	cp b
-	jp nz, Function65ca
+	jp nz, .learned
+
 	ld a, [PlayerSubStatus5]
-	bit 3, a
-	jp nz, Function65ca
+	bit SUBSTATUS_TRANSFORMED, a
+	jp nz, .learned
+
 	ld h, d
 	ld l, e
-	ld de, BattleMonMove1
-	ld bc, $0004
+	ld de, BattleMonMoves
+	ld bc, NUM_MOVES
 	call CopyBytes
-	ld bc, $0011
+	ld bc, PartyMon1PP - (PartyMon1Moves + NUM_MOVES)
 	add hl, bc
-	ld de, BattleMonPPMove1
-	ld bc, $0004
+	ld de, BattleMonPP
+	ld bc, NUM_MOVES
 	call CopyBytes
-	jp Function65ca
-; 65b5
+	jp .learned
 
-Function65b5: ; 65b5
+.cancel
 	ld hl, UnknownText_0x6675
 	call PrintText
 	call YesNoBox
-	jp c, Function6520
+	jp c, .loop
+
 	ld hl, UnknownText_0x667a
 	call PrintText
-	ld b, $0
+	ld b, 0
 	ret
-; 65ca
 
-Function65ca: ; 65ca
+.learned
 	ld hl, UnknownText_0x666b
 	call PrintText
-	ld b, $1
+	ld b, 1
 	ret
 ; 65d3
 
@@ -5370,11 +5370,11 @@
 	call YesNoBox
 	pop hl
 	ret c
-	ld bc, $fffc
+	ld bc, -NUM_MOVES
 	add hl, bc
 	push hl
 	ld de, $d25e
-	ld bc, $0004
+	ld bc, NUM_MOVES
 	call CopyBytes
 	pop hl
 .asm_65ee
@@ -5382,14 +5382,13 @@
 	ld hl, UnknownText_0x6670
 	call PrintText
 	hlcoord 5, 2
-	ld b, $8
-	ld c, $d
+	ld b, NUM_MOVES * 2
+	ld c, MOVE_NAME_LENGTH
 	call TextBox
-	hlcoord 7, 4
-	ld a, $28
+	hlcoord 5 + 2, 2 + 2
+	ld a, SCREEN_WIDTH * 2
 	ld [Buffer1], a
-	ld a, $20
-	call Predef
+	predef ListMoves
 	ld a, $4
 	ld [$cfa1], a
 	ld a, $6
@@ -5420,7 +5419,7 @@
 	ld a, [$cfa9]
 	dec a
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [hl]
 	push af
@@ -5474,9 +5473,6 @@
 UnknownText_0x6684: ; 6684
 	text_jump UnknownText_0x1c5740
 	start_asm
-; 6689
-
-; 6689
 	push de
 	ld de, SFX_SWITCH_POKEMON
 	call PlaySFX
@@ -6026,9 +6022,9 @@
 	ld e, a
 
 .asm_6ff1
-	ld bc, $d4d6
+	ld bc, ObjectStructs ; redundant
 	ld a, 0
-	ld [hConnectionStripLength], a
+	ld [$ffaf], a
 	call Function7041
 	ret nc
 	ld hl, $0007
@@ -6056,7 +6052,7 @@
 ; 7015
 
 Function7015: ; 7015
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	call Function1ae5
 	call Function7021
 	call Function7041
@@ -6093,10 +6089,10 @@
 ; 7041
 
 Function7041: ; 7041
-	ld bc, $d4d6
+	ld bc, ObjectStructs
 	xor a
 .asm_7045
-	ld [hConnectedMapWidth], a
+	ld [$ffb0], a
 	call Function1af1
 	jr z, .asm_7093
 	ld hl, $0004
@@ -6112,12 +6108,12 @@
 	jr .asm_7073
 
 .asm_7063
-	ld hl, $0010
+	ld hl, OBJECT_MAP_X
 	add hl, bc
 	ld a, [hl]
 	cp d
 	jr nz, .asm_707b
-	ld hl, $0011
+	ld hl, OBJECT_MAP_Y
 	add hl, bc
 	ld a, [hl]
 	cp e
@@ -6124,35 +6120,35 @@
 	jr nz, .asm_707b
 
 .asm_7073
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	ld l, a
-	ld a, [hConnectedMapWidth]
+	ld a, [$ffb0]
 	cp l
 	jr nz, .asm_70a2
 
 .asm_707b
-	ld hl, $0012
+	ld hl, OBJECT_NEXT_MAP_X
 	add hl, bc
 	ld a, [hl]
 	cp d
 	jr nz, .asm_7093
-	ld hl, $0013
+	ld hl, OBJECT_NEXT_MAP_Y
 	add hl, bc
 	ld a, [hl]
 	cp e
 	jr nz, .asm_7093
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	ld l, a
-	ld a, [hConnectedMapWidth]
+	ld a, [$ffb0]
 	cp l
 	jr nz, .asm_70a2
 
 .asm_7093
-	ld hl, $0028
+	ld hl, ObjectStruct2 - ObjectStruct1
 	add hl, bc
 	ld b, h
 	ld c, l
-	ld a, [hConnectedMapWidth]
+	ld a, [$ffb0]
 	inc a
 	cp $d
 	jr nz, .asm_7045
@@ -6260,10 +6256,10 @@
 	ld d, a
 	ld a, [MapY]
 	ld e, a
-	ld bc, $d4d6
+	ld bc, ObjectStructs
 	xor a
 .asm_711f
-	ld [hConnectedMapWidth], a
+	ld [$ffb0], a
 	call Function1af1
 	jr z, .asm_7160
 	ld hl, $0003
@@ -6276,28 +6272,28 @@
 	jr .asm_7160
 
 .asm_7136
-	ld hl, $0011
+	ld hl, OBJECT_MAP_Y
 	add hl, bc
 	ld a, [hl]
 	cp e
 	jr nz, .asm_714e
-	ld hl, $0010
+	ld hl, OBJECT_MAP_X
 	add hl, bc
 	ld a, [hl]
 	cp d
 	jr nz, .asm_714e
-	ld a, [hConnectedMapWidth]
+	ld a, [$ffb0]
 	cp $0
 	jr z, .asm_7160
 	jr .asm_716f
 
 .asm_714e
-	ld hl, $0013
+	ld hl, OBJECT_NEXT_MAP_Y
 	add hl, bc
 	ld a, [hl]
 	cp e
 	jr nz, .asm_7160
-	ld hl, $0012
+	ld hl, OBJECT_NEXT_MAP_X
 	add hl, bc
 	ld a, [hl]
 	cp d
@@ -6305,11 +6301,11 @@
 	jr .asm_716f
 
 .asm_7160
-	ld hl, $0028
+	ld hl, ObjectStruct2 - ObjectStruct1
 	add hl, bc
 	ld b, h
 	ld c, l
-	ld a, [hConnectedMapWidth]
+	ld a, [$ffb0]
 	inc a
 	cp $d
 	jr nz, .asm_711f
@@ -6457,8 +6453,8 @@
 	db  +5,  +3,  +2
 	db  +5,  +3,  +2
 	db  +1,  +1,  +0
-	db  +3,  +2,  +1
-	db  +1,  +1,  +0
+	db  +3,  +2,  +1 ; Battled a Gym Leader
+	db  +1,  +1,  +0 ; Learned a move
 	db  -1,  -1,  -1
 	db  -5,  -5, -10
 	db  -5,  -5, -10
@@ -6515,7 +6511,7 @@
 
 DaycareStep:: ; 7282
 
-	ld a, [DaycareMan]
+	ld a, [wDaycareMan]
 	bit 0, a
 	jr z, .asm_72a4
 
@@ -6537,7 +6533,7 @@
 	ld [hl], a
 
 .asm_72a4
-	ld a, [DaycareLady]
+	ld a, [wDaycareLady]
 	bit 0, a
 	jr z, .asm_72c6
 
@@ -6559,10 +6555,10 @@
 	ld [hl], a
 
 .asm_72c6
-	ld hl, DaycareMan
+	ld hl, wDaycareMan
 	bit 5, [hl] ; egg
 	ret z
-	ld hl, StepsToEgg
+	ld hl, wStepsToEgg
 	dec [hl]
 	ret nz
 
@@ -6587,7 +6583,7 @@
 	call Random
 	cp b
 	ret nc
-	ld hl, DaycareMan
+	ld hl, wDaycareMan
 	res 5, [hl]
 	set 6, [hl]
 	ret
@@ -6606,8 +6602,7 @@
 	ld a, 15
 	ld [CurPartyLevel], a
 
-	ld a, PREDEF_ADDPARTYMON
-	call Predef
+	predef Functiond88c
 	jr nc, .NotGiven
 
 ; Caught data.
@@ -6636,7 +6631,7 @@
 ; Nickname.
 	ld a, [PartyCount]
 	dec a
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call SkipNames
 	ld de, SpecialShuckleNick
 	call CopyName2
@@ -6644,7 +6639,7 @@
 ; OT.
 	ld a, [PartyCount]
 	dec a
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	call SkipNames
 	ld de, SpecialShuckleOT
 	call CopyName2
@@ -6692,7 +6687,7 @@
 
 ; OT
 	ld a, [CurPartyMon]
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	call SkipNames
 	ld de, SpecialShuckleOT
 .CheckOT
@@ -6828,7 +6823,8 @@
 	jp CopyBytes
 ; 747a
 
-Function747a: ; 747a
+Predef1: ; 747a
+; not used
 	ret
 ; 747b
 
@@ -6842,11 +6838,11 @@
 	call WhiteBGMap
 	call ClearSprites
 	ld hl, TileMap
-	ld bc, $0168
+	ld bc, TileMapEnd - TileMap
 	ld a, " "
 	call ByteFill
 	ld hl, AttrMap
-	ld bc, $0168
+	ld bc, AttrMapEnd - AttrMap
 	ld a, $7
 	call ByteFill
 	call Function3200
@@ -6859,7 +6855,7 @@
 	ld [$d4cd], a
 	ld [$d4ce], a
 	ld a, $0
-	ld hl, Data8071
+	ld hl, PlayerObjectTemplate
 	call Function19a6
 	ld b, $0
 	call Function808f
@@ -6879,11 +6875,11 @@
 .asm_8059
 	ld [hl], e
 	ld a, $0
-	ld [hConnectionStripLength], a
+	ld [$ffaf], a
 	ld bc, MapObjects
 	ld a, $0
-	ld [hConnectedMapWidth], a
-	ld de, $d4d6
+	ld [$ffb0], a
+	ld de, ObjectStructs
 	call Function8116
 	ld a, $0
 	ld [$d4cf], a
@@ -6890,7 +6886,7 @@
 	ret
 ; 8071
 
-Data8071: ; 8071
+PlayerObjectTemplate: ; 8071
 ; A dummy map object used to initialize the player object.
 ; Shorter than the actual amount copied by two bytes.
 ; Said bytes seem to be unused.
@@ -6935,7 +6931,7 @@
 	ld hl, $0011
 	add hl, bc
 	ld e, [hl]
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	ld b, a
 	call Function807e
 	and a
@@ -6976,16 +6972,16 @@
 	call Function2707
 	and a
 	ret nz
-	ld hl, $d4fe
-	ld a, $1
-	ld de, $0028
+	ld hl, ObjectStructs + (ObjectStruct2 - ObjectStruct1) * 1
+	ld a, 1
+	ld de, ObjectStruct2 - ObjectStruct1
 .asm_80f4
-	ld [hConnectedMapWidth], a
+	ld [$ffb0], a
 	ld a, [hl]
 	and a
 	jr z, .asm_8104
 	add hl, de
-	ld a, [hConnectedMapWidth]
+	ld a, [$ffb0]
 	inc a
 	cp $d
 	jr nz, .asm_80f4
@@ -7012,11 +7008,11 @@
 ; 811d
 
 Function811d: ; 811d
-	ld a, [hConnectedMapWidth]
+	ld a, [$ffb0]
 	ld hl, $0000
 	add hl, bc
 	ld [hl], a
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	ld [$c2f0], a
 	ld hl, $0001
 	add hl, bc
@@ -7064,7 +7060,7 @@
 	ld bc, $d72e
 	ld a, $1
 .asm_817c
-	ld [hConnectionStripLength], a
+	ld [$ffaf], a
 	ld hl, $0001
 	add hl, bc
 	ld a, [hl]
@@ -7105,7 +7101,7 @@
 	add hl, bc
 	ld b, h
 	ld c, l
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	inc a
 	cp $10
 	jr nz, .asm_817c
@@ -7149,7 +7145,7 @@
 	ld bc, $d72e
 	ld a, $1
 .asm_81f4
-	ld [hConnectionStripLength], a
+	ld [$ffaf], a
 	ld hl, $0001
 	add hl, bc
 	ld a, [hl]
@@ -7184,7 +7180,7 @@
 	add hl, bc
 	ld b, h
 	ld c, l
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	inc a
 	cp $10
 	jr nz, .asm_81f4
@@ -7207,7 +7203,7 @@
 	ld bc, $d72e
 	ld a, $1
 .asm_8248
-	ld [hConnectionStripLength], a
+	ld [$ffaf], a
 	ld hl, $0001
 	add hl, bc
 	ld a, [hl]
@@ -7242,7 +7238,7 @@
 	add hl, bc
 	ld b, h
 	ld c, l
-	ld a, [hConnectionStripLength]
+	ld a, [$ffaf]
 	inc a
 	cp $10
 	jr nz, .asm_8248
@@ -7499,7 +7495,7 @@
 	ld hl, $0018
 	add hl, de
 	ld [hl], a
-	ld a, [hConnectedMapWidth]
+	ld a, [$ffb0]
 	ld hl, $0020
 	add hl, de
 	ld [hl], a
@@ -7754,84 +7750,84 @@
 	ret
 ; 856b
 
-PredefPointers: ; 856b
+PredefPointers:: ; 856b
 ; $4b Predef pointers
 ; address, bank
 
-	dwb Function6508, BANK(Function6508) ; $0
-	dwb Function747a, BANK(Function747a)
-	dwb Functionc658, BANK(Functionc658)
-	dwb FlagPredef, BANK(FlagPredef)
-	dwb Functionc699, BANK(Functionc699)
-	dwb FillPP, BANK(FillPP)
-	dwb Functiond88c, BANK(Functiond88c)
-	dwb Functionda96, BANK(Functionda96)
-	dwb Functiondb3f, BANK(Functiondb3f) ; $8
-	dwb Functionde6e, BANK(Functionde6e)
-	dwb Functiondf8c, BANK(Functiondf8c)
-	dwb Functionc6e0, BANK(Functionc6e0)
-	dwb Functione167, BANK(Functione167)
-	dwb Functione17b, BANK(Functione17b)
-	dwb CanLearnTMHMMove, BANK(CanLearnTMHMMove)
-	dwb GetTMHMMove, BANK(GetTMHMMove)
-	dwb Function28eef, BANK(Function28eef) ; $ 10
-	dwb PrintMoveDesc, BANK(PrintMoveDesc)
-	dwb Function3df48, BANK(Function3df48) ; UpdatePlayerHUD
-	dwb FillBox, BANK(FillBox)
-	dwb Function3d873, BANK(Function3d873)
-	dwb Function3e036, BANK(Function3e036) ; UpdateEnemyHUD
-	dwb StartBattle, BANK(StartBattle)
-	dwb FillInExpBar, BANK(FillInExpBar)
-	dwb Function3f43d, BANK(Function3f43d) ; $18
-	dwb Function3f47c, BANK(Function3f47c)
-	dwb Function42487, BANK(Function42487)
-	dwb FillMoves, BANK(FillMoves)
-	dwb Function421e6, BANK(Function421e6)
-	dwb Function28f63, BANK(Function28f63)
-	dwb Function28f24, BANK(Function28f24)
-	dwb Function5084a, BANK(Function5084a)
-	dwb Function50d6f, BANK(Function50d6f) ; $20
-	dwb Function50d2e, BANK(Function50d2e)
-	dwb Function50cdb, BANK(Function50cdb)
-	dwb Function50c50, BANK(Function50c50)
-	dwb GetGender, BANK(GetGender)
-	dwb StatsScreenInit, BANK(StatsScreenInit)
-	dwb DrawPlayerHP, BANK(DrawPlayerHP)
-	dwb DrawEnemyHP, BANK(DrawEnemyHP)
-	dwb Function50b7b, BANK(Function50b7b) ; $28
-	dwb GetTypeName, BANK(GetTypeName)
-	dwb PrintMoveType, BANK(PrintMoveType)
-	dwb PrintType, BANK(PrintType)
-	dwb PrintMonTypes, BANK(PrintMonTypes)
-	dwb GetUnownLetter, BANK(GetUnownLetter)
-	dwb Functioncbcdd, BANK(Functioncbcdd)
-	dwb Predef2F, BANK(Predef2F)
-	dwb Function9853, BANK(Function9853) ; $30
-	dwb Function864c, BANK(Function864c)
-	dwb Function91d11, BANK(Function91d11)
-	dwb CheckContestMon, BANK(CheckContestMon)
-	dwb Function8c20f, BANK(Function8c20f)
-	dwb Function8c000, BANK(Function8c000)
-	dwb Function8c000, BANK(Function8c000)
-	dwb PlayBattleAnim, BANK(PlayBattleAnim)
-	dwb Predef38, BANK(Predef38) ; $38
-	dwb Predef39, BANK(Predef39)
-	dwb Functionfd1d0, BANK(Functionfd1d0)
-	dwb PartyMonItemName, BANK(PartyMonItemName)
-	dwb Function51077, BANK(Function51077)
-	dwb Function5116c, BANK(Function5116c)
-	dwb Function5108b, BANK(Function5108b)
-	dwb Function5120d, BANK(Function5120d)
-	dwb DecompressPredef, BANK(DecompressPredef) ; $40
-	dwb Function347d3, BANK(Function347d3)
-	dwb Functionfb908, BANK(Functionfb908)
-	dwb Functionfb877, BANK(Functionfb877)
-	dwb Functiond0000, BANK(Functiond0000)
-	dwb Function50d0a, BANK(Function50d0a)
-	dwb Functiond00a3, BANK(Functiond00a3)
-	dwb Functiond008e, BANK(Functiond008e)
-	dwb Functiond0669, BANK(Functiond0669) ; $48
-	dwb Functiond066e, BANK(Functiond066e)
+	add_predef LearnMove ; $0
+	add_predef Predef1
+	add_predef Functionc658
+	add_predef FlagPredef
+	add_predef Functionc699
+	add_predef FillPP
+	add_predef Functiond88c
+	add_predef Functionda96
+	add_predef Functiondb3f ; $8
+	add_predef Functionde6e
+	add_predef GiveEgg
+	add_predef Functionc6e0
+	add_predef Functione167
+	add_predef Functione17b
+	add_predef CanLearnTMHMMove
+	add_predef GetTMHMMove
+	add_predef Function28eef ; $ 10
+	add_predef PrintMoveDesc
+	add_predef UpdatePlayerHUD
+	add_predef FillBox
+	add_predef Function3d873
+	add_predef UpdateEnemyHUD
+	add_predef StartBattle
+	add_predef FillInExpBar
+	add_predef Function3f43d ; $18
+	add_predef Function3f47c
+	add_predef LearnLevelMoves
+	add_predef FillMoves
+	add_predef Function421e6
+	add_predef Function28f63
+	add_predef Function28f24
+	add_predef Function5084a
+	add_predef ListMoves ; $20
+	add_predef Function50d2e
+	add_predef Function50cdb
+	add_predef Function50c50
+	add_predef GetGender
+	add_predef StatsScreenInit
+	add_predef DrawPlayerHP
+	add_predef DrawEnemyHP
+	add_predef Function50b7b ; $28
+	add_predef GetTypeName
+	add_predef PrintMoveType
+	add_predef PrintType
+	add_predef PrintMonTypes
+	add_predef GetUnownLetter
+	add_predef Functioncbcdd
+	add_predef Predef2F
+	add_predef Function9853 ; $30
+	add_predef Function864c
+	add_predef Function91d11
+	add_predef CheckContestMon
+	add_predef Function8c20f
+	add_predef Function8c000
+	add_predef Function8c000_2
+	add_predef PlayBattleAnim
+	add_predef Predef38 ; $38
+	add_predef Predef39
+	add_predef Functionfd1d0
+	add_predef PartyMonItemName
+	add_predef GetFrontpic
+	add_predef GetBackpic
+	add_predef Function5108b
+	add_predef GetTrainerPic
+	add_predef DecompressPredef ; $40
+	add_predef Function347d3
+	add_predef Functionfb908
+	add_predef Functionfb877
+	add_predef Functiond0000
+	add_predef Function50d0a
+	add_predef Functiond00a3
+	add_predef Functiond008e
+	add_predef Functiond0669 ; $48
+	add_predef Functiond066e
 	dbw $ff, Function2d43 ; ????
 ; 864c
 
@@ -8503,33 +8499,42 @@
 	ld [ScriptVar], a
 	jp CloseSRAM
 
+
 _PrintNum:: ; c4c7
+; Print c digits of the b-byte value at hl.
+; Allows 2 to 7 digits. For 1-digit numbers, add
+; the value to char "0" instead of calling PrintNum.
+; Some extra flags can be given in bits 5-7 of b.
+
 	push bc
+
 	bit 5, b
-	jr z, .asm_c4d9
+	jr z, .main
 	bit 7, b
-	jr nz, .asm_c4d4
+	jr nz, .bit_7
 	bit 6, b
-	jr z, .asm_c4d9
+	jr z, .main
 
-.asm_c4d4
+.bit_7
 	ld a, $f0
 	ld [hli], a
 	res 5, b
 
-.asm_c4d9
+.main
 	xor a
-	ld [hProduct], a
-	ld [hMultiplicand], a
+	ld [$ffb3], a
+	ld [$ffb4], a
 	ld [$ffb5], a
 	ld a, b
 	and $f
-	cp $1
-	jr z, .asm_c501
-	cp $2
-	jr z, .asm_c4f8
+	cp 1
+	jr z, .byte
+	cp 2
+	jr z, .word
+
+.long
 	ld a, [de]
-	ld [hMultiplicand], a
+	ld [$ffb4], a
 	inc de
 	ld a, [de]
 	ld [$ffb5], a
@@ -8536,22 +8541,23 @@
 	inc de
 	ld a, [de]
 	ld [$ffb6], a
-	jr .asm_c504
+	jr .start
 
-.asm_c4f8
+.word
 	ld a, [de]
 	ld [$ffb5], a
 	inc de
 	ld a, [de]
 	ld [$ffb6], a
-	jr .asm_c504
+	jr .start
 
-.asm_c501
+.byte
 	ld a, [de]
 	ld [$ffb6], a
 
-.asm_c504
+.start
 	push de
+
 	ld d, b
 	ld a, c
 	swap a
@@ -8560,123 +8566,126 @@
 	ld a, c
 	and $f
 	ld b, a
-	ld c, $0
-	cp $2
-	jr z, .asm_c57c
-	cp $3
-	jr z, .asm_c56c
-	cp $4
-	jr z, .asm_c55b
-	cp $5
-	jr z, .asm_c54a
-	cp $6
-	jr z, .asm_c538
-	ld a, $f
-	ld [hMultiplier], a
-	ld a, $42
-	ld [hMathBuffer], a
-	ld a, $40
+	ld c, 0
+	cp 2
+	jr z, .two
+	cp 3
+	jr z, .three
+	cp 4
+	jr z, .four
+	cp 5
+	jr z, .five
+	cp 6
+	jr z, .six
+
+.seven
+	ld a, 1000000 / $10000 % $100
+	ld [$ffb7], a
+	ld a, 1000000 / $100 % $100
+	ld [$ffb8], a
+	ld a, 1000000 % $100
 	ld [$ffb9], a
-	call Functionc5cb
-	call PrintNumber_AdvancePointer
+	call .PrintDigit
+	call .AdvancePointer
 
-.asm_c538
-	ld a, $1
-	ld [hMultiplier], a
-	ld a, $86
-	ld [hMathBuffer], a
-	ld a, $a0
+.six
+	ld a, 100000 / $10000 % $100
+	ld [$ffb7], a
+	ld a, 100000 / $100 % $100
+	ld [$ffb8], a
+	ld a, 100000 % $100
 	ld [$ffb9], a
-	call Functionc5cb
-	call PrintNumber_AdvancePointer
+	call .PrintDigit
+	call .AdvancePointer
 
-.asm_c54a
+.five
 	xor a
-	ld [hMultiplier], a
-	ld a, $27
-	ld [hMathBuffer], a
-	ld a, $10
+	ld [$ffb7], a
+	ld a, 10000 / $100
+	ld [$ffb8], a
+	ld a, 10000 % $100
 	ld [$ffb9], a
-	call Functionc5cb
-	call PrintNumber_AdvancePointer
+	call .PrintDigit
+	call .AdvancePointer
 
-.asm_c55b
+.four
 	xor a
-	ld [hMultiplier], a
-	ld a, $3
-	ld [hMathBuffer], a
-	ld a, $e8
+	ld [$ffb7], a
+	ld a, 1000 / $100
+	ld [$ffb8], a
+	ld a, 1000 % $100
 	ld [$ffb9], a
-	call Functionc5cb
-	call PrintNumber_AdvancePointer
+	call .PrintDigit
+	call .AdvancePointer
 
-.asm_c56c
+.three
 	xor a
-	ld [hMultiplier], a
+	ld [$ffb7], a
 	xor a
-	ld [hMathBuffer], a
-	ld a, $64
+	ld [$ffb8], a
+	ld a, 100
 	ld [$ffb9], a
-	call Functionc5cb
-	call PrintNumber_AdvancePointer
+	call .PrintDigit
+	call .AdvancePointer
 
-.asm_c57c
+.two
 	dec e
 	jr nz, .asm_c583
 	ld a, $f6
-	ld [hProduct], a
-
+	ld [$ffb3], a
 .asm_c583
-	ld c, $0
+
+	ld c, 0
 	ld a, [$ffb6]
-.asm_c587
-	cp $a
-	jr c, .asm_c590
-	sub $a
+.mod_10
+	cp 10
+	jr c, .modded_10
+	sub 10
 	inc c
-	jr .asm_c587
+	jr .mod_10
+.modded_10
 
-.asm_c590
 	ld b, a
-	ld a, [hProduct]
+	ld a, [$ffb3]
 	or c
 	jr nz, .asm_c59b
-	call PrintNumber_PrintLeadingZero
+	call .PrintLeadingZero
 	jr .asm_c5ad
 
 .asm_c59b
-	call Functionc5ba
+	call .PrintYen
 	push af
-	ld a, $f6
+	ld a, "0"
 	add c
 	ld [hl], a
 	pop af
-	ld [hProduct], a
+	ld [$ffb3], a
 	inc e
 	dec e
 	jr nz, .asm_c5ad
 	inc hl
-	ld [hl], $f2
+	ld [hl], $f2 ; XXX
 
 .asm_c5ad
-	call PrintNumber_AdvancePointer
-	call Functionc5ba
-	ld a, $f6
+	call .AdvancePointer
+	call .PrintYen
+	ld a, "0"
 	add b
 	ld [hli], a
+
 	pop de
 	pop bc
 	ret
 ; c5ba
 
-Functionc5ba: ; c5ba
+.PrintYen: ; c5ba
 	push af
-	ld a, [hProduct]
+	ld a, [$ffb3]
 	and a
 	jr nz, .asm_c5c9
 	bit 5, d
 	jr z, .asm_c5c9
-	ld a, $f0
+	ld a, "¥"
 	ld [hli], a
 	res 5, d
 
@@ -8685,76 +8694,72 @@
 	ret
 ; c5cb
 
-
-; known jump sources: c532 (3:4532), c544 (3:4544), c555 (3:4555), c566 (3:4566), c576 (3:4576)
-Functionc5cb: ; c5cb (3:45cb)
+.PrintDigit: ; c5cb (3:45cb)
 	dec e
-	jr nz, PrintNumber_PrintDigit
+	jr nz, .ok
 	ld a, $f6
-	ld [hPastLeadingZeroes], a ; $ff00+$b3 (aliases: hDividend, hProduct)
-
-; known jump sources: c5cc (3:45cc)
-PrintNumber_PrintDigit: ; c5d2 (3:45d2)
+	ld [$ffb3], a
+.ok
 	ld c, $0
 .asm_c5d4
-	ld a, [hDivisor] ; $ff00+$b7 (aliases: hMultiplier)
+	ld a, [$ffb7]
 	ld b, a
-	ld a, [hQuotient] ; $ff00+$b4 (aliases: hMultiplicand)
-	ld [$FF00+$ba], a
+	ld a, [$ffb4]
+	ld [$ffba], a
 	cp b
 	jr c, .asm_c624
 	sub b
-	ld [hQuotient], a ; $ff00+$b4 (aliases: hMultiplicand)
-	ld a, [hMathBuffer] ; $ff00+$b8
+	ld [$ffb4], a
+	ld a, [$ffb8]
 	ld b, a
-	ld a, [$FF00+$b5]
-	ld [$FF00+$bb], a
+	ld a, [$ffb5]
+	ld [$ffbb], a
 	cp b
 	jr nc, .asm_c5f6
-	ld a, [hQuotient] ; $ff00+$b4 (aliases: hMultiplicand)
+	ld a, [$ffb4]
 	or $0
 	jr z, .asm_c620
 	dec a
-	ld [hQuotient], a ; $ff00+$b4 (aliases: hMultiplicand)
-	ld a, [$FF00+$b5]
+	ld [$ffb4], a
+	ld a, [$ffb5]
 .asm_c5f6
 	sub b
-	ld [$FF00+$b5], a
-	ld a, [$FF00+$b9]
+	ld [$ffb5], a
+	ld a, [$ffb9]
 	ld b, a
-	ld a, [$FF00+$b6]
-	ld [$FF00+$bc], a
+	ld a, [$ffb6]
+	ld [$ffbc], a
 	cp b
 	jr nc, .asm_c616
-	ld a, [$FF00+$b5]
+	ld a, [$ffb5]
 	and a
 	jr nz, .asm_c611
-	ld a, [hQuotient] ; $ff00+$b4 (aliases: hMultiplicand)
+	ld a, [$ffb4]
 	and a
 	jr z, .asm_c61c
 	dec a
-	ld [hQuotient], a ; $ff00+$b4 (aliases: hMultiplicand)
+	ld [$ffb4], a
 	xor a
 .asm_c611
 	dec a
-	ld [$FF00+$b5], a
-	ld a, [$FF00+$b6]
+	ld [$ffb5], a
+	ld a, [$ffb6]
 .asm_c616
 	sub b
-	ld [$FF00+$b6], a
+	ld [$ffb6], a
 	inc c
 	jr .asm_c5d4
 .asm_c61c
-	ld a, [$FF00+$bb]
-	ld [$FF00+$b5], a
+	ld a, [$ffbb]
+	ld [$ffb5], a
 .asm_c620
-	ld a, [$FF00+$ba]
-	ld [hQuotient], a ; $ff00+$b4 (aliases: hMultiplicand)
+	ld a, [$ffba]
+	ld [$ffb4], a
 .asm_c624
-	ld a, [hPastLeadingZeroes] ; $ff00+$b3 (aliases: hDividend, hProduct)
+	ld a, [$ffb3]
 	or c
-	jr z, PrintNumber_PrintLeadingZero
-	ld a, [hPastLeadingZeroes] ; $ff00+$b3 (aliases: hDividend, hProduct)
+	jr z, .PrintLeadingZero
+	ld a, [$ffb3]
 	and a
 	jr nz, .asm_c637
 	bit 5, d
@@ -8766,7 +8771,7 @@
 	ld a, $f6
 	add c
 	ld [hl], a
-	ld [hPastLeadingZeroes], a ; $ff00+$b3 (aliases: hDividend, hProduct)
+	ld [$ffb3], a
 	inc e
 	dec e
 	ret nz
@@ -8774,7 +8779,7 @@
 	ld [hl], $f2
 	ret
 
-PrintNumber_PrintLeadingZero: ; c644
+.PrintLeadingZero: ; c644
 ; prints a leading zero unless they are turned off in the flags
 	bit 7, d ; print leading zeroes?
 	ret z
@@ -8781,57 +8786,60 @@
 	ld [hl], "0"
 	ret
 
-PrintNumber_AdvancePointer: ; c64a
+.AdvancePointer: ; c64a
 ; increments the pointer unless leading zeroes are not being printed,
 ; the number is left-aligned, and no nonzero digits have been printed yet
 	bit 7, d ; print leading zeroes?
-	jr nz, .incrementPointer
+	jr nz, .inc
 	bit 6, d ; left alignment or right alignment?
-	jr z, .incrementPointer
-	ld a, [hPastLeadingZeroes]
+	jr z, .inc
+	ld a, [$ffb3]
 	and a
 	ret z
-.incrementPointer
+.inc
 	inc hl
 	ret
-; 0xc658
+; c658
 
+
 Functionc658: ; c658
 	xor a
 	ld [CurPartyMon], a
 	ld hl, PartySpecies
-.asm_c65f
+.loop
 	ld a, [hli]
 	cp $ff
-	jr z, .asm_c676
-	cp $fd
-	jr z, .asm_c66d
+	jr z, .done
+	cp EGG
+	jr z, .next
+
 	push hl
 	call Functionc677
 	pop hl
 
-.asm_c66d
+.next
 	ld a, [CurPartyMon]
 	inc a
 	ld [CurPartyMon], a
-	jr .asm_c65f
+	jr .loop
 
-.asm_c676
+.done
 	ret
 ; c677
 
 Functionc677: ; c677
-	ld a, $0
+	ld a, PartyMon1Species - PartyMon1
 	call GetPartyParamLocation
 	ld d, h
 	ld e, l
-	ld hl, $0020
+	ld hl, PartyMon1Status - PartyMon1Species 
 	add hl, de
 	xor a
 	ld [hli], a
 	ld [hl], a
-	ld hl, $0024
+	ld hl, PartyMon1MaxHP - PartyMon1Species
 	add hl, de
+	; bc = PartyMon1HP - PartyMon1Species
 	ld b, h
 	ld c, l
 	dec bc
@@ -8929,7 +8937,7 @@
 
 GetPartyNick: ; c706
 ; write CurPartyMon nickname to StringBuffer1-3
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld a, BOXMON
 	ld [MonType], a
 	ld a, [CurPartyMon]
@@ -10431,7 +10439,7 @@
 Functioncf0d: ; cf0d
 	callba CheckFacingObject
 	jr nc, .asm_cf2c
-	ld a, [hConnectedMapWidth]
+	ld a, [$ffb0]
 	call Function1ae5
 	ld hl, $0001
 	add hl, bc
@@ -10579,7 +10587,7 @@
 	ld [$d22e], a
 	ld a, e
 	ld [CurPartyLevel], a
-	ld a, $4
+	ld a, BATTLETYPE_FISH
 	ld [BattleType], a
 	ld a, $2
 	ret
@@ -12311,7 +12319,7 @@
 .asm_d899
 	ld a, [de]
 	inc a
-	cp $7
+	cp PARTY_LENGTH + 1
 	ret nc
 	ld [de], a
 	ld a, [de]
@@ -12327,11 +12335,11 @@
 	inc de
 	ld a, $ff
 	ld [de], a
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	ld a, [MonType]
 	and $f
 	jr z, .asm_d8bc
-	ld hl, OTPartyMon1OT
+	ld hl, OTPartyMonOT
 
 .asm_d8bc
 	ld a, [$ffae]
@@ -12340,7 +12348,7 @@
 	ld d, h
 	ld e, l
 	ld hl, PlayerName
-	ld bc, $000b
+	ld bc, NAME_LENGTH
 	call CopyBytes
 	ld a, [MonType]
 	and a
@@ -12348,7 +12356,7 @@
 	ld a, [CurPartySpecies]
 	ld [$d265], a
 	call GetPokemonName
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld a, [$ffae]
 	dec a
 	call SkipNames
@@ -12355,7 +12363,7 @@
 	ld d, h
 	ld e, l
 	ld hl, StringBuffer1
-	ld bc, $000b
+	ld bc, PKMN_NAME_LENGTH
 	call CopyBytes
 
 .asm_d8f0
@@ -12368,7 +12376,7 @@
 .asm_d8fd
 	ld a, [$ffae]
 	dec a
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 Functiond906: ; d906
 	ld e, l
@@ -12398,29 +12406,24 @@
 	ld a, [MonType]
 	and a
 	jr nz, .asm_d943
-	ld de, EnemyMonMove1
+	ld de, EnemyMonMoves
+	rept NUM_MOVES + -1
 	ld a, [de]
 	inc de
 	ld [hli], a
+	endr
 	ld a, [de]
-	inc de
-	ld [hli], a
-	ld a, [de]
-	inc de
-	ld [hli], a
-	ld a, [de]
 	ld [hl], a
 	jr .asm_d950
 
 .asm_d943
 	xor a
+	rept NUM_MOVES + -1
 	ld [hli], a
-	ld [hli], a
-	ld [hli], a
+	endr
 	ld [hl], a
 	ld [Buffer1], a
-	ld a, $1b
-	call Predef
+	predef FillMoves
 
 .asm_d950
 	pop de
@@ -12536,15 +12539,16 @@
 	jr .asm_da29
 
 .asm_d9f3
-	ld a, [EnemyMonAtkDefDV]
+	ld a, [EnemyMonDVs]
 	ld [de], a
 	inc de
-	ld a, [EnemyMonSpdSpclDV]
+	ld a, [EnemyMonDVs + 1]
 	ld [de], a
 	inc de
+
 	push hl
-	ld hl, EnemyMonPPMove1
-	ld b, $4
+	ld hl, EnemyMonPP
+	ld b, NUM_MOVES
 .asm_da03
 	ld a, [hli]
 	ld [de], a
@@ -12552,7 +12556,8 @@
 	dec b
 	jr nz, .asm_da03
 	pop hl
-	ld a, $46
+
+	ld a, BASE_HAPPINESS
 	ld [de], a
 	inc de
 	xor a
@@ -12583,7 +12588,7 @@
 	ld a, [IsInBattle]
 	dec a
 	jr nz, .asm_da3b
-	ld hl, EnemyMonMaxHPHi
+	ld hl, EnemyMonMaxHP
 	ld bc, $000c
 	call CopyBytes
 	pop hl
@@ -12601,15 +12606,14 @@
 	and $f
 	jr nz, .asm_da6b
 	ld a, [CurPartySpecies]
-	cp $c9
+	cp UNOWN
 	jr nz, .asm_da6b
 	ld hl, PartyMon1DVs
 	ld a, [PartyCount]
 	dec a
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
-	ld a, $2d
-	call Predef
+	predef GetUnownLetter
 	callab Functionfba18
 
 .asm_da6b
@@ -12629,7 +12633,7 @@
 	push de
 	push bc
 	ld hl, Moves
-	ld bc, Move2 - Move1
+	ld bc, MOVE_LENGTH
 	call AddNTimes
 	ld de, StringBuffer1
 	ld a, BANK(Moves)
@@ -12651,13 +12655,13 @@
 Functionda96: ; da96
 	ld hl, PartyCount
 	ld a, [hl]
-	cp $6
+	cp PARTY_LENGTH
 	scf
 	ret z
 	inc a
 	ld [hl], a
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [CurPartySpecies]
 	ld [hli], a
@@ -12665,66 +12669,66 @@
 	ld hl, PartyMon1Species
 	ld a, [PartyCount]
 	dec a
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	ld e, l
 	ld d, h
 	ld hl, TempMonSpecies
 	call CopyBytes
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	ld a, [PartyCount]
 	dec a
 	call SkipNames
 	ld d, h
 	ld e, l
-	ld hl, OTPartyMon1OT
+	ld hl, OTPartyMonOT
 	ld a, [CurPartyMon]
 	call SkipNames
-	ld bc, $000b
+	ld bc, NAME_LENGTH
 	call CopyBytes
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld a, [PartyCount]
 	dec a
 	call SkipNames
 	ld d, h
 	ld e, l
-	ld hl, OTPartyMon1Nickname
+	ld hl, OTPartyMonNicknames
 	ld a, [CurPartyMon]
 	call SkipNames
-	ld bc, $000b
+	ld bc, PKMN_NAME_LENGTH
 	call CopyBytes
+
 	ld a, [CurPartySpecies]
 	ld [$d265], a
-	cp $fd
-	jr z, .asm_db12
+	cp EGG
+	jr z, .owned
 	dec a
 	call SetSeenAndCaughtMon
 	ld hl, PartyMon1Happiness
 	ld a, [PartyCount]
 	dec a
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
-	ld [hl], $46
+	ld [hl], BASE_HAPPINESS
+.owned
 
-.asm_db12
 	ld a, [CurPartySpecies]
-	cp $c9
-	jr nz, .asm_db3d
+	cp UNOWN
+	jr nz, .done
 	ld hl, PartyMon1DVs
 	ld a, [PartyCount]
 	dec a
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
-	ld a, $2d
-	call Predef
+	predef GetUnownLetter
 	callab Functionfba18
 	ld a, [$def4]
 	and a
-	jr nz, .asm_db3d
+	jr nz, .done
 	ld a, [UnownLetter]
 	ld [$def4], a
+.done
 
-.asm_db3d
 	and a
 	ret
 ; db3f
@@ -12738,11 +12742,11 @@
 	cp $2
 	jr z, .asm_db60
 	cp $3
-	ld hl, BreedMon1Species
+	ld hl, wBreedMon1Species
 	jr z, .asm_db9b
-	ld hl, BoxCount
+	ld hl, sBoxCount
 	ld a, [hl]
-	cp $14
+	cp MONS_PER_BOX
 	jr nz, .asm_db69
 	jp Functiondcb1
 
@@ -12749,7 +12753,7 @@
 .asm_db60
 	ld hl, PartyCount
 	ld a, [hl]
-	cp $6
+	cp PARTY_LENGTH
 	jp z, Functiondcb1
 
 .asm_db69
@@ -12756,11 +12760,11 @@
 	inc a
 	ld [hl], a
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [$d10b]
 	cp $2
-	ld a, [BreedMon1Species]
+	ld a, [wBreedMon1Species]
 	jr z, .asm_db7c
 	ld a, [CurPartySpecies]
 
@@ -12770,12 +12774,12 @@
 	ld a, [$d10b]
 	dec a
 	ld hl, PartyMon1Species
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	ld a, [PartyCount]
 	jr nz, .asm_db97
-	ld hl, BoxMon1Species
-	ld bc, $0020
-	ld a, [BoxCount]
+	ld hl, sBoxMon1Species
+	ld bc, sBoxMon1End - sBoxMon1
+	ld a, [sBoxCount]
 
 .asm_db97
 	dec a
@@ -12787,14 +12791,14 @@
 	ld d, h
 	ld a, [$d10b]
 	and a
-	ld hl, BoxMon1Species
-	ld bc, $0020
+	ld hl, sBoxMon1Species
+	ld bc, sBoxMon1End - sBoxMon1
 	jr z, .asm_dbb7
 	cp $2
-	ld hl, BreedMon1Species
+	ld hl, wBreedMon1Species
 	jr z, .asm_dbbd
 	ld hl, PartyMon1Species
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 
 .asm_dbb7
 	ld a, [CurPartyMon]
@@ -12801,18 +12805,18 @@
 	call AddNTimes
 
 .asm_dbbd
-	ld bc, $0020
+	ld bc, sBoxMon1End - sBoxMon1
 	call CopyBytes
 	ld a, [$d10b]
 	cp $3
-	ld de, BreedMon1OT
+	ld de, wBreedMon1OT
 	jr z, .asm_dbe2
 	dec a
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	ld a, [PartyCount]
 	jr nz, .asm_dbdc
-	ld hl, BoxMon1OT
-	ld a, [BoxCount]
+	ld hl, sBoxMonOT
+	ld a, [sBoxCount]
 
 .asm_dbdc
 	dec a
@@ -12821,14 +12825,14 @@
 	ld e, l
 
 .asm_dbe2
-	ld hl, BoxMon1OT
+	ld hl, sBoxMonOT
 	ld a, [$d10b]
 	and a
 	jr z, .asm_dbf5
-	ld hl, BreedMon1OT
+	ld hl, wBreedMon1OT
 	cp $2
 	jr z, .asm_dbfb
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 
 .asm_dbf5
 	ld a, [CurPartyMon]
@@ -12835,18 +12839,18 @@
 	call SkipNames
 
 .asm_dbfb
-	ld bc, $000b
+	ld bc, NAME_LENGTH
 	call CopyBytes
 	ld a, [$d10b]
 	cp $3
-	ld de, BreedMon1Nick
+	ld de, wBreedMon1Nick
 	jr z, .asm_dc20
 	dec a
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld a, [PartyCount]
 	jr nz, .asm_dc1a
-	ld hl, BoxMon1Nickname
-	ld a, [BoxCount]
+	ld hl, sBoxMonNicknames
+	ld a, [sBoxCount]
 
 .asm_dc1a
 	dec a
@@ -12855,14 +12859,14 @@
 	ld e, l
 
 .asm_dc20
-	ld hl, BoxMon1Nickname
+	ld hl, sBoxMonNicknames
 	ld a, [$d10b]
 	and a
 	jr z, .asm_dc33
-	ld hl, BreedMon1Nick
+	ld hl, wBreedMon1Nick
 	cp $2
 	jr z, .asm_dc39
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 
 .asm_dc33
 	ld a, [CurPartyMon]
@@ -12869,7 +12873,7 @@
 	call SkipNames
 
 .asm_dc39
-	ld bc, $000b
+	ld bc, PKMN_NAME_LENGTH
 	call CopyBytes
 	pop hl
 	ld a, [$d10b]
@@ -12881,8 +12885,7 @@
 	srl a
 	add $2
 	ld [MonType], a
-	ld a, $1f
-	call Predef
+	predef Function5084a
 	callab Function50e1b
 	ld a, d
 	ld [CurPartyLevel], a
@@ -12914,7 +12917,7 @@
 	ld d, h
 	ld e, l
 	ld a, [CurPartySpecies]
-	cp $fd
+	cp EGG
 	jr z, .asm_dc9e
 	inc hl
 	inc hl
@@ -12933,7 +12936,7 @@
 	jr .asm_dcac
 
 .asm_dca4
-	ld a, [BoxCount]
+	ld a, [sBoxCount]
 	dec a
 	ld b, a
 	call Functiondcb6
@@ -12954,12 +12957,12 @@
 Functiondcb6: ; dcb6
 
 	ld a, b
-	ld hl, BoxMons
-	ld bc, BoxMon2 - BoxMon1
+	ld hl, sBoxMons
+	ld bc, sBoxMon1End - sBoxMon1
 	call AddNTimes
 	ld b, h
 	ld c, l
-	ld hl, BoxMon1PP - BoxMon1
+	ld hl, sBoxMon1PP - sBoxMon1
 	add hl, bc
 	push hl
 	push bc
@@ -12967,7 +12970,7 @@
 	ld bc, NUM_MOVES
 	call CopyBytes
 	pop bc
-	ld hl, BoxMon1Moves - BoxMon1
+	ld hl, sBoxMon1Moves - sBoxMon1
 	add hl, bc
 	push hl
 	ld de, TempMonMoves
@@ -12985,7 +12988,7 @@
 	ld a, [hli]
 	and a
 	jr z, .asm_dd18
-	ld [TempMonMove1], a
+	ld [TempMonMoves+0], a
 	ld a, BOXMON
 	ld [MonType], a
 	ld a, b
@@ -13019,7 +13022,7 @@
 
 
 Functiondd21: ; dd21
-	ld a, [BreedMon1Species]
+	ld a, [wBreedMon1Species]
 	ld [CurPartySpecies], a
 	ld de, SFX_TRANSACTION
 	call PlaySFX
@@ -13035,7 +13038,7 @@
 ; dd42
 
 Functiondd42: ; dd42
-	ld a, [BreedMon2Species]
+	ld a, [wBreedMon2Species]
 	ld [CurPartySpecies], a
 	ld de, SFX_TRANSACTION
 	call PlaySFX
@@ -13053,7 +13056,7 @@
 Functiondd64: ; dd64
 	ld hl, PartyCount
 	ld a, [hl]
-	cp $6
+	cp PARTY_LENGTH
 	jr nz, .asm_dd6e
 	scf
 	ret
@@ -13062,15 +13065,15 @@
 	inc a
 	ld [hl], a
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [$d10b]
 	and a
-	ld a, [BreedMon1Species]
-	ld de, BreedMon1Nick
+	ld a, [wBreedMon1Species]
+	ld de, wBreedMon1Nick
 	jr z, .asm_dd86
-	ld a, [BreedMon2Species]
-	ld de, BreedMon2Nick
+	ld a, [wBreedMon2Species]
+	ld de, wBreedMon2Nick
 
 .asm_dd86
 	ld [hli], a
@@ -13077,7 +13080,7 @@
 	ld [CurSpecies], a
 	ld a, $ff
 	ld [hl], a
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld a, [PartyCount]
 	dec a
 	call SkipNames
@@ -13087,7 +13090,7 @@
 	pop de
 	call CopyBytes
 	push hl
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	ld a, [PartyCount]
 	dec a
 	call SkipNames
@@ -13117,17 +13120,16 @@
 	push bc
 	ld b, $1
 	call Functione167
-	ld hl, PartyMon1Move1
+	ld hl, PartyMon1Moves
 	ld a, [PartyCount]
 	dec a
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	ld d, h
 	ld e, l
 	ld a, $1
 	ld [Buffer1], a
-	ld a, $1b
-	call Predef
+	predef FillMoves
 	ld a, [PartyCount]
 	dec a
 	ld [CurPartyMon], a
@@ -13152,7 +13154,7 @@
 	ld a, [PartyCount]
 	dec a
 	ld hl, PartyMon1Species
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	ld d, h
 	ld e, l
@@ -13160,7 +13162,7 @@
 ; de2a
 
 Functionde2a: ; de2a
-	ld de, BreedMon1Nick
+	ld de, wBreedMon1Nick
 	call Functionde44
 	xor a
 	ld [$d10b], a
@@ -13168,7 +13170,7 @@
 ; de37
 
 Functionde37: ; de37
-	ld de, BreedMon2Nick
+	ld de, wBreedMon2Nick
 	call Functionde44
 	xor a
 	ld [$d10b], a
@@ -13177,28 +13179,28 @@
 
 Functionde44: ; de44
 	ld a, [CurPartyMon]
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call SkipNames
 	call CopyBytes
 	ld a, [CurPartyMon]
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	call SkipNames
 	call CopyBytes
 	ld a, [CurPartyMon]
 	ld hl, PartyMon1Species
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
-	ld bc, $0020
+	ld bc, sBoxMon1End - sBoxMon1
 	jp CopyBytes
 ; de6e
 
 
 Functionde6e: ; de6e
-	ld a, 1 ; BANK(BoxCount)
+	ld a, 1 ; BANK(sBoxCount)
 	call GetSRAMBank
-	ld de, BoxCount
+	ld de, sBoxCount
 	ld a, [de]
-	cp 20
+	cp MONS_PER_BOX
 	jp nc, Functiondf42
 	inc a
 	ld [de], a
@@ -13217,19 +13219,19 @@
 	call GetBaseData
 	call ShiftBoxMon
 	ld hl, PlayerName
-	ld de, BoxMonOT
-	ld bc, BoxMon2OT - BoxMon1OT
+	ld de, sBoxMonOT
+	ld bc, NAME_LENGTH
 	call CopyBytes
 	ld a, [CurPartySpecies]
 	ld [$d265], a
 	call GetPokemonName
-	ld de, BoxMon1Nickname
+	ld de, sBoxMonNicknames
 	ld hl, StringBuffer1
-	ld bc, BoxMon2Nickname - BoxMon1Nickname
+	ld bc, PKMN_NAME_LENGTH
 	call CopyBytes
 	ld hl, EnemyMon
-	ld de, BoxMon1
-	ld bc, 6 ; species + item + moves
+	ld de, sBoxMon1
+	ld bc, 1 + 1 + NUM_MOVES ; species + item + moves
 	call CopyBytes
 	ld hl, PlayerID
 	ld a, [hli]
@@ -13259,8 +13261,8 @@
 	inc de
 	dec b
 	jr nz, .asm_dee5
-	ld hl, EnemyMonAtkDefDV
-	ld b, $6
+	ld hl, EnemyMonDVs
+	ld b, 2 + NUM_MOVES ; DVs and PP ; EnemyMonHappiness - EnemyMonDVs
 .asm_deef
 	ld a, [hli]
 	ld [de], a
@@ -13267,7 +13269,7 @@
 	inc de
 	dec b
 	jr nz, .asm_deef
-	ld a, $46
+	ld a, BASE_HAPPINESS
 	ld [de], a
 	inc de
 	xor a
@@ -13285,17 +13287,16 @@
 	ld a, [CurPartySpecies]
 	cp UNOWN
 	jr nz, .asm_df20
-	ld hl, BoxMon1DVs
-	ld a, $2d
-	call Predef
+	ld hl, sBoxMon1DVs
+	predef GetUnownLetter
 	callab Functionfba18
 
 .asm_df20
-	ld hl, BoxMon1Moves
-	ld de, TempMonMove1
+	ld hl, sBoxMon1Moves
+	ld de, TempMonMoves
 	ld bc, NUM_MOVES
 	call CopyBytes
-	ld hl, BoxMon1PP
+	ld hl, sBoxMon1PP
 	ld de, TempMonPP
 	ld bc, NUM_MOVES
 	call CopyBytes
@@ -13313,19 +13314,19 @@
 ; df47
 
 ShiftBoxMon: ; df47
-	ld hl, BoxMonOT
-	ld bc, BoxMon2OT - BoxMon1OT
+	ld hl, sBoxMonOT
+	ld bc, NAME_LENGTH
 	call .asm_df5f
 
-	ld hl, BoxMonNicknames
-	ld bc, BoxMon2Nickname - BoxMon1Nickname
+	ld hl, sBoxMonNicknames
+	ld bc, PKMN_NAME_LENGTH
 	call .asm_df5f
 
-	ld hl, BoxMons
-	ld bc, BoxMon2 - BoxMon1
+	ld hl, sBoxMons
+	ld bc, sBoxMon1End - sBoxMon1
 
 .asm_df5f
-	ld a, [BoxCount]
+	ld a, [sBoxCount]
 	cp 2
 	ret c
 
@@ -13336,13 +13337,13 @@
 	ld d, h
 	pop hl
 
-	ld a, [BoxCount]
+	ld a, [sBoxCount]
 	dec a
 	call AddNTimes
 	dec hl
 
 	push hl
-	ld a, [BoxCount]
+	ld a, [sBoxCount]
 	dec a
 	ld hl, 0
 	call AddNTimes
@@ -13360,7 +13361,7 @@
 	ret
 ; df8c
 
-Functiondf8c:: ; df8c
+GiveEgg:: ; df8c
 	ld a, [CurPartySpecies]
 	push af
 	callab GetPreEvolution
@@ -13384,8 +13385,7 @@
 	ld d, $0
 	ld hl, PokedexCaught
 	ld b, $0
-	ld a, $3
-	call Predef
+	predef FlagPredef
 
 .asm_dfc3
 	pop bc
@@ -13398,8 +13398,7 @@
 	ld d, $0
 	ld hl, PokedexSeen
 	ld b, $0
-	ld a, $3
-	call Predef
+	predef FlagPredef
 
 .asm_dfd9
 	pop af
@@ -13406,7 +13405,7 @@
 	ld [CurPartySpecies], a
 	ld a, [PartyCount]
 	dec a
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	ld hl, PartyMon1Species
 	call AddNTimes
 	ld a, [CurPartySpecies]
@@ -13413,14 +13412,14 @@
 	ld [hl], a
 	ld hl, PartyCount
 	ld a, [hl]
-	ld b, $0
+	ld b, 0
 	ld c, a
 	add hl, bc
-	ld a, $fd
+	ld a, EGG
 	ld [hl], a
 	ld a, [PartyCount]
 	dec a
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call SkipNames
 	ld de, Stringe035
 	call CopyName2
@@ -13427,7 +13426,7 @@
 	ld a, [PartyCount]
 	dec a
 	ld hl, PartyMon1Happiness
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	ld a, [$c2cc]
 	bit 1, a
@@ -13440,7 +13439,7 @@
 	ld a, [PartyCount]
 	dec a
 	ld hl, PartyMon1HP
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	xor a
 	ld [hli], a
@@ -13461,9 +13460,9 @@
 	and a
 	jr z, .asm_e04a
 
-	ld a, 1 ; BANK(BoxCount)
+	ld a, 1 ; BANK(sBoxCount)
 	call GetSRAMBank
-	ld hl, BoxCount
+	ld hl, sBoxCount
 
 .asm_e04a
 	ld a, [hl]
@@ -13482,13 +13481,13 @@
 	ld [hli], a
 	inc a
 	jr nz, .asm_e057
-	ld hl, PartyMon1OT
-	ld d, $5
+	ld hl, PartyMonOT
+	ld d, PARTY_LENGTH - 1
 	ld a, [$d10b]
 	and a
 	jr z, .asm_e06d
-	ld hl, BoxMonOT
-	ld d, $13
+	ld hl, sBoxMonOT
+	ld d, MONS_PER_BOX - 1
 
 .asm_e06d
 	ld a, [CurPartyMon]
@@ -13502,13 +13501,13 @@
 .asm_e07e
 	ld d, h
 	ld e, l
-	ld bc, $000b
+	ld bc, PKMN_NAME_LENGTH
 	add hl, bc
-	ld bc, PartyMon1Nickname
+	ld bc, PartyMonNicknames
 	ld a, [$d10b]
 	and a
 	jr z, .asm_e090
-	ld bc, BoxMonNicknames
+	ld bc, sBoxMonNicknames
 .asm_e090
 	call CopyDataUntil
 
@@ -13517,8 +13516,8 @@
 	ld a, [$d10b]
 	and a
 	jr z, .asm_e0a5
-	ld hl, BoxMons
-	ld bc, BoxMon2 - BoxMon1
+	ld hl, sBoxMons
+	ld bc, sBoxMon1End - sBoxMon1
 
 .asm_e0a5
 	ld a, [CurPartyMon]
@@ -13528,37 +13527,37 @@
 	ld a, [$d10b]
 	and a
 	jr z, .asm_e0bc
-	ld bc, BoxMon2 - BoxMon1
+	ld bc, sBoxMon1End - sBoxMon1
 	add hl, bc
-	ld bc, BoxMonOT
+	ld bc, sBoxMonOT
 	jr .asm_e0c3
 
 .asm_e0bc
 	ld bc, PartyMon2 - PartyMon1
 	add hl, bc
-	ld bc, PartyMon1OT
+	ld bc, PartyMonOT
 
 .asm_e0c3
 	call CopyDataUntil
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld a, [$d10b]
 	and a
 	jr z, .asm_e0d2
-	ld hl, BoxMonNicknames
+	ld hl, sBoxMonNicknames
 
 .asm_e0d2
-	ld bc, BoxMon2Nickname - BoxMon1Nickname
+	ld bc, PKMN_NAME_LENGTH
 	ld a, [CurPartyMon]
 	call AddNTimes
 	ld d, h
 	ld e, l
-	ld bc, BoxMon2Nickname - BoxMon1Nickname
+	ld bc, PKMN_NAME_LENGTH
 	add hl, bc
 	ld bc, PartyMonNicknamesEnd
 	ld a, [$d10b]
 	and a
 	jr z, .asm_e0ed
-	ld bc, BoxMonNicknamesEnd
+	ld bc, sBoxMonNicknamesEnd
 
 .asm_e0ed
 	call CopyDataUntil
@@ -13846,7 +13845,7 @@
 	ld [MonType], a
 	call Functiond88c
 	jr nc, .asm_e2b0
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld a, [PartyCount]
 	dec a
 	ld [CurPartyMon], a
@@ -13864,7 +13863,7 @@
 	jr z, .asm_e2e1
 	ld a, [CurPartyMon]
 	ld hl, PartyMon1Item
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	ld a, [CurItem]
 	ld [hl], a
@@ -13891,7 +13890,7 @@
 	and a
 	jr z, .asm_e2e1
 	ld a, [CurItem]
-	ld [BoxMon1Item], a
+	ld [sBoxMon1Item], a
 
 .asm_e2e1
 	ld a, [CurPartySpecies]
@@ -13928,7 +13927,7 @@
 	jr nz, .asm_e35e
 	push hl
 	ld a, [CurPartyMon]
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	call SkipNames
 	ld d, h
 	ld e, l
@@ -13947,7 +13946,7 @@
 	push bc
 	ld a, [CurPartyMon]
 	ld hl, PartyMon1ID
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	ld a, $3
 	ld [hli], a
@@ -13959,7 +13958,7 @@
 .asm_e35e
 	ld a, $1
 	call GetSRAMBank
-	ld de, BoxMon1OT
+	ld de, sBoxMonOT
 .asm_e366
 	ld a, [ScriptBank]
 	call GetFarByte
@@ -13971,7 +13970,7 @@
 	ld a, [ScriptBank]
 	call GetFarByte
 	ld b, a
-	ld hl, BoxMon1ID
+	ld hl, sBoxMon1ID
 	call Random
 	ld [hli], a
 	call Random
@@ -14011,7 +14010,7 @@
 	ld a, $1
 	call GetSRAMBank
 	ld hl, $d050
-	ld de, BoxMon1Nickname
+	ld de, sBoxMonNicknames
 	ld bc, $000b
 	call CopyBytes
 	call CloseSRAM
@@ -14217,7 +14216,7 @@
 	ld a, [PartyCount]
 	and a
 	jr z, .asm_e51e
-	cp $2
+	cp 2
 	jr c, .asm_e526
 	and a
 	ret
@@ -14250,7 +14249,7 @@
 
 Functione538: ; e538
 	ld hl, PartyMon1HP
-	ld de, $0030
+	ld de, PartyMon2 - PartyMon1
 	ld b, $0
 .asm_e540
 	ld a, [CurPartyMon]
@@ -14292,7 +14291,7 @@
 
 Functione56d: ; e56d
 	ld a, [PartyCount]
-	cp $6
+	cp PARTY_LENGTH
 	jr nc, .asm_e576
 	and a
 	ret
@@ -14339,7 +14338,7 @@
 
 Functione5bb: ; e5bb
 	ld a, [CurPartyMon]
-	ld hl, BoxMon1Species
+	ld hl, sBoxMon1Species
 	ld bc, $0020
 	call AddNTimes
 	ld de, TempMonSpecies
@@ -14369,7 +14368,7 @@
 
 .asm_e5f1
 	ld a, $1
-	ld hl, BoxCount
+	ld hl, sBoxCount
 
 .asm_e5f6
 	call GetSRAMBank
@@ -14378,7 +14377,7 @@
 	add hl, bc
 	ld b, a
 	ld c, $0
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld a, b
 	and a
 	jr z, .asm_e66a
@@ -14471,7 +14470,7 @@
 ; e698
 
 Functione698: ; e698
-	ld hl, BreedMon1Species
+	ld hl, wBreedMon1Species
 	ld de, TempMonSpecies
 	ld bc, $0020
 	call CopyBytes
@@ -14486,7 +14485,7 @@
 ; e6b3
 
 Functione6b3: ; e6b3
-	ld hl, BreedMon2Species
+	ld hl, wBreedMon2Species
 	ld de, TempMonSpecies
 	ld bc, $0020
 	call CopyBytes
@@ -14528,7 +14527,7 @@
 	ld [CurPartySpecies], a
 	call GetBaseData
 	xor a
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	ld hl, $df9c
 	call ByteFill
 	xor a
@@ -14639,12 +14638,12 @@
 ; f9ea
 
 
-Functionf9ea: ; f9ea
-	ld a, $2
+KnowsMove: ; f9ea
+	ld a, PartyMon1Moves - PartyMon1
 	call GetPartyParamLocation
 	ld a, [$d262]
 	ld b, a
-	ld c, $4
+	ld c, NUM_MOVES
 .asm_f9f5
 	ld a, [hli]
 	cp b
@@ -14670,7 +14669,7 @@
 
 SECTION "bank4", ROMX, BANK[$4]
 
-Function10000: ; 10000
+Pack: ; 10000
 	ld hl, Options
 	set 4, [hl]
 	call Function1068a
@@ -15286,7 +15285,7 @@
 	callba PartyMenuSelect
 	jr c, .asm_10475
 	ld a, [CurPartySpecies] ; $d108
-	cp $fd
+	cp EGG
 	jr nz, .asm_10453
 	ld hl, UnknownText_0x1048d
 	call PrintText
@@ -15299,7 +15298,7 @@
 	call GetCurNick
 	ld hl, StringBuffer1 ; $d073
 	ld de, $d050
-	ld bc, $b
+	ld bc, PKMN_NAME_LENGTH
 	call CopyBytes
 	call Function12bd9
 	pop af
@@ -15334,7 +15333,7 @@
 ; 10493
 
 
-Function10493: ; 10493
+BattlePack: ; 10493
 	ld hl, Options
 	set 4, [hl]
 	call Function1068a
@@ -15998,7 +15997,7 @@
 	ld e, a
 	ld d, $0
 	ld a, [BattleType]
-	cp $3
+	cp BATTLETYPE_TUTORIAL
 	jr z, .asm_108b3
 	ld a, [PlayerGender]
 	bit 0, a
@@ -16122,7 +16121,7 @@
 	ld a, $24
 	call ByteFill
 	hlcoord 5, 1
-	ld bc, $0b0f
+	lb bc, 11, 15
 	call ClearBox
 	ld hl, TileMap
 	ld a, $28
@@ -16135,7 +16134,7 @@
 	call Function109bb
 	call Function109a5
 	hlcoord 0, 12
-	ld bc, $0412
+	lb bc, 4, 18
 	call TextBox
 	call EnableLCD
 	call Function1089d
@@ -16906,8 +16905,7 @@
 	ld b, CHECK_FLAG
 	push de
 	ld d, 0
-	ld a, PREDEF_FLAG
-	call Predef
+	predef FlagPredef
 	pop de
 	ret
 
@@ -19501,7 +19499,7 @@
 StartMenu_Pack: ; 1295b
 
 	call FadeToMenu
-	callba Function10000
+	callba Pack
 	ld a, [$cf66]
 	and a
 	jr nz, .asm_12970
@@ -20217,8 +20215,7 @@
 	xor a
 	ld [MonType], a
 	call LowVolume
-	ld a, $25
-	call Predef
+	predef StatsScreenInit
 	call MaxVolume
 	call Function1d7d
 	ld a, 0
@@ -20659,8 +20656,8 @@
 	jp .asm_13018
 
 .asm_130de
-	ld hl, PartyMon1Move1
-	ld bc, $0030
+	ld hl, PartyMon1Moves
+	ld bc, PartyMon2 - PartyMon1
 	ld a, [CurPartyMon]
 	call AddNTimes
 	push hl
@@ -20671,7 +20668,7 @@
 	call Function1313a
 	ld a, [IsInBattle]
 	jr z, .asm_13113
-	ld hl, BattleMonMove1
+	ld hl, BattleMonMoves
 	ld bc, $0020
 	ld a, [CurPartyMon]
 	call AddNTimes
@@ -20768,7 +20765,7 @@
 	call ClearBox
 	xor a
 	ld [MonType], a
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld a, [CurPartyMon]
 	call GetNick
 	hlcoord 5, 1
@@ -20791,20 +20788,17 @@
 	ld [hBGMapMode], a
 	ld [$d0e3], a
 	ld [MonType], a
-	ld a, $1f
-	call Predef
-	ld hl, TempMonMove1
+	predef Function5084a
+	ld hl, TempMonMoves
 	ld de, $d25e
-	ld bc, $0004
+	ld bc, NUM_MOVES
 	call CopyBytes
-	ld a, $28
+	ld a, SCREEN_WIDTH * 2
 	ld [Buffer1], a
 	hlcoord 2, 3
-	ld a, $20
-	call Predef
+	predef ListMoves
 	hlcoord 10, 4
-	ld a, $23
-	call Predef
+	predef Function50c50
 	call WaitBGMap
 	call Function32f9
 	ld a, [$d0eb]
@@ -20811,14 +20805,14 @@
 	inc a
 	ld [$cfa3], a
 	hlcoord 0, 11
-	ld b, $5
-	ld c, $12
+	ld b, 5
+	ld c, 18
 	jp TextBox
 ; 13235
 
 Function13235: ; 13235
-	ld hl, PartyMon1Move1
-	ld bc, $0030
+	ld hl, PartyMon1Moves
+	ld bc, PartyMon2 - PartyMon1
 	ld a, [CurPartyMon]
 	call AddNTimes
 	ld a, [$cfa9]
@@ -20829,7 +20823,7 @@
 	ld a, [hl]
 	ld [CurSpecies], a
 	hlcoord 1, 12
-	ld bc, $0512
+	lb bc, 5, 18
 	jp ClearBox
 ; 13256
 
@@ -20848,12 +20842,11 @@
 	ld a, [CurSpecies]
 	ld b, a
 	hlcoord 2, 12
-	ld a, PREDEF_PRINT_MOVE_TYPE
-	call Predef
+	predef PrintMoveType
 	ld a, [CurSpecies]
 	dec a
 	ld hl, Moves + MOVE_POWER
-	ld bc, Move2 - Move1
+	ld bc, MOVE_LENGTH
 	call AddNTimes
 	ld a, BANK(Moves)
 	call GetFarByte
@@ -20872,8 +20865,7 @@
 
 .asm_132ad
 	hlcoord 1, 14
-	ld a, $11
-	call Predef
+	predef PrintMoveDesc
 	ld a, $1
 	ld [hBGMapMode], a
 	ret
@@ -21449,7 +21441,7 @@
 ; 135eb
 
 UnknownScript_0x135eb:: ; 0x135eb
-	writecode $3, $6
+	writecode $3, BATTLETYPE_CONTEST
 	battlecheck
 	startbattle
 	returnafterbattle
@@ -22000,7 +21992,7 @@
 	call .AddContestStat
 
 	; DVs
-	ld a, [wContestMonAtkDefDV]
+	ld a, [wContestMonDVs + 0]
 	ld b, a
 	and 2
 	add a
@@ -22014,7 +22006,7 @@
 	add c
 	ld d, a
 
-	ld a, [wContestMonSpdSpcDV]
+	ld a, [wContestMonDVs + 1]
 	ld b, a
 	and 2
 	ld c, a
@@ -22171,7 +22163,7 @@
 	or [hl]
 	jr z, .asm_13a2b
 	ld hl, PartyCount
-	ld a, $1
+	ld a, 1
 	ld [hli], a
 	inc hl
 	ld a, [hl]
@@ -22188,7 +22180,7 @@
 ; 13a31
 
 Function13a31: ; 13a31
-	ld hl, $dcd9
+	ld hl, PartySpecies + 1
 	ld a, [$df9b]
 	ld [hl], a
 	ld b, $1
@@ -22295,8 +22287,7 @@
 	ld hl, $000a
 	add hl, bc
 	ld b, $1
-	ld a, $c
-	call Predef
+	predef Functione167
 	pop hl
 	ld bc, PartyMon2 - PartyMon1
 	add hl, bc
@@ -22781,21 +22772,21 @@
 
 .asm_141ad
 	ld [UsedSprites + 0], a
-	ld [$d4d6], a
-	ld [$d71f], a
+	ld [PlayerStruct + 0], a
+	ld [MapObjects + OBJECT_LENGTH * 0 + 1], a
 	ret
 
 .Chris
-	db PLAYER_NORMAL, SPRITE_CHRIS
-	db PLAYER_BIKE, SPRITE_CHRIS_BIKE
-	db PLAYER_SURF, SPRITE_SURF
+	db PLAYER_NORMAL,    SPRITE_CHRIS
+	db PLAYER_BIKE,      SPRITE_CHRIS_BIKE
+	db PLAYER_SURF,      SPRITE_SURF
 	db PLAYER_SURF_PIKA, SPRITE_SURFING_PIKACHU
 	db $ff
 
 .Kris
-	db PLAYER_NORMAL, SPRITE_KRIS
-	db PLAYER_BIKE, SPRITE_KRIS_BIKE
-	db PLAYER_SURF, SPRITE_SURF
+	db PLAYER_NORMAL,    SPRITE_KRIS
+	db PLAYER_BIKE,      SPRITE_KRIS_BIKE
+	db PLAYER_SURF,      SPRITE_SURF
 	db PLAYER_SURF_PIKA, SPRITE_SURFING_PIKACHU
 	db $ff
 ; 141c9
@@ -22918,9 +22909,9 @@
 	cp SPRITE_POKEMON
 	jr c, .Normal
 	cp SPRITE_DAYCARE_MON_1
-	jr z, .BreedMon1
+	jr z, .wBreedMon1
 	cp SPRITE_DAYCARE_MON_2
-	jr z, .BreedMon2
+	jr z, .wBreedMon2
 	cp SPRITE_VARS
 	jr nc, .Variable
 	jr .Icon
@@ -22938,12 +22929,12 @@
 	ld a, [hl]
 	jr .Mon
 
-.BreedMon1
-	ld a, [BreedMon1Species]
+.wBreedMon1
+	ld a, [wBreedMon1Species]
 	jr .Mon
 
-.BreedMon2
-	ld a, [BreedMon2Species]
+.wBreedMon2
+	ld a, [wBreedMon2Species]
 
 .Mon
 	ld e, a
@@ -25223,8 +25214,8 @@
 	push de
 	ld a, $1
 	call GetSRAMBank
-	ld hl, BoxCount
-	ld de, EnemyMoveAnimation
+	ld hl, sBoxCount
+	ld de, $c608
 	ld bc, $01e0
 	call CopyBytes
 	call CloseSRAM
@@ -25233,7 +25224,7 @@
 	push af
 	push de
 	call GetSRAMBank
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	ld bc, $01e0
 	call CopyBytes
 	call CloseSRAM
@@ -25240,7 +25231,7 @@
 	ld a, $1
 	call GetSRAMBank
 	ld hl, $aef0
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld bc, $01e0
 	call CopyBytes
 	call CloseSRAM
@@ -25253,7 +25244,7 @@
 	push af
 	push de
 	call GetSRAMBank
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	ld bc, $01e0
 	call CopyBytes
 	call CloseSRAM
@@ -25260,7 +25251,7 @@
 	ld a, $1
 	call GetSRAMBank
 	ld hl, $b0d0
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld bc, $008e
 	call CopyBytes
 	call CloseSRAM
@@ -25271,7 +25262,7 @@
 	ld e, l
 	ld d, h
 	call GetSRAMBank
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	ld bc, $008e
 	call CopyBytes
 	call CloseSRAM
@@ -25288,13 +25279,13 @@
 	push af
 	push hl
 	call GetSRAMBank
-	ld de, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct)
+	ld de, $c608
 	ld bc, $1e0
 	call CopyBytes
 	call CloseSRAM
 	ld a, $1
 	call GetSRAMBank
-	ld hl, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct)
+	ld hl, $c608
 	ld de, $ad10
 	ld bc, $1e0
 	call CopyBytes
@@ -25306,13 +25297,13 @@
 	push af
 	push hl
 	call GetSRAMBank
-	ld de, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct)
+	ld de, $c608
 	ld bc, $1e0
 	call CopyBytes
 	call CloseSRAM
 	ld a, $1
 	call GetSRAMBank
-	ld hl, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct)
+	ld hl, $c608
 	ld de, $aef0
 	ld bc, $1e0
 	call CopyBytes
@@ -25322,13 +25313,13 @@
 	ld de, $1e0
 	add hl, de
 	call GetSRAMBank
-	ld de, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct)
+	ld de, $c608
 	ld bc, $8e
 	call CopyBytes
 	call CloseSRAM
 	ld a, $1
 	call GetSRAMBank
-	ld hl, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct)
+	ld hl, $c608
 	ld de, $b0d0
 	ld bc, $8e
 	call CopyBytes
@@ -26436,8 +26427,7 @@
 	ld [$d107], a
 	ld hl, PCItems
 	call TossItem
-	ld a, $3b
-	call Predef
+	predef PartyMonItemName
 	ld hl, .WithdrewText
 	call Function1d4f
 	xor a
@@ -26611,8 +26601,7 @@
 	ld [$d107], a
 	ld hl, NumItems
 	call TossItem
-	ld a, $3b
-	call Predef
+	predef PartyMonItemName
 	ld hl, .DepositText
 	call PrintText
 	ret
@@ -27295,8 +27284,7 @@
 ; 15d97
 
 Function15d97: ; 15d97
-	ld a, $3b
-	call Predef
+	predef PartyMonItemName
 	ld a, $1
 	call Function15c7d
 	call YesNoBox
@@ -27636,8 +27624,7 @@
 	ld a, [$d107]
 	ld hl, NumItems
 	call TossItem
-	ld a, $3b
-	call Predef
+	predef PartyMonItemName
 	hlcoord 1, 14
 	ld bc, $0312
 	call ClearBox
@@ -28707,10 +28694,10 @@
 ; 0x166d6
 
 Function166d6: ; 166d6
-	ld hl, DaycareMan
+	ld hl, wDaycareMan
 	bit 0, [hl]
 	jr nz, .asm_166fe
-	ld hl, DaycareMan
+	ld hl, wDaycareMan
 	ld a, $0
 	call Function1678f
 	jr c, .asm_16724
@@ -28717,7 +28704,7 @@
 	call Function16798
 	jr c, .asm_16721
 	callba Functionde2a
-	ld hl, DaycareMan
+	ld hl, wDaycareMan
 	set 0, [hl]
 	call Function167f6
 	call Function16a3b
@@ -28725,13 +28712,13 @@
 
 .asm_166fe
 	callba Functione698
-	ld hl, BreedMon1Nick
+	ld hl, wBreedMon1Nick
 	call Function1686d
 	call Function16807
 	jr c, .asm_16721
 	callba Functiondd21
 	call Function16850
-	ld hl, DaycareMan
+	ld hl, wDaycareMan
 	res 0, [hl]
 	res 5, [hl]
 	jr .asm_16724
@@ -28746,10 +28733,10 @@
 ; 1672a
 
 Function1672a: ; 1672a
-	ld hl, DaycareLady
+	ld hl, wDaycareLady
 	bit 0, [hl]
 	jr nz, .asm_16752
-	ld hl, DaycareLady
+	ld hl, wDaycareLady
 	ld a, $2
 	call Function16781
 	jr c, .asm_1677b
@@ -28756,7 +28743,7 @@
 	call Function16798
 	jr c, .asm_16778
 	callba Functionde37
-	ld hl, DaycareLady
+	ld hl, wDaycareLady
 	set 0, [hl]
 	call Function167f6
 	call Function16a3b
@@ -28764,15 +28751,15 @@
 
 .asm_16752
 	callba Functione6b3
-	ld hl, BreedMon2Nick
+	ld hl, wBreedMon2Nick
 	call Function1686d
 	call Function16807
 	jr c, .asm_16778
 	callba Functiondd42
 	call Function16850
-	ld hl, DaycareLady
+	ld hl, wDaycareLady
 	res 0, [hl]
-	ld hl, DaycareMan
+	ld hl, wDaycareMan
 	res 5, [hl]
 	jr .asm_1677b
 
@@ -28819,13 +28806,13 @@
 	callba Functione538
 	jr c, .asm_167e9
 	ld hl, PartyMon1Item
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	ld a, [CurPartyMon]
 	call AddNTimes
 	ld d, [hl]
 	callba ItemIsMail
 	jr c, .asm_167ed
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld a, [CurPartyMon]
 	call GetNick
 	and a
@@ -29113,7 +29100,7 @@
 ; 0x16936
 
 Function16936: ; 16936
-	ld hl, DaycareMan
+	ld hl, wDaycareMan
 	bit 6, [hl]
 	jr nz, Function16949
 	ld hl, UnknownText_0x16944
@@ -29135,7 +29122,7 @@
 	cp $6
 	jr nc, .asm_16987
 	call Function169ac
-	ld hl, DaycareMan
+	ld hl, wDaycareMan
 	res 6, [hl]
 	call Function16a3b
 	ld hl, UnknownText_0x16998
@@ -29208,32 +29195,32 @@
 	add hl, bc
 	ld a, EGG
 	ld [hli], a
-	ld a, [EggSpecies]
+	ld a, [wEggMonSpecies]
 	ld [CurSpecies], a
 	ld [CurPartySpecies], a
 	ld a, $ff
 	ld [hl], a
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld bc, $000b
 	call Function16a31
-	ld hl, EggNick
+	ld hl, wEggNick
 	call CopyBytes
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	ld bc, $000b
 	call Function16a31
-	ld hl, EggOT
+	ld hl, wEggOT
 	call CopyBytes
-	ld hl, PartyMon1Species
-	ld bc, $0030
+	ld hl, PartyMon1
+	ld bc, PartyMon2 - PartyMon1
 	call Function16a31
-	ld hl, EggSpecies
-	ld bc, $0020
+	ld hl, wEggMon
+	ld bc, wEggMonEnd - wEggMon
 	call CopyBytes
 	call GetBaseData
 	ld a, [PartyCount]
 	dec a
-	ld hl, PartyMon1Species
-	ld bc, $0030
+	ld hl, PartyMon1
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	ld b, h
 	ld c, l
@@ -29247,8 +29234,7 @@
 	pop hl
 	push bc
 	ld b, $0
-	ld a, $c
-	call Predef
+	predef Functione167
 	pop bc
 	ld hl, $0022
 	add hl, bc
@@ -29273,10 +29259,10 @@
 ; 16a3b
 
 Function16a3b: ; 16a3b
-	ld a, [DaycareLady]
+	ld a, [wDaycareLady]
 	bit 0, a
 	ret z
-	ld a, [DaycareMan]
+	ld a, [wDaycareMan]
 	bit 0, a
 	ret z
 	callab Function16e1d
@@ -29285,40 +29271,40 @@
 	ret z
 	inc a
 	ret z
-	ld hl, DaycareMan
+	ld hl, wDaycareMan
 	set 5, [hl]
 .asm_16a59
 	call Random
 	cp 150
 	jr c, .asm_16a59
-	ld [StepsToEgg], a
+	ld [wStepsToEgg], a
 	jp Function16a66
 ; 16a66
 
 Function16a66: ; 16a66
 	xor a
-	ld hl, EggSpecies
-	ld bc, $0020
+	ld hl, wEggMon
+	ld bc, wEggMonEnd - wEggMon
 	call ByteFill
-	ld hl, EggNick
-	ld bc, $000b
+	ld hl, wEggNick
+	ld bc, PKMN_NAME_LENGTH
 	call ByteFill
-	ld hl, EggOT
-	ld bc, $000b
+	ld hl, wEggOT
+	ld bc, NAME_LENGTH
 	call ByteFill
 	ld a, [$df21]
 	ld [TempMonDVs], a
 	ld a, [$df22]
 	ld [$d124], a
-	ld a, [BreedMon1Species]
+	ld a, [wBreedMon1Species]
 	ld [CurPartySpecies], a
 	ld a, $3
 	ld [MonType], a
-	ld a, [BreedMon1Species]
+	ld a, [wBreedMon1Species]
 	cp DITTO
 	ld a, $1
 	jr z, .asm_16ab6
-	ld a, [BreedMon2Species]
+	ld a, [wBreedMon2Species]
 	cp DITTO
 	ld a, $0
 	jr z, .asm_16ab6
@@ -29328,11 +29314,11 @@
 	inc a
 
 .asm_16ab6
-	ld [DittoInDaycare], a
+	ld [wDittoInDaycare], a
 	and a
-	ld a, [BreedMon1Species]
+	ld a, [wBreedMon1Species]
 	jr z, .asm_16ac2
-	ld a, [BreedMon2Species]
+	ld a, [wBreedMon2Species]
 
 .asm_16ac2
 	ld [CurPartySpecies], a
@@ -29352,14 +29338,14 @@
 .asm_16ae8
 	ld [CurPartySpecies], a
 	ld [CurSpecies], a
-	ld [EggSpecies], a
+	ld [wEggMonSpecies], a
 	call GetBaseData
-	ld hl, EggNick
+	ld hl, wEggNick
 	ld de, String_16be0
 	call CopyName2
 	ld hl, PlayerName
-	ld de, EggOT
-	ld bc, $000b
+	ld de, wEggOT
+	ld bc, NAME_LENGTH
 	call CopyBytes
 	xor a
 	ld [$df7c], a
@@ -29366,8 +29352,7 @@
 	ld de, $df7d
 	xor a
 	ld [Buffer1], a
-	ld a, $1b
-	call Predef
+	predef FillMoves
 	callba Function170bf
 	ld hl, $df81
 	ld a, [PlayerID]
@@ -29399,11 +29384,11 @@
 	ld [hld], a
 	ld [$d124], a
 	ld de, $df21
-	ld a, [BreedMon1Species]
+	ld a, [wBreedMon1Species]
 	cp DITTO
 	jr z, .asm_16b98
 	ld de, $df5a
-	ld a, [BreedMon2Species]
+	ld a, [wBreedMon2Species]
 	cp DITTO
 	jr z, .asm_16b98
 	ld a, $3
@@ -29415,7 +29400,7 @@
 	ld bc, $df5a
 	jr c, .asm_16bab
 	jr z, .asm_16b90
-	ld a, [DittoInDaycare]
+	ld a, [wDittoInDaycare]
 	and a
 	jr z, .asm_16b98
 	ld d, b
@@ -29423,7 +29408,7 @@
 	jr .asm_16b98
 
 .asm_16b90
-	ld a, [DittoInDaycare]
+	ld a, [wDittoInDaycare]
 	and a
 	jr nz, .asm_16b98
 	ld d, b
@@ -29453,8 +29438,7 @@
 	call CopyBytes
 	ld hl, $df7d
 	ld de, $df92
-	ld a, $5
-	call Predef
+	predef FillPP
 	ld hl, $d050
 	ld de, StringBuffer1
 	ld bc, $000b
@@ -29619,15 +29603,13 @@
 	xor a
 	ld [$c2c6], a
 	ld de, VTiles2
-	ld a, $3c
-	call Predef
+	predef GetFrontpic
 	call Function16cff
 	hlcoord 1, 6
 	xor a
 	ld [$ffad], a
 	ld bc, $0707
-	ld a, $13
-	call Predef
+	predef FillBox
 	ld de, $9310
 	callba Functione0000
 	ret
@@ -29708,8 +29690,7 @@
 	ld a, $31
 	ld [$ffad], a
 	ld bc, $0707
-	ld a, $13
-	call Predef
+	predef FillBox
 	ret
 ; 16dc7
 
@@ -29779,7 +29760,7 @@
 	call Function16ed6
 	ld c, $0
 	jp nc, .asm_16eb7
-	ld a, [BreedMon1Species]
+	ld a, [wBreedMon1Species]
 	ld [CurPartySpecies], a
 	ld a, [$df21]
 	ld [TempMonDVs], a
@@ -29787,8 +29768,7 @@
 	ld [$d124], a
 	ld a, $3
 	ld [MonType], a
-	ld a, $24
-	call Predef
+	predef GetGender
 	jr c, .asm_16e70
 	ld b, $1
 	jr nz, .asm_16e48
@@ -29796,7 +29776,7 @@
 
 .asm_16e48
 	push bc
-	ld a, [BreedMon2Species]
+	ld a, [wBreedMon2Species]
 	ld [CurPartySpecies], a
 	ld a, [$df5a]
 	ld [TempMonDVs], a
@@ -29804,8 +29784,7 @@
 	ld [$d124], a
 	ld a, $3
 	ld [MonType], a
-	ld a, $24
-	call Predef
+	predef GetGender
 	pop bc
 	jr c, .asm_16e70
 	ld a, $1
@@ -29818,16 +29797,16 @@
 
 .asm_16e70
 	ld c, $0
-	ld a, [BreedMon1Species]
+	ld a, [wBreedMon1Species]
 	cp DITTO
 	jr z, .asm_16e82
-	ld a, [BreedMon2Species]
+	ld a, [wBreedMon2Species]
 	cp DITTO
 	jr nz, .asm_16eb7
 	jr .asm_16e89
 
 .asm_16e82
-	ld a, [BreedMon2Species]
+	ld a, [wBreedMon2Species]
 	cp DITTO
 	jr z, .asm_16eb7
 
@@ -29835,9 +29814,9 @@
 	call Function16ebc
 	ld c, $ff
 	jp z, .asm_16eb7
-	ld a, [BreedMon2Species]
+	ld a, [wBreedMon2Species]
 	ld b, a
-	ld a, [BreedMon1Species]
+	ld a, [wBreedMon1Species]
 	cp b
 	ld c, $fe
 	jr z, .asm_16e9f
@@ -29884,19 +29863,19 @@
 ; 16ed6
 
 Function16ed6: ; 16ed6
-	ld a, [BreedMon2Species]
+	ld a, [wBreedMon2Species]
 	ld [CurSpecies], a
 	call GetBaseData
 	ld a, [BaseEggGroups]
 	cp $ff
 	jr z, .asm_16f3a
-	ld a, [BreedMon1Species]
+	ld a, [wBreedMon1Species]
 	ld [CurSpecies], a
 	call GetBaseData
 	ld a, [BaseEggGroups]
 	cp $ff
 	jr z, .asm_16f3a
-	ld a, [BreedMon2Species]
+	ld a, [wBreedMon2Species]
 	cp DITTO
 	jr z, .asm_16f3c
 	ld [CurSpecies], a
@@ -29909,7 +29888,7 @@
 	and $f0
 	swap a
 	ld c, a
-	ld a, [BreedMon1Species]
+	ld a, [wBreedMon1Species]
 	cp DITTO
 	jr z, .asm_16f3c
 	ld [CurSpecies], a
@@ -30054,8 +30033,7 @@
 	ld bc, $a
 	add hl, bc
 	ld b, $0
-	ld a, $c
-	call Predef
+	predef Functione167
 	pop bc
 	ld hl, $24
 	add hl, bc
@@ -30075,7 +30053,7 @@
 	ld a, [$d47c]
 	ld [hl], a
 	ld a, [CurPartyMon] ; $d109
-	ld hl, PartyMonOT ; $ddff (aliases: PartyMon1OT)
+	ld hl, PartyMonOT ; $ddff (aliases: PartyMonOT)
 	ld bc, $b
 	call AddNTimes
 	ld d, h
@@ -30085,7 +30063,7 @@
 	ld hl, UnknownText_0x1708b
 	call PrintText
 	ld a, [CurPartyMon] ; $d109
-	ld hl, PartyMonNicknames ; $de41 (aliases: PartyMon1Nickname)
+	ld hl, PartyMonNicknames ; $de41 (aliases: PartyMonNicknames)
 	ld bc, $b
 	call AddNTimes
 	ld d, h
@@ -30206,7 +30184,7 @@
 GLOBAL EggMoves
 
 	push bc
-	ld a, [EggSpecies]
+	ld a, [wEggMonSpecies]
 	dec a
 	ld c, a
 	ld b, 0
@@ -30240,7 +30218,7 @@
 	jr .asm_1710c
 
 .asm_17116
-	ld a, [EggSpecies]
+	ld a, [wEggMonSpecies]
 	dec a
 	ld c, a
 	ld b, 0
@@ -30283,8 +30261,7 @@
 	cp b
 	jr nz, .asm_17149
 	ld [$d262], a
-	ld a, $e
-	call Predef
+	predef CanLearnTMHMMove
 	ld a, c
 	and a
 	jr z, .asm_17166
@@ -30329,8 +30306,7 @@
 	ld [hl], b
 	ld hl, $df7d
 	ld de, $df92
-	ld a, $5
-	call Predef
+	predef FillPP
 	pop bc
 	pop de
 	ret
@@ -30338,13 +30314,13 @@
 
 Function17197: ; 17197
 	ld hl, $df47
-	ld a, [BreedMon1Species]
+	ld a, [wBreedMon1Species]
 	cp DITTO
 	jr z, .asm_171b1
-	ld a, [BreedMon2Species]
+	ld a, [wBreedMon2Species]
 	cp DITTO
 	jr z, .asm_171d7
-	ld a, [DittoInDaycare]
+	ld a, [wDittoInDaycare]
 	and a
 	ret z
 	ld hl, $df0e
@@ -30353,7 +30329,7 @@
 .asm_171b1
 	ld a, [CurPartySpecies]
 	push af
-	ld a, [BreedMon2Species]
+	ld a, [wBreedMon2Species]
 	ld [CurPartySpecies], a
 	ld a, [$df5a]
 	ld [TempMonDVs], a
@@ -30361,8 +30337,7 @@
 	ld [$d124], a
 	ld a, $3
 	ld [MonType], a
-	ld a, $24
-	call Predef
+	predef GetGender
 	jr c, .asm_171fb
 	jr nz, .asm_171fb
 	jr .asm_17203
@@ -30370,7 +30345,7 @@
 .asm_171d7
 	ld a, [CurPartySpecies]
 	push af
-	ld a, [BreedMon1Species]
+	ld a, [wBreedMon1Species]
 	ld [CurPartySpecies], a
 	ld a, [$df21]
 	ld [TempMonDVs], a
@@ -30378,8 +30353,7 @@
 	ld [$d124], a
 	ld a, $3
 	ld [MonType], a
-	ld a, $24
-	call Predef
+	predef GetGender
 	jr c, .asm_17203
 	jr nz, .asm_17203
 
@@ -30398,13 +30372,13 @@
 
 Function1720b: ; 1720b
 	ld hl, $df0e
-	ld a, [BreedMon1Species]
+	ld a, [wBreedMon1Species]
 	cp DITTO
 	ret z
-	ld a, [BreedMon2Species]
+	ld a, [wBreedMon2Species]
 	cp DITTO
 	jr z, .asm_17220
-	ld a, [DittoInDaycare]
+	ld a, [wDittoInDaycare]
 	and a
 	ret z
 
@@ -30420,12 +30394,10 @@
 	ld [CurPartySpecies], a ; $d108
 	ld [CurSpecies], a ; $cf60
 	call GetBaseData
-	ld hl, BattleMonDVs ; $c632 (aliases: BattleMonAtkDefDV)
-	ld a, $2d
-	call Predef
+	ld hl, BattleMonDVs
+	predef GetUnownLetter
 	pop de
-	ld a, $3c
-	jp Predef
+	predef_jump GetFrontpic
 
 ; known jump sources: 172c2 (5:72c2)
 Function1723c: ; 1723c (5:723c)
@@ -30433,12 +30405,10 @@
 	ld [CurPartySpecies], a ; $d108
 	ld [CurSpecies], a ; $cf60
 	call GetBaseData
-	ld hl, BattleMonDVs ; $c632 (aliases: BattleMonAtkDefDV)
-	ld a, $2d
-	call Predef
+	ld hl, BattleMonDVs
+	predef GetUnownLetter
 	pop de
-	ld a, $3e
-	jp Predef
+	predef_jump Function5108b
 
 ; known jump sources: 172df (5:72df), 17343 (5:7343)
 Function17254: ; 17254 (5:7254)
@@ -30457,8 +30427,7 @@
 	ld a, c
 	ld [$ffad], a
 	ld bc, $707
-	ld a, $13
-	call Predef
+	predef FillBox
 	pop af
 	call Function17363
 	call Function32f9
@@ -30560,8 +30529,7 @@
 	hlcoord 6, 3
 	ld d, $0
 	ld e, $5
-	ld a, $47
-	call Predef
+	predef Functiond008e
 	pop af
 	ld [CurSpecies], a ; $cf60
 	ret
@@ -30667,13 +30635,13 @@
 Function17421: ; 17421
 	ld hl, UnknownText_0x17467
 	call PrintText
-	ld a, [BreedMon1Species]
+	ld a, [wBreedMon1Species]
 	call Function37ce
-	ld a, [DaycareLady]
+	ld a, [wDaycareLady]
 	bit 0, a
 	jr z, Function1745f
 	call Functionaaf
-	ld hl, BreedMon2Nick
+	ld hl, wBreedMon2Nick
 	call Function1746c
 	jp PrintText
 
@@ -30680,13 +30648,13 @@
 Function17440: ; 17440
 	ld hl, UnknownText_0x17462
 	call PrintText
-	ld a, [BreedMon2Species]
+	ld a, [wBreedMon2Species]
 	call Function37ce
-	ld a, [DaycareMan]
+	ld a, [wDaycareMan]
 	bit 0, a
 	jr z, Function1745f
 	call Functionaaf
-	ld hl, BreedMon1Nick
+	ld hl, wBreedMon1Nick
 	call Function1746c
 	jp PrintText
 
@@ -31917,8 +31885,7 @@
 	ld [CurSpecies], a
 	call GetBaseData
 	ld de, VTiles1
-	ld a, $3c
-	call Predef
+	predef GetFrontpic
 	ld a, [$cf82]
 	inc a
 	ld b, a
@@ -31929,8 +31896,7 @@
 	ld a, $80
 	ld [$ffad], a
 	ld bc, $0707
-	ld a, $13
-	call Predef
+	predef FillBox
 	call WaitBGMap
 	ret
 ; 24528
@@ -33479,7 +33445,7 @@
 ; 24ef2
 
 
-LoadBattleMenuDataHeader: ; 24ef2
+LoadBattleMenu: ; 24ef2
 	ld hl, BattleMenuDataHeader
 	call LoadMenuDataHeader
 	ld a, [$d0d2]
@@ -33492,15 +33458,14 @@
 ; 24f0b
 
 
-Function24f0b: ; 24f0b
-; Safari battle menu (untranslated).
+SafariBattleMenu: ; 24f0b
+; untranslated
 	ld hl, MenuDataHeader_0x24f4e
 	call LoadMenuDataHeader
 	jr Function24f19
 ; 24f13
 
-Function24f13: ; 24f13
-; Park battle menu.
+ContestBattleMenu: ; 24f13
 	ld hl, MenuDataHeader_0x24f89
 	call LoadMenuDataHeader
 ; 24f19
@@ -34103,8 +34068,7 @@
 	ld bc, $507
 	xor a
 	ld [$FF00+$ad], a
-	ld a, $13
-	call Predef
+	predef FillBox
 	ret
 ; 252ec (9:52ec)
 
@@ -36140,7 +36104,7 @@
 	call WhiteBGMap
 	call ClearTileMap
 	ld a, [BattleType]
-	cp $3
+	cp BATTLETYPE_TUTORIAL
 	jr z, .asm_27171
 	callba Function3f43d
 	jr .asm_27177
@@ -36340,7 +36304,7 @@
 	call Function75f
 	ld a, $fe
 	ld [de], a
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	ld de, PlayerSDefLevel
 	ld bc, $00c8
 	call Function75f
@@ -36483,7 +36447,7 @@
 	call Function75f
 	ld a, $fe
 	ld [de], a
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	ld de, PlayerSDefLevel
 	ld bc, $00c8
 	call Function75f
@@ -36686,7 +36650,7 @@
 	or $3
 	ld [hl], a
 	ld hl, $d26b
-	ld de, $c656
+	ld de, OTName
 	ld bc, $000b
 	call CopyBytes
 	call Function222a
@@ -36705,8 +36669,7 @@
 	ld [rIE], a
 	pop af
 	ld [rIF], a
-	ld a, $16
-	call Predef
+	predef StartBattle
 	ld a, [rIF]
 	ld h, a
 	xor a
@@ -36833,7 +36796,7 @@
 	ld [hli], a
 	dec b
 	jr nz, .asm_28441
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	ld a, $fd
 	ld [hli], a
 	ld [hli], a
@@ -36845,7 +36808,7 @@
 	dec b
 	jr nz, .asm_28457
 	ld hl, $c818
-	ld de, PlayerMoveType
+	ld de, $c612
 	ld bc, $0000
 .asm_28464
 	inc c
@@ -36883,7 +36846,7 @@
 	ld a, $ff
 	ld [de], a
 	inc de
-	ld bc, Start
+	ld bc, $100
 	jr .asm_28464
 
 .asm_28495
@@ -36936,7 +36899,7 @@
 .asm_284db
 	push bc
 	call Function284f6
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	add hl, bc
 	pop bc
 	dec c
@@ -37044,8 +37007,7 @@
 	add hl, bc
 	ld c, $5
 	ld b, $1
-	ld a, $d
-	call Predef
+	predef Functione17b
 
 	pop bc
 	pop de
@@ -37082,10 +37044,10 @@
 	ld hl, PartyMon1Species
 	ld bc, $0120
 	call CopyBytes
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	ld bc, $0042
 	call CopyBytes
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld bc, $0042
 	call CopyBytes
 	ld a, [InLinkBattle]
@@ -37221,10 +37183,10 @@
 	pop hl
 	ld bc, $0108
 	add hl, bc
-	ld de, OTPartyMon1OT
+	ld de, OTPartyMonOT
 	ld bc, $0042
 	call CopyBytes
-	ld de, OTPartyMon1Nickname
+	ld de, OTPartyMonNicknames
 	ld bc, $0042
 	jp CopyBytes
 ; 286ba
@@ -37316,8 +37278,7 @@
 	add hl, bc
 	ld c, $5
 	ld b, $1
-	ld a, $d
-	call Predef
+	predef Functione17b
 	pop bc
 	pop hl
 	ld a, [$ffb5]
@@ -37330,8 +37291,7 @@
 	add hl, bc
 	ld c, $6
 	ld b, $1
-	ld a, $d
-	call Predef
+	predef Functione17b
 	pop bc
 	pop hl
 	ld a, [$ffb5]
@@ -38054,7 +38014,7 @@
 	ld [PlayerSDefLevel], a
 	push af
 	ld a, [DefaultFlypoint]
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	call SkipNames
 	ld de, $c6f2
 	ld bc, $000b
@@ -38093,7 +38053,7 @@
 	ld a, [hl]
 	ld [PlayerLightScreenCount], a
 	ld a, [$d003]
-	ld hl, OTPartyMon1OT
+	ld hl, OTPartyMonOT
 	call SkipNames
 	ld de, $c724
 	ld bc, $000b
@@ -38105,7 +38065,7 @@
 	ld [$c731], a
 	ld a, [hl]
 	ld [$c732], a
-	ld hl, OTPartyMon1AtkDefDV
+	ld hl, OTPartyMon1DVs
 	ld a, [$d003]
 	call GetPartyLocation
 	ld a, [hli]
@@ -38153,13 +38113,11 @@
 	ld a, [$ffcb]
 	cp $1
 	jr z, .asm_28de4
-	ld a, $1e
-	call Predef
+	predef Function28f24
 	jr .asm_28de9
 
 .asm_28de4
-	ld a, $1d
-	call Predef
+	predef Function28f63
 
 .asm_28de9
 	pop af
@@ -38175,10 +38133,9 @@
 	ld a, c
 	call GetPartyLocation
 	ld de, TempMonSpecies
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call CopyBytes
-	ld a, $7
-	call Predef
+	predef Functionda96
 	ld a, [PartyCount]
 	dec a
 	ld [CurPartyMon], a
@@ -38249,7 +38206,8 @@
 ; 28eab
 
 String28eab: ; 28eab
-	db "TRADE", $4e, "CANCEL@"
+	db   "TRADE"
+	next "CANCEL@"
 
 UnknownText_0x28eb8: ; 0x28eb8
 	; Trade @ for @ ?
@@ -38258,10 +38216,11 @@
 ; 0x28ebd
 
 String28ebd: ; 28ebd
-	db "Trade completed!@"
+	db   "Trade completed!@"
 
 String28ece: ; 28ece
-	db "Too bad! The trade", $4e, "was canceled!@"
+	db   "Too bad! The trade"
+	next "was canceled!@"
 
 
 Function28eef: ; 28eef
@@ -39113,15 +39072,13 @@
 Function29491: ; 29491
 	push de
 	push af
-	ld a, $2d
-	call Predef
+	predef GetUnownLetter
 	pop af
 	ld [CurPartySpecies], a
 	ld [CurSpecies], a
 	call GetBaseData
 	pop de
-	ld a, $3c
-	call Predef
+	predef GetFrontpic
 	ret
 ; 294a9
 
@@ -39154,8 +39111,7 @@
 	xor a
 	ld [$ffad], a
 	ld bc, $0707
-	ld a, $13
-	call Predef
+	predef FillBox
 	call WaitBGMap
 	ret
 ; 294e7
@@ -39865,15 +39821,16 @@
 	pop bc
 	pop hl
 	jr c, .asm_29c5e
-	ld de, $0030
+	ld de, PartyMon2 - PartyMon1
 	add hl, de
 	dec b
 	jr nz, .asm_29c13
-	ld hl, PartyMon1Move1
+
+	ld hl, PartyMon1Moves
 	ld a, [PartyCount]
 	ld b, a
 .asm_29c2e
-	ld c, $4
+	ld c, NUM_MOVES
 .asm_29c30
 	ld a, [hli]
 	cp STRUGGLE + 1
@@ -39880,7 +39837,7 @@
 	jr nc, .asm_29c4c
 	dec c
 	jr nz, .asm_29c30
-	ld de, $002c
+	ld de, PartyMon2 - (PartyMon1 + NUM_MOVES)
 	add hl, de
 	dec b
 	jr nz, .asm_29c2e
@@ -40380,8 +40337,7 @@
 	call GetSRAMBank
 	ld d, $0
 	ld b, $2
-	ld a, $3
-	call Predef
+	predef FlagPredef
 	call CloseSRAM
 	ld a, c
 	and a
@@ -40535,14 +40491,14 @@
 ; 2a0b7
 
 Function2a0b7: ; 2a0b7
-	ld a, [RoamMon1Species]
+	ld a, [wRoamMon1Species]
 	ld b, a
 	ld a, [$d265]
 	cp b
 	ret nz
-	ld a, [RoamMon1MapGroup]
+	ld a, [wRoamMon1MapGroup]
 	ld b, a
-	ld a, [RoamMon1MapNumber]
+	ld a, [wRoamMon1MapNumber]
 	ld c, a
 	call Function2a09c
 	ret nc
@@ -40552,14 +40508,14 @@
 ; 2a0cf
 
 Function2a0cf: ; 2a0cf
-	ld a, [RoamMon2Species]
+	ld a, [wRoamMon2Species]
 	ld b, a
 	ld a, [$d265]
 	cp b
 	ret nz
-	ld a, [RoamMon2MapGroup]
+	ld a, [wRoamMon2MapGroup]
 	ld b, a
-	ld a, [RoamMon2MapNumber]
+	ld a, [wRoamMon2MapNumber]
 	ld c, a
 	call Function2a09c
 	ret nc
@@ -40580,7 +40536,7 @@
 	ret
 
 .asm_2a0f8
-	xor a
+	xor a ; BATTLETYPE_NORMAL
 	ld [$d22e], a
 	ld [BattleType], a
 	ld a, 1
@@ -40905,45 +40861,45 @@
 
 
 InitRoamMons: ; 2a2a0
-; initialize RoamMon structs
+; initialize wRoamMon structs
 
 ; species
 	ld a, RAIKOU
-	ld [RoamMon1Species], a
+	ld [wRoamMon1Species], a
 	ld a, ENTEI
-	ld [RoamMon2Species], a
+	ld [wRoamMon2Species], a
 ;	ld a, SUICUNE
-;	ld [RoamMon3Species], a
+;	ld [wRoamMon3Species], a
 
 ; level
 	ld a, 40
-	ld [RoamMon1Level], a
-	ld [RoamMon2Level], a
-;	ld [RoamMon3Level], a
+	ld [wRoamMon1Level], a
+	ld [wRoamMon2Level], a
+;	ld [wRoamMon3Level], a
 
 ; raikou starting map
 	ld a, GROUP_ROUTE_42
-	ld [RoamMon1MapGroup], a
+	ld [wRoamMon1MapGroup], a
 	ld a, MAP_ROUTE_42
-	ld [RoamMon1MapNumber], a
+	ld [wRoamMon1MapNumber], a
 
 ; entei starting map
 	ld a, GROUP_ROUTE_37
-	ld [RoamMon2MapGroup], a
+	ld [wRoamMon2MapGroup], a
 	ld a, MAP_ROUTE_37
-	ld [RoamMon2MapNumber], a
+	ld [wRoamMon2MapNumber], a
 
 ; suicune starting map
 ;	ld a, GROUP_ROUTE_38
-;	ld [RoamMon3MapGroup], a
+;	ld [wRoamMon3MapGroup], a
 ;	ld a, MAP_ROUTE_38
-;	ld [RoamMon3MapNumber], a
+;	ld [wRoamMon3MapNumber], a
 
 ; hp
 	xor a ; generate new stats
-	ld [RoamMon1HP], a
-	ld [RoamMon2HP], a
-;	ld [RoamMon3HP], a
+	ld [wRoamMon1HP], a
+	ld [wRoamMon2HP], a
+;	ld [wRoamMon3HP], a
 
 	ret
 ; 2a2ce
@@ -40960,7 +40916,7 @@
 	and 3
 	jr z, .asm_2a30a
 	dec a
-	ld hl, RoamMon1MapGroup
+	ld hl, wRoamMon1MapGroup
 	ld c, a
 	ld b, 0
 	ld a, 7
@@ -40981,6 +40937,7 @@
 	ld [CurPartyLevel], a
 	ld a, BATTLETYPE_ROAMING
 	ld [BattleType], a
+
 	pop hl
 	scf
 	ret
@@ -40993,43 +40950,43 @@
 
 
 Function2a30d: ; 2a30d
-	ld a, [RoamMon1MapGroup]
+	ld a, [wRoamMon1MapGroup]
 	cp $ff
 	jr z, .asm_2a324
 	ld b, a
-	ld a, [RoamMon1MapNumber]
+	ld a, [wRoamMon1MapNumber]
 	ld c, a
 	call Function2a355
 	ld a, b
-	ld [RoamMon1MapGroup], a
+	ld [wRoamMon1MapGroup], a
 	ld a, c
-	ld [RoamMon1MapNumber], a
+	ld [wRoamMon1MapNumber], a
 
 .asm_2a324
-	ld a, [RoamMon2MapGroup]
+	ld a, [wRoamMon2MapGroup]
 	cp $ff
 	jr z, .asm_2a33b
 	ld b, a
-	ld a, [RoamMon2MapNumber]
+	ld a, [wRoamMon2MapNumber]
 	ld c, a
 	call Function2a355
 	ld a, b
-	ld [RoamMon2MapGroup], a
+	ld [wRoamMon2MapGroup], a
 	ld a, c
-	ld [RoamMon2MapNumber], a
+	ld [wRoamMon2MapNumber], a
 
 .asm_2a33b
-	ld a, [RoamMon3MapGroup]
+	ld a, [wRoamMon3MapGroup]
 	cp $ff
 	jr z, .asm_2a352
 	ld b, a
-	ld a, [RoamMon3MapNumber]
+	ld a, [wRoamMon3MapNumber]
 	ld c, a
 	call Function2a355
 	ld a, b
-	ld [RoamMon3MapGroup], a
+	ld [wRoamMon3MapGroup], a
 	ld a, c
-	ld [RoamMon3MapNumber], a
+	ld [wRoamMon3MapNumber], a
 
 .asm_2a352
 	jp Function2a3f6
@@ -41090,34 +41047,34 @@
 	ret
 
 Function2a394: ; 2a394
-	ld a, [RoamMon1MapGroup]
+	ld a, [wRoamMon1MapGroup]
 	cp $ff
 	jr z, .asm_2a3a6
 	call Function2a3cd
 	ld a, b
-	ld [RoamMon1MapGroup], a
+	ld [wRoamMon1MapGroup], a
 	ld a, c
-	ld [RoamMon1MapNumber], a
+	ld [wRoamMon1MapNumber], a
 .asm_2a3a6
 
-	ld a, [RoamMon2MapGroup]
+	ld a, [wRoamMon2MapGroup]
 	cp $ff
 	jr z, .asm_2a3b8
 	call Function2a3cd
 	ld a, b
-	ld [RoamMon2MapGroup], a
+	ld [wRoamMon2MapGroup], a
 	ld a, c
-	ld [RoamMon2MapNumber], a
+	ld [wRoamMon2MapNumber], a
 .asm_2a3b8
 
-	ld a, [RoamMon3MapGroup]
+	ld a, [wRoamMon3MapGroup]
 	cp $ff
 	jr z, .asm_2a3ca
 	call Function2a3cd
 	ld a, b
-	ld [RoamMon3MapGroup], a
+	ld [wRoamMon3MapGroup], a
 	ld a, c
-	ld [RoamMon3MapNumber], a
+	ld [wRoamMon3MapNumber], a
 .asm_2a3ca
 
 	jp Function2a3f6
@@ -42145,11 +42102,11 @@
 	callba Function50000
 	jr c, .asm_2c5c3
 	ld a, [CurPartySpecies]
-	cp $fd
+	cp EGG
 	jr z, .asm_2c5bc
 	ld a, [CurPartyMon]
-	ld hl, PartyMon1Move2
-	ld bc, $0030
+	ld hl, PartyMon1Moves + 1
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	ld a, [hl]
 	and a
@@ -42250,11 +42207,11 @@
 	push bc
 	dec a
 	ld c, a
-	ld b, $0
-	ld hl, PartyMon1Move1
+	ld b, 0
+	ld hl, PartyMon1Moves
 	add hl, bc
 	ld a, [CurPartyMon]
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	pop bc
 	push bc
@@ -42261,7 +42218,7 @@
 	inc b
 .asm_2c60f
 	ld a, b
-	cp $5
+	cp NUM_MOVES + 1
 	jr z, .asm_2c61b
 	inc hl
 	ld a, [hld]
@@ -42274,21 +42231,22 @@
 	xor a
 	ld [hl], a
 	pop bc
+
 	ld a, b
 	push bc
 	dec a
 	ld c, a
-	ld b, $0
+	ld b, 0
 	ld hl, PartyMon1PP
 	add hl, bc
 	ld a, [CurPartyMon]
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	pop bc
 	inc b
 .asm_2c633
 	ld a, b
-	cp $5
+	cp NUM_MOVES + 1
 	jr z, .asm_2c63f
 	inc hl
 	ld a, [hld]
@@ -42521,8 +42479,7 @@
 ; known jump sources: 2c7cd (b:47cd)
 Function2c7b6: ; 2c7b6 (b:47b6)
 	call Function2c7a7
-	ld a, $f
-	call Predef
+	predef GetTMHMMove
 	ret
 
 Function2c7bf: ; 2c7bf (b:47bf)
@@ -42604,13 +42561,14 @@
 ; 2c867
 
 Function2c867: ; 2c867
-	ld a, $e
-	call Predef
+	predef CanLearnTMHMMove
+
 	push bc
 	ld a, [CurPartyMon] ; $d109
-	ld hl, PartyMonNicknames ; $de41 (aliases: PartyMon1Nickname)
+	ld hl, PartyMonNicknames ; $de41 (aliases: PartyMonNicknames)
 	call GetNick
 	pop bc
+
 	ld a, c
 	and a
 	jr nz, .asm_2c88b
@@ -42622,31 +42580,34 @@
 	call PrintText
 	jr .asm_2c8b6
 .asm_2c88b
-	callab Functionf9ea
+
+	callab KnowsMove
 	jr c, .asm_2c8b6
-	ld a, $0
-	call Predef
+
+	predef LearnMove
 	ld a, b
 	and a
 	jr z, .asm_2c8b6
+
 	callba Function106049
-	ld a, [CurItem] ; $d106
+	ld a, [CurItem]
 	call IsHM
 	ret c
+
 	ld c, $5
 	callab ChangeHappiness
 	call Function2cb0c
-	jr Function2c8bd
+	jr .asm_2c8bd
+
 .asm_2c8b6
 	and a
 	ret
-; 2c8b8 (b:48b8)
 
-Function2c8b8: ; 2c8b8
+.asm_2c8b8
 	ld a, $2
 	ld [$d0ec], a
 
-Function2c8bd: ; 2c8bd
+.asm_2c8bd
 	scf
 	ret
 ; 2c8bf (b:48bf)
@@ -42745,8 +42706,7 @@
 	cp $3a
 	jr nc, Function2c915
 	ld [$d265], a
-	ld a, $f
-	call Predef
+	predef GetTMHMMove
 	ld a, [$d265]
 	ld [CurSpecies], a ; $cf60
 	hlcoord 1, 14
@@ -42836,9 +42796,10 @@
 
 ; known jump sources: 2c8d6 (b:48d6), 2c915 (b:4915), 2c9bf (b:49bf), 2c9dc (b:49dc)
 Function2c9e2: ; 2c9e2 (b:49e2)
-	ld a, [BattleType] ; $d230
-	cp $3
+	ld a, [BattleType]
+	cp BATTLETYPE_TUTORIAL
 	jp z, Function2caca
+
 	hlcoord 5, 2
 	ld bc, $a0f
 	ld a, $7f
@@ -42880,8 +42841,7 @@
 	pop af
 	ld [$d265], a
 .asm_2ca38
-	ld a, $f
-	call Predef
+	predef GetTMHMMove
 	ld a, [$d265]
 	ld [$d262], a
 	call GetMoveName
@@ -42945,8 +42905,7 @@
 	pop hl
 	ld bc, $0003
 	add hl, bc
-	ld a, $f
-	call Predef
+	predef GetTMHMMove
 	ld a, [$d265]
 	ld [$d262], a
 	call GetMoveName
@@ -43100,7 +43059,7 @@
 	ld hl, PartyMon1PokerusStatus
 	ld a, [PartyCount]
 	ld b, a
-	ld de, $0030
+	ld de, PartyMon2 - PartyMon1
 .loopMons
 	ld a, [hl]
 	and $f
@@ -43282,8 +43241,7 @@
 	add hl, de
 	ld a, [hl]
 	ld [BattleMonLevel], a
-	ld a, PREDEF_BATTLE_TRANSITION
-	call Predef
+	predef Function8c20f
 	callba Function3ed9f
 	ld a, 1
 	ld [hBGMapMode], a
@@ -43436,8 +43394,8 @@
 	ld [hl], a
 
 ; Clear the entire BattleMons area
-	ld hl, EnemyMoveStruct
-	ld bc, $0139
+	ld hl, wBattle
+	ld bc, wBattleEnd - wBattle
 	xor a
 	call ByteFill
 
@@ -43524,859 +43482,8 @@
 
 SECTION "bankE", ROMX, BANK[$E]
 
-Function38000: ; 38000
-	and a
-	ld a, [IsInBattle]
-	dec a
-	ret z
-	ld a, [InLinkBattle]
-	and a
-	ret nz
-	callba Function3e8d1
-	ret nz
-	ld a, [PlayerSubStatus5]
-	bit 7, a
-	jr nz, Function38041
-	ld a, [$c731]
-	and a
-	jr nz, Function38041
-	ld hl, TrainerClassAttributes + 5
-	ld a, [$cfc0]
-	and a
-	jr nz, .asm_38032
-	ld a, [TrainerClass]
-	dec a
-	ld bc, 7
-	call AddNTimes
+INCLUDE "battle/ai/items.asm"
 
-.asm_38032
-	bit 0, [hl]
-	jp nz, Function38045
-	bit 1, [hl]
-	jp nz, Function38083
-	bit 2, [hl]
-	jp nz, Function380c1
-	; fallthrough
-; 38041
-
-Function38041: ; 38041
-	call Function38105
-	ret
-; 38045
-
-Function38045: ; 38045
-	callab Function34941
-	ld a, [$c717]
-	and $f0
-	jp z, Function38041
-	cp $10
-	jr nz, .asm_38061
-	call Random
-	cp $80
-	jr c, .asm_38077
-	jp Function38041
-
-.asm_38061
-	cp $20
-	jr nz, .asm_3806f
-	call Random
-	cp $c8
-	jr c, .asm_38077
-	jp Function38041
-
-.asm_3806f
-	call Random
-	cp $a
-	jp c, Function38041
-
-.asm_38077
-	ld a, [$c717]
-	and $f
-	inc a
-	ld [$c718], a
-	jp Function3844b
-; 38083
-
-Function38083: ; 38083
-	callab Function34941
-	ld a, [$c717]
-	and $f0
-	jp z, Function38041
-	cp $10
-	jr nz, .asm_3809f
-	call Random
-	cp $14
-	jr c, .asm_380b5
-	jp Function38041
-
-.asm_3809f
-	cp $20
-	jr nz, .asm_380ad
-	call Random
-	cp $1e
-	jr c, .asm_380b5
-	jp Function38041
-
-.asm_380ad
-	call Random
-	cp $c8
-	jp c, Function38041
-
-.asm_380b5
-	ld a, [$c717]
-	and $f
-	inc a
-	ld [$c718], a
-	jp Function3844b
-; 380c1
-
-Function380c1: ; 380c1
-	callab Function34941
-	ld a, [$c717]
-	and $f0
-	jp z, Function38041
-	cp $10
-	jr nz, .asm_380dd
-	call Random
-	cp $32
-	jr c, .asm_380f3
-	jp Function38041
-
-.asm_380dd
-	cp $20
-	jr nz, .asm_380eb
-	call Random
-	cp $80
-	jr c, .asm_380f3
-	jp Function38041
-
-.asm_380eb
-	call Random
-	cp $32
-	jp c, Function38041
-
-.asm_380f3
-	ld a, [$c717]
-	and $f
-	inc a
-	ld [$c718], a
-	jp Function3844b
-; 380ff
-
-
-Function380ff: ; 380ff
-	ld a, [EnemySubStatus5]
-	bit 7, a
-	ret
-; 38105
-
-
-Function38105: ; 38105
-	ld a, [$cfc0]
-	and a
-	ret nz
-	ld a, [$c650]
-	ld b, a
-	ld a, [$c651]
-	or b
-	ret z
-	call Function38170
-	ret nc
-	ld a, [TrainerClass]
-	dec a
-	ld hl, TrainerClassAttributes + 5
-	ld bc, 7
-	call AddNTimes
-	ld b, h
-	ld c, l
-	ld hl, Unknown_38196
-	ld de, $c650
-.asm_3812c
-	ld a, [hl]
-	and a
-	inc a
-	ret z
-	ld a, [de]
-	cp [hl]
-	jr z, .asm_3813f
-	inc de
-	ld a, [de]
-	cp [hl]
-	jr z, .asm_3813f
-	dec de
-	inc hl
-	inc hl
-	inc hl
-	jr .asm_3812c
-
-.asm_3813f
-	inc hl
-	push hl
-	push de
-	ld de, .asm_3814a
-	push de
-	ld a, [hli]
-	ld h, [hl]
-	ld l, a
-	jp [hl]
-
-.asm_3814a
-	pop de
-	pop hl
-	inc hl
-	inc hl
-	jr c, .asm_3812c
-	xor a
-	ld [de], a
-	inc a
-	ld [$c70f], a
-	ld hl, EnemySubStatus3 ; $c66f
-	res 0, [hl]
-	xor a
-	ld [EnemyFuryCutterCount], a ; $c680
-	ld [$c681], a
-	ld [$c72c], a
-	ld hl, EnemySubStatus4 ; $c670
-	res 6, [hl]
-	xor a
-	ld [LastPlayerCounterMove], a ; $c6f9
-	scf
-	ret
-
-
-Function38170: ; 38170
-	ld a, [OTPartyCount]
-	ld d, a
-	ld e, $0
-	ld hl, OTPartyMon1Level
-	ld bc, $0030
-.asm_3817c
-	ld a, [hl]
-	cp e
-	jr c, .asm_38181
-	ld e, a
-.asm_38181
-	add hl, bc
-	dec d
-	jr nz, .asm_3817c
-
-	ld a, [CurOTMon]
-	ld hl, OTPartyMon1Level
-	call AddNTimes
-	ld a, [hl]
-	cp e
-	jr nc, .asm_38194
-	and a
-	ret
-
-.asm_38194
-	scf
-	ret
-; 38196
-
-Unknown_38196: ; 39196
-	dbw FULL_RESTORE, Function38208
-	dbw MAX_POTION,   Function38220
-	dbw HYPER_POTION, Function38284
-	dbw SUPER_POTION, Function38292
-	dbw POTION,       Function382a0
-	dbw X_ACCURACY,   Function382f9
-	dbw FULL_HEAL,    Function381be
-	dbw GUARD_SPEC,   Function38305
-	dbw DIRE_HIT,     Function38311
-	dbw X_ATTACK,     Function3831d
-	dbw X_DEFEND,     Function38329
-	dbw X_SPEED,      Function38335
-	dbw X_SPECIAL,    Function38341
-	db $ff
-; 381be
-
-Function381be: ; 381be
-	call Function381ca
-	jp c, Function38383
-	call Function383a3
-	jp Function38385
-; 381ca
-
-; known jump sources: 381be (e:41be), 38214 (e:4214)
-Function381ca: ; 381ca (e:41ca)
-	ld a, [EnemyMonStatus] ; $d214
-	and a
-	jp z, Function38383
-	ld a, [bc]
-	bit 6, a
-	jr nz, .asm_381e7
-	ld a, [bc]
-	bit 4, a
-	jp nz, Function38385
-	call Random
-	cp $32
-	jp c, Function38385
-	jp Function38383
-
-.asm_381e7
-	ld a, [EnemySubStatus5] ; $c671
-	bit 0, a
-	jr z, .asm_381fd
-	ld a, [$c67c]
-	cp $4
-	jr c, .asm_381fd
-	call Random
-	cp $80
-	jp c, Function38385
-.asm_381fd
-	ld a, [EnemyMonStatus] ; $d214
-	and $27
-	jp z, Function38383
-	jp Function38385
-; 38208
-
-Function38208: ; 38208
-	call Function3822c
-	jp nc, Function3821a
-	ld a, [bc]
-	bit 6, a
-	jp z, Function38383
-	call Function381ca
-	jp c, Function38383
-
-; known jump sources: 3820b (e:420b)
-Function3821a: ; 3821a (e:421a)
-	call Function383b5
-	jp Function38385
-; 38220
-
-Function38220: ; 38220
-	call Function3822c
-	jp c, Function38383
-	call Function383ae
-	jp Function38385
-
-; known jump sources: 38208 (e:4208), 38220 (e:4220), 38284 (e:4284)
-Function3822c: ; 3822c (e:422c)
-	ld a, [bc]
-	bit 6, a
-	jr nz, Function38267
-	callab AICheckEnemyHalfHP
-	jp c, Function38383
-	ld a, [bc]
-	bit 5, a
-	jp nz, Function38254
-	callab AICheckEnemyQuarterHP
-	jp nc, Function38281
-	call Random
-	cp $80
-	jp c, Function38281
-	jp Function38383
-
-; known jump sources: 3823d (e:423d)
-Function38254: ; 38254 (e:4254)
-	callab AICheckEnemyQuarterHP
-	jp c, Function38383
-	call Random
-	cp $32
-	jp c, Function38383
-	jr Function38281
-
-Function38267: ; 38267 (e:4267)
-	callab AICheckEnemyHalfHP
-	jp c, Function38383
-	callab AICheckEnemyQuarterHP
-	jp nc, Function38281
-	call Random
-	cp $32
-	jp nc, Function38383
-
-; known jump sources: 38246 (e:4246), 3824e (e:424e), 38265 (e:4265), 38276 (e:4276)
-Function38281: ; 38281 (e:4281)
-	jp Function38385
-; 38284
-
-Function38284: ; 38284
-	call Function3822c
-	jp c, Function38383
-	ld b, 200
-	call Function383f4
-	jp Function38385
-; 38292 (e:4292)
-
-Function38292: ; 38292
-	call Function3822c
-	jp c, Function38383
-
-Function38298: ; 38298
-	ld b, 50
-	call Function383ee
-	jp Function38385
-; 382a0
-
-Function382a0: ; 382a0
-	call Function3822c
-	jp c, Function38383
-	ld b, 20
-	call Function383e8
-	jp Function38385
-; 382ae
-
-Function382ae: ; 382ae
-	callab AICheckEnemyMaxHP
-	jr c, .asm_382e4
-	push bc
-	ld de, EnemyMonMaxHPLo
-	ld hl, EnemyMonHPLo
-	ld a, [de]
-	sub [hl]
-	jr z, .asm_382e7
-	dec hl
-	dec de
-	ld c, a
-	sbc [hl]
-	and a
-	jr nz, .asm_382e7
-	ld a, c
-	cp b
-	jp c, .asm_382d5
-	callab AICheckEnemyQuarterHP
-	jr c, .asm_382e7
-
-.asm_382d5
-	pop bc
-	ld a, [bc]
-	bit 5, a
-	jp z, Function38385
-	call Random
-	cp $80
-	jp c, Function38385
-
-.asm_382e4
-	jp Function38383
-
-.asm_382e7
-	pop bc
-	ld a, [bc]
-	bit 5, a
-	jp z, Function38383
-	call Random
-	cp $64
-	jp c, Function38385
-	jp Function38383
-; 382f9
-
-Function382f9: ; 382f9
-	call Function3834d
-	jp c, Function38383
-	call Function384f7
-	jp Function38385
-; 38305
-
-Function38305: ; 38305
-	call Function3834d
-	jp c, Function38383
-	call Function38504
-	jp Function38385
-; 38311
-
-Function38311: ; 38311
-	call Function3834d
-	jp c, Function38383
-	call Function38511
-	jp Function38385
-; 3831d (e:431d)
-
-Function3831d: ; 3831d
-	call Function3834d
-	jp c, Function38383
-	call Function38541
-	jp Function38385
-; 38329
-
-Function38329: ; 38329
-	call Function3834d
-	jp c, Function38383
-	call Function38547
-	jp Function38385
-; 38335
-
-Function38335: ; 38335
-	call Function3834d
-	jp c, Function38383
-	call Function3854d
-	jp Function38385
-; 38341
-
-Function38341: ; 38341
-	call Function3834d
-	jp c, Function38383
-	call Function38553
-	jp Function38385
-; 3834d
-
-; known jump sources: 38311 (e:4311)
-Function3834d: ; 3834d (e:434d)
-	ld a, [EnemyTurnsTaken] ; $c6dc
-	and a
-	jr nz, .asm_38372
-	ld a, [bc]
-	bit 4, a
-	jp nz, Function38385
-	call Random
-	cp $80
-	jp c, Function38383
-	ld a, [bc]
-	bit 6, a
-	jp nz, Function38385
-	call Random
-	cp $80
-	jp c, Function38383
-	jp Function38385
-.asm_38372
-	ld a, [bc]
-	bit 4, a
-	jp z, Function38383
-	call Random
-	cp $32
-	jp nc, Function38383
-	jp Function38385
-
-; known jump sources: 381c1 (e:41c1), 381ce (e:41ce), 381e4 (e:41e4), 38202 (e:4202), 38211 (e:4211), 38217 (e:4217), 38223 (e:4223), 38237 (e:4237), 38251 (e:4251), 3825a (e:425a), 38262 (e:4262), 3826d (e:426d), 3827e (e:427e), 38287 (e:4287), 38314 (e:4314), 3835e (e:435e), 3836c (e:436c), 38375 (e:4375), 3837d (e:437d)
-Function38383: ; 38383 (e:4383)
-	scf
-	ret
-
-; known jump sources: 381c7 (e:41c7), 381d9 (e:41d9), 381e1 (e:41e1), 381fa (e:41fa), 38205 (e:4205), 3821d (e:421d), 38229 (e:4229), 38281 (e:4281), 3828f (e:428f), 3831a (e:431a), 38356 (e:4356), 38364 (e:4364), 3836f (e:436f), 38380 (e:4380)
-Function38385: ; 38385 (e:4385)
-	and a
-	ret
-
-
-Function38387: ; 38387
-	call UpdateEnemyMonInParty
-	callba Function3e036
-	ld a, $1
-	ld [hBGMapMode], a
-	ld hl, $c6e6
-	dec [hl]
-	scf
-	ret
-; 3839a
-
-Function3839a: ; 3839a
-	push de
-	ld de, SFX_FULL_HEAL
-	call PlaySFX
-	pop de
-	ret
-; 383a3
-
-
-; known jump sources: 381c4 (e:41c4)
-Function383a3: ; 383a3 (e:43a3)
-	call Function3839a
-	call Function384e0
-	ld a, $26
-	jp Function38568
-
-; known jump sources: 38226 (e:4226)
-Function383ae: ; 383ae (e:43ae)
-	ld a, $f
-	ld [$d1f1], a
-	jr asm_383c6
-
-; known jump sources: 3821a (e:421a)
-Function383b5: ; 383b5 (e:43b5)
-	call Function384e0
-	ld a, $e
-	ld [$d1f1], a
-	ld hl, EnemySubStatus3 ; $c66f
-	res 7, [hl]
-	xor a
-	ld [EnemyConfuseCount], a ; $c67b
-asm_383c6: ; 383c6 (e:43c6)
-	ld de, $d1ec
-	ld hl, EnemyMonHPLo ; $d217
-	ld a, [hld]
-	ld [de], a
-	inc de
-	ld a, [hl]
-	ld [de], a
-	inc de
-	ld hl, EnemyMonMaxHPLo ; $d219
-	ld a, [hld]
-	ld [de], a
-	inc de
-	ld [Buffer1], a ; $d1ea (aliases: MagikarpLength)
-	ld [EnemyMonHPLo], a ; $d217
-	ld a, [hl]
-	ld [de], a
-	ld [Buffer2], a ; $d1eb (aliases: MovementType)
-	ld [EnemyMonHPHi], a ; $d216 (aliases: EnemyMonHP)
-	jr asm_38436
-; 383e8 (e:43e8)
-
-Function383e8: ; 383e8
-	ld a, POTION
-	ld b, 20
-	jr Function383f8
-
-Function383ee: ; 383ee
-	ld a, SUPER_POTION
-	ld b, 50
-	jr Function383f8
-
-; known jump sources: 3828c (e:428c)
-Function383f4: ; 383f4 (e:43f4)
-	ld a, HYPER_POTION
-	ld b, 200
-
-Function383f8: ; 383f8
-	ld [$d1f1], a
-	ld hl, EnemyMonHPLo ; $d217
-	ld a, [hl]
-	ld [$d1ec], a
-	add b
-	ld [hld], a
-	ld [$d1ee], a
-	ld a, [hl]
-	ld [$d1ed], a
-	ld [$d1ef], a
-	jr nc, .asm_38415
-	inc a
-	ld [hl], a
-	ld [$d1ef], a
-.asm_38415
-	inc hl
-	ld a, [hld]
-	ld b, a
-	ld de, EnemyMonMaxHPLo ; $d219
-	ld a, [de]
-	dec de
-	ld [Buffer1], a ; $d1ea (aliases: MagikarpLength)
-	sub b
-	ld a, [hli]
-	ld b, a
-	ld a, [de]
-	ld [Buffer2], a ; $d1eb (aliases: MovementType)
-	sbc b
-	jr nc, asm_38436
-	inc de
-	ld a, [de]
-	dec de
-	ld [hld], a
-	ld [$d1ee], a
-	ld a, [de]
-	ld [hl], a
-	ld [$d1ef], a
-asm_38436: ; 38436 (e:4436)
-	call Function38571
-	hlcoord 2, 2
-	xor a
-	ld [$d10a], a
-	call Function3839a
-	ld a, $b
-	call Predef
-	jp Function38387
-
-
-Function3844b: ; 3844b
-	ld a, [OTPartyCount]
-	ld c, a
-	ld hl, OTPartyMon1HP
-	ld d, 0
-.asm_38454
-	ld a, [hli]
-	ld b, a
-	ld a, [hld]
-	or b
-	jr z, .asm_3845b
-	inc d
-
-.asm_3845b
-	push bc
-	ld bc, $0030
-	add hl, bc
-	pop bc
-	dec c
-	jr nz, .asm_38454
-	ld a, d
-	cp $2
-	jp nc, Function3846c
-	and a
-	ret
-; 3846c
-
-Function3846c: ; 3846c
-	ld a, $1
-	ld [$c711], a
-	ld [$c70f], a
-	ld hl, EnemySubStatus4
-	res 6, [hl]
-	xor a
-	ld [hBattleTurn], a
-	callab Function3dc5b
-	push af
-	ld a, [CurOTMon]
-	ld hl, OTPartyMon1Status
-	ld bc, $0030
-	call AddNTimes
-	ld d, h
-	ld e, l
-	ld hl, EnemyMonStatus
-	ld bc, $0004
-	call CopyBytes
-	pop af
-	jr c, .asm_384a3
-	ld hl, UnknownText_0x384d0
-	call PrintText
-
-.asm_384a3
-	ld a, $1
-	ld [$d264], a
-	callab NewEnemyMonStatus
-	callab ResetEnemyStatLevels
-	ld hl, PlayerSubStatus1
-	res 7, [hl]
-	callba Function3d4e1
-	callba Function3d57a
-	xor a
-	ld [$d264], a
-	ld a, [InLinkBattle]
-	and a
-	ret nz
-	scf
-	ret
-; 384d0
-
-UnknownText_0x384d0: ; 384d0
-	text_jump UnknownText_0x1bcf9c
-	db "@"
-; 384d5
-
-Function384d5: ; 384d5
-	call Function3839a
-	call Function384e0
-	ld a, $34
-	jp Function38568
-; 384e0
-
-Function384e0: ; 384e0
-	ld a, [CurOTMon]
-	ld hl, OTPartyMon1Status
-	ld bc, $0030
-	call AddNTimes
-	xor a
-	ld [hl], a
-	ld [EnemyMonStatus], a
-	ld hl, EnemySubStatus5
-	res 0, [hl]
-	ret
-; 384f7
-
-Function384f7: ; 384f7
-	call Function3839a
-	ld hl, EnemySubStatus4
-	set 0, [hl]
-	ld a, $21
-	jp Function38568
-; 38504
-
-Function38504: ; 38504
-	call Function3839a
-	ld hl, EnemySubStatus4
-	set 1, [hl]
-	ld a, $29
-	jp Function38568
-; 38511
-
-Function38511: ; 38511
-	call Function3839a
-	ld hl, EnemySubStatus4
-	set 2, [hl]
-	ld a, $2c
-	jp Function38568
-; 3851e
-
-Function3851e: ; 3851e
-	ld [hMultiplier], a
-	ld hl, EnemyMonMaxHPHi
-	ld a, [hli]
-	ld [hProduct], a
-	ld a, [hl]
-	ld [hMultiplicand], a
-	ld b, $2
-	call Divide
-	ld a, [$ffb6]
-	ld c, a
-	ld a, [$ffb5]
-	ld b, a
-	ld hl, EnemyMonHPLo
-	ld a, [hld]
-	ld e, a
-	ld a, [hl]
-	ld d, a
-	ld a, d
-	sub b
-	ret nz
-	ld a, e
-	sub c
-	ret
-; 38541
-
-Function38541: ; 38541
-	ld b, $0
-	ld a, $31
-	jr Function38557
-; 38547
-
-Function38547: ; 38547
-	ld b, $1
-	ld a, $33
-	jr Function38557
-; 3854d
-
-Function3854d: ; 3854d
-	ld b, $2
-	ld a, $34
-	jr Function38557
-; 38553
-
-Function38553: ; 38553
-	ld b, $3
-	ld a, $35
-
-Function38557
-	ld [$d1f1], a
-	push bc
-	call Function38571
-	pop bc
-	callba Function361ef
-	jp Function38387
-; 38568
-
-
-Function38568: ; 38568
-	ld [$d1f1], a
-	call Function38571
-	jp Function38387
-; 38571
-
-Function38571: ; 38571
-	ld a, [$d1f1]
-	ld [$d265], a
-	call GetItemName
-	ld hl, StringBuffer1
-	ld de, $d050
-	ld bc, $000d
-	call CopyBytes
-	ld hl, UnknownText_0x3858c
-	jp PrintText
-; 3858c
-
-UnknownText_0x3858c: ; 3858c
-	text_jump UnknownText_0x1bcfaf
-	db "@"
-; 38591
-
-
 AIScoring: ; 38591
 INCLUDE "battle/ai/scoring.asm"
 
@@ -44384,19 +43491,20 @@
 Function3952d: ; 3952d
 	ld hl, RivalName
 	ld a, c
-	cp $9
-	jr z, .asm_39544
+	cp RIVAL1
+	jr z, .rival
+
 	ld [CurSpecies], a
-	ld a, $7
+	ld a, TRAINER_NAME
 	ld [$cf61], a
 	call GetName
 	ld de, StringBuffer1
 	ret
 
-.asm_39544
+.rival
 	ld de, StringBuffer1
 	push de
-	ld bc, $000b
+	ld bc, NAME_LENGTH
 	call CopyBytes
 	pop de
 	ret
@@ -44406,20 +43514,22 @@
 	ld hl, $d26b
 	ld a, [InLinkBattle]
 	and a
-	jr nz, .asm_3956f
+	jr nz, .ok
+
 	ld hl, RivalName
 	ld a, c
-	cp $9
-	jr z, .asm_3956f
+	cp RIVAL1
+	jr z, .ok
+
 	ld [CurSpecies], a
-	ld a, $7
+	ld a, TRAINER_NAME
 	ld [$cf61], a
 	call GetName
 	ld hl, StringBuffer1
 
-.asm_3956f
+.ok
 	ld bc, $000d
-	ld de, $c656
+	ld de, OTName
 	push de
 	call CopyBytes
 	pop de
@@ -44449,34 +43559,38 @@
 INCLUDE "trainers/attributes.asm"
 
 
-Function39771: ; 39771
+ReadTrainerParty: ; 39771
 	ld a, [$cfc0]
 	bit 0, a
 	ret nz
+
 	ld a, [InLinkBattle]
 	and a
 	ret nz
+
 	ld hl, OTPartyCount
 	xor a
 	ld [hli], a
 	dec a
 	ld [hl], a
-	ld hl, OTPartyMon1Species
-	ld bc, $0120
+
+	ld hl, OTPartyMons
+	ld bc, OTPartyMonsEnd - OTPartyMons
 	xor a
 	call ByteFill
+
 	ld a, [OtherTrainerClass]
-	cp $c
-	jr nz, .asm_3979e
+	cp CAL
+	jr nz, .not_cal2
 	ld a, [OtherTrainerID]
-	cp $2
-	jr z, .asm_397d3
+	cp CAL2
+	jr z, .cal2
 	ld a, [OtherTrainerClass]
+.not_cal2
 
-.asm_3979e
 	dec a
 	ld c, a
-	ld b, $0
+	ld b, 0
 	ld hl, TrainerGroups
 	add hl, bc
 	add hl, bc
@@ -44483,162 +43597,175 @@
 	ld a, [hli]
 	ld h, [hl]
 	ld l, a
+
 	ld a, [OtherTrainerID]
 	ld b, a
-.asm_397ae
+.skip_trainer
 	dec b
-	jr z, .asm_397b8
-.asm_397b1
+	jr z, .got_trainer
+.next
 	ld a, [hli]
 	cp $ff
-	jr nz, .asm_397b1
-	jr .asm_397ae
+	jr nz, .next
+	jr .skip_trainer
+.got_trainer
 
-.asm_397b8
+.skip_name
 	ld a, [hli]
-	cp $50
-	jr nz, .asm_397b8
+	cp "@"
+	jr nz, .skip_name
+
 	ld a, [hli]
 	ld c, a
-	ld b, $0
+	ld b, 0
 	ld d, h
 	ld e, l
-	ld hl, Jumptable_397e3
+	ld hl, TrainerTypes
 	add hl, bc
 	add hl, bc
 	ld a, [hli]
 	ld h, [hl]
 	ld l, a
-	ld bc, .asm_397d0
+	ld bc, .done
 	push bc
 	jp [hl]
 
-.asm_397d0
+.done
 	jp Function3991b
 
-.asm_397d3
+.cal2
 	ld a, $0
 	call GetSRAMBank
 	ld de, $ac0a
-	call Function39806
+	call TrainerType2
 	call CloseSRAM
-	jr .asm_397d0
+	jr .done
 ; 397e3
 
-Jumptable_397e3: ; 397e3
-	dw Function397eb
-	dw Function39806
-	dw Function39871
-	dw Function3989d
+TrainerTypes: ; 397e3
+	dw TrainerType1 ; level, species
+	dw TrainerType2 ; level, species, moves
+	dw TrainerType3 ; level, species, item
+	dw TrainerType4 ; level, species, item, moves
 ; 397eb
 
-Function397eb: ; 397eb
+TrainerType1: ; 397eb
+; normal (level, species)
 	ld h, d
 	ld l, e
-.asm_397ed
+.loop
 	ld a, [hli]
 	cp $ff
 	ret z
-	ld [CurPartyLevel], a ; $d143
+
+	ld [CurPartyLevel], a
 	ld a, [hli]
-	ld [CurPartySpecies], a ; $d108
-	ld a, $1
-	ld [MonType], a ; $cf5f
+	ld [CurPartySpecies], a
+	ld a, OTPARTYMON
+	ld [MonType], a
 	push hl
-	ld a, $6
-	call Predef
+	predef Functiond88c
 	pop hl
-	jr .asm_397ed
+	jr .loop
 ; 39806
 
-Function39806: ; 39806
+TrainerType2: ; 39806
+; moves
 	ld h, d
 	ld l, e
-.asm_39808
+.loop
 	ld a, [hli]
 	cp $ff
 	ret z
+
 	ld [CurPartyLevel], a
 	ld a, [hli]
 	ld [CurPartySpecies], a
-	ld a, $1
+	ld a, OTPARTYMON
 	ld [MonType], a
+
 	push hl
-	ld a, $6
-	call Predef
+	predef Functiond88c
 	ld a, [OTPartyCount]
 	dec a
-	ld hl, OTPartyMon1Move1
-	ld bc, $0030
+	ld hl, OTPartyMon1Moves
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	ld d, h
 	ld e, l
 	pop hl
-	ld b, $4
-.asm_39830
+
+	ld b, NUM_MOVES
+.copy_moves
 	ld a, [hli]
 	ld [de], a
 	inc de
 	dec b
-	jr nz, .asm_39830
+	jr nz, .copy_moves
+
 	push hl
+
 	ld a, [OTPartyCount]
 	dec a
 	ld hl, OTPartyMon1Species
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	ld d, h
 	ld e, l
-	ld hl, $0017
+	ld hl, OTPartyMon1PP - OTPartyMon1
 	add hl, de
 	push hl
-	ld hl, $0002
+	ld hl, OTPartyMon1Moves - OTPartyMon1
 	add hl, de
 	pop de
-	ld b, $4
-.asm_39852
+
+	ld b, NUM_MOVES
+.copy_pp
 	ld a, [hli]
 	and a
-	jr z, .asm_3986e
+	jr z, .copied_pp
+
 	push hl
 	push bc
 	dec a
 	ld hl, Moves + MOVE_PP
-	ld bc, Move2 - Move1
+	ld bc, MOVE_LENGTH
 	call AddNTimes
 	ld a, BANK(Moves)
 	call GetFarByte
 	pop bc
 	pop hl
+
 	ld [de], a
 	inc de
 	dec b
-	jr nz, .asm_39852
+	jr nz, .copy_pp
+.copied_pp
 
-.asm_3986e
 	pop hl
-	jr .asm_39808
+	jr .loop
 ; 39871
 
-Function39871: ; 39871
+TrainerType3: ; 39871
+; item
 	ld h, d
 	ld l, e
-.asm_39873
+.loop
 	ld a, [hli]
 	cp $ff
 	ret z
-	ld [CurPartyLevel], a ; $d143
+
+	ld [CurPartyLevel], a
 	ld a, [hli]
-	ld [CurPartySpecies], a ; $d108
-	ld a, $1
-	ld [MonType], a ; $cf5f
+	ld [CurPartySpecies], a
+	ld a, OTPARTYMON
+	ld [MonType], a
 	push hl
-	ld a, $6
-	call Predef
-	ld a, [OTPartyCount] ; $d280
+	predef Functiond88c
+	ld a, [OTPartyCount]
 	dec a
-	ld hl, OTPartyMon1Item ; $d289
-	ld bc, $30
+	ld hl, OTPartyMon1Item
+	ld bc, OTPartyMon2 - OTPartyMon1
 	call AddNTimes
 	ld d, h
 	ld e, l
@@ -44645,69 +43772,80 @@
 	pop hl
 	ld a, [hli]
 	ld [de], a
-	jr .asm_39873
+	jr .loop
 ; 3989d (e:589d)
 
-Function3989d: ; 3989d
+TrainerType4: ; 3989d
+; item + moves
 	ld h, d
 	ld l, e
-.asm_3989f
+.loop
 	ld a, [hli]
 	cp $ff
 	ret z
+
 	ld [CurPartyLevel], a
 	ld a, [hli]
 	ld [CurPartySpecies], a
-	ld a, $1
+
+	ld a, OTPARTYMON
 	ld [MonType], a
+
 	push hl
-	ld a, $6
-	call Predef
+	predef Functiond88c
 	ld a, [OTPartyCount]
 	dec a
-	ld hl, $d289
-	ld bc, $0030
+	ld hl, OTPartyMon1Item
+	ld bc, OTPartyMon2 - OTPartyMon1
 	call AddNTimes
 	ld d, h
 	ld e, l
 	pop hl
+
 	ld a, [hli]
 	ld [de], a
+
 	push hl
 	ld a, [OTPartyCount]
 	dec a
-	ld hl, $d28a
-	ld bc, $0030
+	ld hl, OTPartyMon1Moves
+	ld bc, OTPartyMon2 - OTPartyMon1
 	call AddNTimes
 	ld d, h
 	ld e, l
 	pop hl
-	ld b, $4
-.asm_398da
+
+	ld b, NUM_MOVES
+.copy_moves
 	ld a, [hli]
 	ld [de], a
 	inc de
 	dec b
-	jr nz, .asm_398da
+	jr nz, .copy_moves
+
 	push hl
+
 	ld a, [OTPartyCount]
 	dec a
 	ld hl, OTPartyMon1
-	ld bc, $0030
+	ld bc, OTPartyMon2 - OTPartyMon1
 	call AddNTimes
 	ld d, h
 	ld e, l
-	ld hl, $0017
+	ld hl, OTPartyMon1PP - OTPartyMon1
 	add hl, de
+
 	push hl
-	ld hl, $0002
+	ld hl, OTPartyMon1Moves - OTPartyMon1
 	add hl, de
 	pop de
-	ld b, $4
-.asm_398fc
+
+	ld b, NUM_MOVES
+.copy_pp
 	ld a, [hli]
 	and a
-	jr z, .asm_39918
+	jr z, .copied_pp
+
 	push hl
 	push bc
 	dec a
@@ -44718,34 +43856,34 @@
 	call GetFarByte
 	pop bc
 	pop hl
+
 	ld [de], a
 	inc de
 	dec b
-	jr nz, .asm_398fc
+	jr nz, .copy_pp
+.copied_pp
 
-.asm_39918
 	pop hl
-	jr .asm_3989f
+	jr .loop
 ; 3991b
 
-; known jump sources: 397d0 (e:57d0)
 Function3991b: ; 3991b (e:591b)
-	ld hl, hPastLeadingZeroes ; $ffb3 (aliases: hDividend, hProduct)
+	ld hl, $ffb3
 	xor a
 	ld [hli], a
 	ld [hli], a
 	ld [hli], a
-	ld a, [$c652]
+	ld a, [$c652] ; base reward
 	ld [hli], a
-	ld a, [CurPartyLevel] ; $d143
+	ld a, [CurPartyLevel]
 	ld [hl], a
 	call Multiply
 	ld hl, $c686
 	xor a
 	ld [hli], a
-	ld a, [$FF00+$b5]
+	ld a, [$ffb5]
 	ld [hli], a
-	ld a, [$FF00+$b6]
+	ld a, [$ffb6]
 	ld [hl], a
 	ret
 
@@ -44763,8 +43901,9 @@
 
 Function3994c:: ; 3994c
 	ld a, c
-	cp $c
+	cp CAL
 	jr nz, .asm_3996d
+
 	ld a, $0
 	call GetSRAMBank
 	ld a, [$abfd]
@@ -44771,6 +43910,7 @@
 	and a
 	call CloseSRAM
 	jr z, .asm_3996d
+
 	ld a, $0
 	call GetSRAMBank
 	ld hl, $abfe
@@ -44792,6 +43932,7 @@
 .asm_3997a
 	dec b
 	jr z, Function39984
+
 .asm_3997d
 	ld a, [hli]
 	cp $ff
@@ -45274,8 +44415,7 @@
 	call Function40bb1
 	ld a, [$c7e4]
 	ld e, a
-	ld a, $32
-	call Predef
+	predef Function91d11
 	call Function41401
 	call DelayFrame
 	xor a
@@ -46485,7 +45625,7 @@
 
 Function40bdc: ; 40bdc
 	ld hl, PlayerSDefLevel
-	ld bc, Start
+	ld bc, $100
 	xor a
 	call ByteFill
 	ld a, [$c7d4]
@@ -47303,8 +46443,7 @@
 	ld [CurPartySpecies], a
 	call GetBaseData
 	ld de, VTiles2
-	ld a, $3c
-	call Predef
+	predef GetFrontpic
 	ret
 
 .asm_4145b
@@ -47465,8 +46604,7 @@
 	ld [CurPartySpecies], a ; $d108
 	call GetBaseData
 	ld de, $9000
-	ld a, $3c
-	call Predef
+	predef GetFrontpic
 	pop af
 	ld [UnownLetter], a ; $d234
 	ret
@@ -47496,8 +46634,7 @@
 	call WaitBGMap
 	call GetBaseData
 	ld de, VTiles2
-	ld a, $3c
-	call Predef
+	predef GetFrontpic
 	ld a, $4
 	call Function41423
 	ld a, [CurPartySpecies]
@@ -47601,8 +46738,7 @@
 	push hl
 	xor a
 	ld [MonType], a
-	ld a, $1f
-	call Predef
+	predef Function5084a
 	pop hl
 
 .asm_42230
@@ -47644,8 +46780,8 @@
 	jp z, .asm_423f8
 
 	push hl
-	ld de, TempMonAtk
-	ld hl, TempMonDef
+	ld de, TempMonAttack
+	ld hl, TempMonDefense
 	ld c, 2
 	call StringCmp
 	ld a, ATK_EQ_DEF
@@ -47753,7 +46889,7 @@
 	ld a, [hl]
 	ld [Buffer2], a
 	ld a, [CurPartyMon]
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call GetNick
 	call CopyName1
 	ld hl, UnknownText_0x42482
@@ -47812,8 +46948,7 @@
 	ld hl, $d118
 	ld de, TempMonMaxHP
 	ld b, $1
-	ld a, PREDEF_FILLSTATS
-	call Predef
+	predef Functione167
 
 	ld a, [CurPartyMon]
 	ld hl, PartyMons
@@ -47842,7 +46977,7 @@
 	ld [hl], a
 
 	ld hl, TempMonSpecies
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call CopyBytes
 
 	ld a, [CurSpecies]
@@ -47849,7 +46984,7 @@
 	ld [$d265], a
 	xor a
 	ld [MonType], a
-	call Function42487
+	call LearnLevelMoves
 	ld a, [$d265]
 	dec a
 	call SetSeenAndCaughtMon
@@ -47859,8 +46994,7 @@
 	jr nz, .asm_423ec
 
 	ld hl, TempMonDVs
-	ld a, PREDEF_GET_UNOWN_LETTER
-	call Predef
+	predef GetUnownLetter
 	callab Functionfba18
 
 .asm_423ec
@@ -47922,7 +47056,7 @@
 	jr nz, .asm_4242b
 	ld a, [CurPartyMon]
 	ld bc, $000b
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call AddNTimes
 	push hl
 	ld a, [CurSpecies]
@@ -47979,7 +47113,7 @@
 ; 0x42487
 
 
-Function42487: ; 42487
+LearnLevelMoves: ; 42487
 	ld a, [$d265]
 	ld [CurPartySpecies], a
 	dec a
@@ -47991,50 +47125,54 @@
 	ld a, [hli]
 	ld h, [hl]
 	ld l, a
-.asm_42499
+
+.skip_evos
 	ld a, [hli]
 	and a
-	jr nz, .asm_42499
-.asm_4249d
+	jr nz, .skip_evos
+
+.find_move
 	ld a, [hli]
 	and a
-	jr z, .asm_424da
+	jr z, .done
+
 	ld b, a
 	ld a, [CurPartyLevel]
 	cp b
 	ld a, [hli]
-	jr nz, .asm_4249d
+	jr nz, .find_move
+
 	push hl
 	ld d, a
-	ld hl, PartyMon1Move1
+	ld hl, PartyMon1Moves
 	ld a, [CurPartyMon]
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
-	ld b, $4
-.asm_424b9
+
+	ld b, NUM_MOVES
+.check_move
 	ld a, [hli]
 	cp d
-	jr z, .asm_424c2
+	jr z, .has_move
 	dec b
-	jr nz, .asm_424b9
-	jr .asm_424c5
+	jr nz, .check_move
+	jr .learn
+.has_move
 
-.asm_424c2
 	pop hl
-	jr .asm_4249d
+	jr .find_move
 
-.asm_424c5
+.learn
 	ld a, d
 	ld [$d262], a
 	ld [$d265], a
 	call GetMoveName
 	call CopyName1
-	ld a, $0
-	call Predef
+	predef LearnMove
 	pop hl
-	jr .asm_4249d
+	jr .find_move
 
-.asm_424da
+.done
 	ld a, [CurPartySpecies]
 	ld [$d265], a
 	ret
@@ -48042,7 +47180,7 @@
 
 
 FillMoves: ; 424e1
-; Fill in moves at de for CurPartySpecies at CurPartyLevle
+; Fill in moves at de for CurPartySpecies at CurPartyLevel
 
 	push hl
 	push de
@@ -48113,7 +47251,7 @@
 	and a
 	jr z, .ShiftedMove
 	push de
-	ld bc, PartyMon1PP - PartyMon1Move4
+	ld bc, PartyMon1PP - (PartyMon1Moves + NUM_MOVES - 1)
 	add hl, bc
 	ld d, h
 	ld e, l
@@ -48136,7 +47274,7 @@
 	push hl
 	dec a
 	ld hl, Moves + MOVE_PP
-	ld bc, Move2 - Move1
+	ld bc, MOVE_LENGTH
 	call AddNTimes
 	ld a, BANK(Moves)
 	call GetFarByte
@@ -48153,7 +47291,7 @@
 ; 4256e
 
 ShiftMoves: ; 4256e
-	ld c, $3
+	ld c, NUM_MOVES - 1
 .asm_42570
 	inc de
 	ld a, [de]
@@ -48167,8 +47305,7 @@
 Function42577: ; 42577
 	push de
 	ld d, $0
-	ld a, $3
-	call Predef
+	predef FlagPredef
 	pop de
 	ret
 ; 42581
@@ -48260,7 +47397,7 @@
 	and a
 	jr z, .CheckPP
 
-	ld hl, EnemyMonMove1
+	ld hl, EnemyMonMoves
 	ld c, 0
 .CheckDisabledMove
 	cp [hl]
@@ -48321,8 +47458,7 @@
 
 	push bc
 	ld d, $e ; BANK(TrainerAI)
-	ld a, PREDEF_FLAG
-	call Predef
+	predef FlagPredef
 	ld d, c
 	pop bc
 
@@ -48372,12 +47508,12 @@
 	inc [hl]
 	dec hl
 	inc a
-	cp EnemyMonMovesEnd - EnemyMonMoves + 1
+	cp NUM_MOVES + 1
 	jr nz, .asm_44175
 
 	ld hl, Buffer1
 	ld de, EnemyMonMoves
-	ld c, EnemyMonMovesEnd - EnemyMonMoves
+	ld c, NUM_MOVES
 .asm_44184
 	ld a, [de]
 	and a
@@ -48439,14 +47575,16 @@
 Function441cf: ; 441cf
 	ld hl, Unknown_441fc
 	ld b, 25
-.asm_441d4
+.loop
 	ld a, [hli]
+
+	; Wrap around
 	cp $fe
-	jr nz, .asm_441dd
+	jr nz, .ok
 	ld hl, Unknown_441fc
 	ld a, [hli]
+.ok
 
-.asm_441dd
 	ld [$c7db], a
 	ld a, [hli]
 	ld c, a
@@ -48457,7 +47595,7 @@
 	pop bc
 	call DelayFrames
 	dec b
-	jr nz, .asm_441d4
+	jr nz, .loop
 	xor a
 	ld [$c7db], a
 	call Function44207
@@ -48467,11 +47605,11 @@
 ; 441fc
 
 Unknown_441fc: ; 441fc
-	db $00, $07
-	db $01, $07
-	db $02, $07
-	db $03, $07
-	db $04, $07
+	db 0, 7
+	db 1, 7
+	db 2, 7
+	db 3, 7
+	db 4, 7
 	db $fe
 ; 44207
 
@@ -48857,7 +47995,7 @@
 	jr c, .asm_446c6
 	ld a, [CurPartyMon]
 	ld hl, PartyMon1Item
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	ld d, [hl]
 	callba ItemIsMail
@@ -48920,7 +48058,7 @@
 	push af
 	push bc
 	ld hl, PartyMon1Item
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	pop bc
 	ld [hl], b
@@ -48939,7 +48077,7 @@
 	call CopyBytes
 	pop af
 	push af
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	ld bc, $000b
 	call AddNTimes
 	ld bc, $000a
@@ -48946,7 +48084,7 @@
 	call CopyBytes
 	pop af
 	ld hl, PartyMon1ID
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	ld a, [hli]
 	ld [de], a
@@ -49021,7 +48159,7 @@
 	pop de
 	pop hl
 	ret c
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	add hl, bc
 	dec e
 	jr nz, .asm_4478b
@@ -51176,10 +50314,10 @@
 ; known jump sources: 48d40 (12:4d40), 48d46 (12:4d46)
 Function48d94: ; 48d94 (12:4d94)
 	xor a
-	ld [hPastLeadingZeroes], a ; $ff00+$b3 (aliases: hDividend, hProduct)
+	ld [$ffb3], a
 	ld [hQuotient], a ; $ff00+$b4 (aliases: hMultiplicand)
 	ld a, [hli]
-	ld [hPastLeadingZeroes], a ; $ff00+$b3 (aliases: hDividend, hProduct)
+	ld [$ffb3], a
 	ld a, [hl]
 	ld [hQuotient], a ; $ff00+$b4 (aliases: hMultiplicand)
 	ld a, 100
@@ -51386,16 +50524,18 @@
 Function492b9: ; 492b9
 	ld hl, MenuDataHeader_0x4930a
 	call LoadMenuDataHeader
-	ld a, $e
-	call Predef
+
+	predef CanLearnTMHMMove
+
 	push bc
 	ld a, [CurPartyMon]
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call GetNick
 	pop bc
+
 	ld a, c
 	and a
-	jr nz, .asm_492e5
+	jr nz, .can_learn
 	push de
 	ld de, SFX_WRONG
 	call PlaySFX
@@ -51403,26 +50543,27 @@
 	ld a, BANK(UnknownText_0x2c8ce)
 	ld hl, UnknownText_0x2c8ce
 	call FarPrintText
-	jr .asm_49300
+	jr .didnt_learn
+.can_learn
 
-.asm_492e5
-	callab Functionf9ea
-	jr c, .asm_49300
-	ld a, $0
-	call Predef
+	callab KnowsMove
+	jr c, .didnt_learn
+
+	predef LearnMove
 	ld a, b
 	and a
-	jr z, .asm_49300
+	jr z, .didnt_learn
+
 	ld c, $5
 	callab ChangeHappiness
-	jr .asm_49305
+	jr .learned
 
-.asm_49300
+.didnt_learn
 	call Function1c07
 	and a
 	ret
 
-.asm_49305
+.learned
 	call Function1c07
 	scf
 	ret
@@ -52585,7 +51726,7 @@
 ; 49bf3
 
 Function49bf3: ; 49bf3
-	ld a, $b
+	ld a, BATTLETYPE_CELEBI
 	ld [BattleType], a
 	ret
 ; 49bf9
@@ -53936,7 +53077,7 @@
 	ld d, a
 	ld e, 0
 	ld hl, PartyMon1Species
-	ld bc, PartyMon1OT
+	ld bc, PartyMonOT
 
 	; Run CheckOwnMon on each Pokémon in the party.
 .partymon
@@ -53954,13 +53095,13 @@
 	; Run CheckOwnMon on each Pokémon in the PC.
 	ld a, 1
 	call GetSRAMBank
-	ld a, [BoxCount]
+	ld a, [sBoxCount]
 	and a
 	jr z, .boxes
 
 	ld d, a
-	ld hl, BoxMon1Species
-	ld bc, BoxMon1OT
+	ld hl, sBoxMon1Species
+	ld bc, sBoxMonOT
 .openboxmon
 	call CheckOwnMon
 	jr nc, .next
@@ -53971,7 +53112,7 @@
 
 .next
 	push bc
-	ld bc, BoxMon2 - BoxMon1
+	ld bc, sBoxMon2 - sBoxMon1
 	add hl, bc
 	pop bc
 	call UpdateOTPointer
@@ -54010,13 +53151,13 @@
 	push bc
 
 	push hl
-	ld de, BoxMons - BoxCount
+	ld de, sBoxMons - sBoxCount
 	add hl, de
 	ld d, h
 	ld e, l
 	pop hl
 	push de
-	ld de, BoxMonOT - BoxCount
+	ld de, sBoxMonOT - sBoxCount
 	add hl, de
 	ld b, h
 	ld c, l
@@ -54035,7 +53176,7 @@
 
 .nextboxmon
 	push bc
-	ld bc, BoxMon2 - BoxMon1
+	ld bc, sBoxMon2 - sBoxMon1
 	add hl, bc
 	pop bc
 	call UpdateOTPointer
@@ -54144,7 +53285,7 @@
 
 UpdateOTPointer: ; 0x4a83a
 	push hl
-	ld hl, PartyMon2OT - PartyMon1OT
+	ld hl, NAME_LENGTH
 	add hl, bc
 	ld b, h
 	ld c, l
@@ -54164,7 +53305,7 @@
 	ld d, a
 	ld e, 0
 	ld hl, PartyMon1Species
-	ld bc, PartyMon1OT
+	ld bc, PartyMonOT
 .asm_4a851
 	call Function4a8dc
 	ret c
@@ -54177,12 +53318,12 @@
 	jr nz, .asm_4a851
 	ld a, 1
 	call GetSRAMBank
-	ld a, [BoxCount]
+	ld a, [sBoxCount]
 	and a
 	jr z, .asm_4a888
 	ld d, a
-	ld hl, BoxMon1Species
-	ld bc, BoxMon1OT
+	ld hl, sBoxMon1Species
+	ld bc, sBoxMonOT
 .asm_4a873
 	call Function4a8dc
 	jr nc, .asm_4a87c
@@ -54191,7 +53332,7 @@
 
 .asm_4a87c
 	push bc
-	ld bc, BoxMon2 - BoxMon1
+	ld bc, sBoxMon2 - sBoxMon1
 	add hl, bc
 	pop bc
 	call Function4a91e
@@ -54221,13 +53362,13 @@
 	jr z, .asm_4a8d1
 	push bc
 	push hl
-	ld de, BoxMons - BoxCount
+	ld de, sBoxMons - sBoxCount
 	add hl, de
 	ld d, h
 	ld e, l
 	pop hl
 	push de
-	ld de, BoxMonOT - BoxCount
+	ld de, sBoxMonOT - sBoxCount
 	add hl, de
 	ld b, h
 	ld c, l
@@ -54242,7 +53383,7 @@
 
 .asm_4a8c4
 	push bc
-	ld bc, BoxMon2 - BoxMon1
+	ld bc, sBoxMon2 - sBoxMon1
 	add hl, bc
 	pop bc
 	call Function4a91e
@@ -54307,7 +53448,7 @@
 
 Function4a91e: ; 4a91e
 	push hl
-	ld hl, PartyMon2OT - PartyMon1OT
+	ld hl, NAME_LENGTH
 	add hl, bc
 	ld b, h
 	ld c, l
@@ -54429,7 +53570,7 @@
 
 Function4a9d7: ; 4a9d7
 	ld a, [DefaultFlypoint]
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call GetNick
 	ld h, d
 	ld l, e
@@ -54437,7 +53578,7 @@
 	ld bc, $0006
 	call CopyBytes
 	ld a, [$d003]
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call GetNick
 	ld h, d
 	ld l, e
@@ -54445,7 +53586,7 @@
 	ld bc, $0006
 	call CopyBytes
 	ld a, [$d004]
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call GetNick
 	ld h, d
 	ld l, e
@@ -54595,15 +53736,15 @@
 
 	ld c, a
 	xor a
-	ld [hConnectedMapWidth], a
+	ld [$ffb0], a
 .asm_4aadd
 	push bc
 	push hl
 	ld e, 0
 	callba Function8e83f
-	ld a, [hConnectedMapWidth]
+	ld a, [$ffb0]
 	inc a
-	ld [hConnectedMapWidth], a
+	ld [$ffb0], a
 	pop hl
 	pop bc
 	dec c
@@ -55584,7 +54725,7 @@
 
 
 Function4d15b:: ; 4d15b
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	ld a, [$d196]
 	and a
 	jr z, .asm_4d168
@@ -55600,9 +54741,9 @@
 
 .asm_4d170
 	ld de, TileMap
-	ld b, $12
+	ld b, SCREEN_HEIGHT
 .asm_4d175
-	ld c, $14
+	ld c, SCREEN_WIDTH
 .asm_4d177
 	ld a, [hli]
 	ld [de], a
@@ -55788,8 +54929,7 @@
 	dec a
 	ld [CurPartyMon], a
 	call LowVolume
-	ld a, $25
-	call Predef
+	predef StatsScreenInit
 	ld a, [CurPartyMon]
 	inc a
 	ld [$cfa9], a
@@ -56284,15 +55424,13 @@
 	ld de, VTiles2
 	push de
 	push af
-	ld a, $2d
-	call Predef
+	predef GetUnownLetter
 	pop af
 	ld [CurPartySpecies], a
 	ld [CurSpecies], a
 	call GetBaseData
 	pop de
-	ld a, $3e
-	call Predef
+	predef Function5108b
 	ret
 ; 4d81e
 
@@ -56317,8 +55455,7 @@
 	hlcoord 7, 2
 	ld d, $0
 	ld e, $3
-	ld a, $47
-	call Predef
+	predef Functiond008e
 	ret
 ; 4d860
 
@@ -56372,12 +55509,12 @@
 	jr nz, .asm_4d88d
 	ld a, $1
 	call GetSRAMBank
-	ld a, [BoxCount]
+	ld a, [sBoxCount]
 	and a
 	jr z, .asm_4d8c8
 	ld d, a
-	ld hl, BoxMon1ID
-	ld bc, BoxSpecies
+	ld hl, sBoxMon1ID
+	ld bc, sBoxSpecies
 .asm_4d8af
 	ld a, [bc]
 	inc bc
@@ -56390,7 +55527,7 @@
 
 .asm_4d8bf
 	push bc
-	ld bc, BoxMon2 - BoxMon1
+	ld bc, sBoxMon2 - sBoxMon1
 	add hl, bc
 	pop bc
 	dec d
@@ -56437,7 +55574,7 @@
 
 .asm_4d901
 	push bc
-	ld bc, BoxMon2 - BoxMon1
+	ld bc, sBoxMon2 - sBoxMon1
 	add hl, bc
 	pop bc
 	dec d
@@ -56607,16 +55744,16 @@
 	ld hl, PartyMon1Species
 	ld a, [PartyCount]
 	dec a
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	ld d, h
 	ld e, l
 	ld hl, $df9c
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call CopyBytes
 	ld a, [PartyCount]
 	dec a
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	call SkipNames
 	ld d, h
 	ld e, l
@@ -56642,7 +55779,7 @@
 .asm_4da66
 	ld a, [PartyCount]
 	dec a
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call SkipNames
 	ld d, h
 	ld e, l
@@ -56674,9 +55811,9 @@
 Function4daa3: ; 4daa3
 	ld a, $1
 	call GetSRAMBank
-	ld hl, BoxCount
+	ld hl, sBoxCount
 	ld a, [hl]
-	cp 20
+	cp MONS_PER_BOX
 	call CloseSRAM
 	jr nc, .asm_4db08
 	xor a
@@ -56683,11 +55820,11 @@
 	ld [CurPartyMon], a
 	ld hl, $df9c
 	ld de, $d018
-	ld bc, BoxMon2 - BoxMon1
+	ld bc, sBoxMon2 - sBoxMon1
 	call CopyBytes
 	ld hl, PlayerName
 	ld de, $d00d
-	ld bc, $000b
+	ld bc, NAME_LENGTH
 	call CopyBytes
 	callab Function51322
 	ld a, [CurPartySpecies]
@@ -56705,8 +55842,8 @@
 .asm_4daf7
 	ld a, $1
 	call GetSRAMBank
-	ld de, BoxMon1Nickname
-	ld bc, $000b
+	ld de, sBoxMonNicknames
+	ld bc, PKMN_NAME_LENGTH
 	call CopyBytes
 	call CloseSRAM
 
@@ -56713,13 +55850,13 @@
 .asm_4db08
 	ld a, $1
 	call GetSRAMBank
-	ld a, [BoxMon1Level]
+	ld a, [sBoxMon1Level]
 	ld [CurPartyLevel], a
 	call CloseSRAM
 	call Function4db83
 	ld a, $1
 	call GetSRAMBank
-	ld hl, BoxMon1CaughtLocation
+	ld hl, sBoxMon1CaughtLocation
 	ld a, [hl]
 	and $80
 	ld b, $13
@@ -56795,7 +55932,7 @@
 Function4db83: ; 4db83
 	ld a, $1
 	call GetSRAMBank
-	ld hl, BoxMon1CaughtLevel
+	ld hl, sBoxMon1CaughtLevel
 	call Function4db53
 	call CloseSRAM
 	ret
@@ -56805,7 +55942,7 @@
 	push bc
 	ld a, $1
 	call GetSRAMBank
-	ld hl, BoxMon1CaughtLevel
+	ld hl, sBoxMon1CaughtLevel
 	pop bc
 	call Function4dbaf
 	call CloseSRAM
@@ -56894,7 +56031,7 @@
 	dec a
 	push hl
 	push bc
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	pop bc
 	ld a, b
@@ -56927,7 +56064,7 @@
 	dec a
 	push hl
 	push bc
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	pop bc
 	ld a, b
@@ -56998,7 +56135,7 @@
 	jr StatsScreenInit_gotaddress
 
 Function4dc8f: ; 4dc8f
-	ld hl, Function4dcf7
+	ld hl, StatsScreenBattle
 	jr StatsScreenInit_gotaddress
 
 StatsScreenInit_gotaddress: ; 4dc94
@@ -57057,7 +56194,7 @@
 	ret
 ; 0x4dcf7
 
-Function4dcf7: ; 4dcf7
+StatsScreenBattle: ; 4dcf7
 	xor a
 	ld [$cf63], a
 	ld [$cf64], a
@@ -57532,8 +56669,7 @@
 Function4e013: ; 4e013 (13:6013)
 	hlcoord 0, 9
 	ld b, $0
-	ld a, $26
-	call Predef
+	predef DrawPlayerHP
 	hlcoord 8, 9
 	ld [hl], $41
 	ld de, String_4e119
@@ -57555,8 +56691,7 @@
 	hlcoord 6, 13
 	push hl
 	ld de, TempMonStatus ; $d12e
-	ld a, $45
-	call Predef
+	predef Function50d0a
 	pop hl
 	jr nz, .asm_4e066
 	jr .asm_4e060
@@ -57570,8 +56705,7 @@
 	call PlaceString
 .asm_4e066
 	hlcoord 1, 15
-	ld a, $2c
-	call Predef
+	predef PrintMonTypes
 	hlcoord 9, 8
 	ld de, $14
 	ld b, $a
@@ -57605,8 +56739,7 @@
 	ld a, [TempMonLevel] ; $d12d
 	ld b, a
 	ld de, $d118
-	ld a, $17
-	call Predef
+	predef FillInExpBar
 	hlcoord 10, 16
 	ld [hl], $40
 	hlcoord 19, 16
@@ -57694,20 +56827,18 @@
 	ld de, String_4e1a9
 	hlcoord 0, 10
 	call PlaceString
-	ld hl, TempMonMoves ; $d110 (aliases: TempMonMove1)
+	ld hl, TempMonMoves
 	ld de, $d25e
-	ld bc, $4
+	ld bc, NUM_MOVES
 	call CopyBytes
 	hlcoord 8, 10
-	ld a, $28
-	ld [Buffer1], a ; $d1ea (aliases: MagikarpLength)
-	ld a, $20
-	call Predef
+	ld a, SCREEN_WIDTH * 2
+	ld [Buffer1], a
+	predef ListMoves
 	hlcoord 12, 11
 	ld a, $28
-	ld [Buffer1], a ; $d1ea (aliases: MagikarpLength)
-	ld a, $23
-	call Predef
+	ld [Buffer1], a
+	predef Function50c50
 	ret
 
 ; known jump sources: 4e150 (13:6150)
@@ -57750,8 +56881,7 @@
 	jr nz, .asm_4e1bb
 	hlcoord 11, 8
 	ld bc, $6
-	ld a, $28
-	call Predef
+	predef Function50b7b
 	ret
 
 ; known jump sources: 4e1ae (13:61ae)
@@ -57791,7 +56921,7 @@
 Unknown_4e216: ; 4e216
 	dw PartyMonOT
 	dw OTPartyMonOT
-	dw BoxMonOT
+	dw sBoxMonOT
 	dw $d00d
 ; 4e21e
 
@@ -57806,8 +56936,7 @@
 ; known jump sources: 4dfd6 (13:5fd6)
 Function4e226: ; 4e226 (13:6226)
 	ld hl, TempMonDVs ; $d123
-	ld a, $2d
-	call Predef
+	predef GetUnownLetter
 	call Function4e2ad
 	jr c, .asm_4e238
 	and a
@@ -57867,13 +56996,11 @@
 	ret c
 	call Function4e307
 	ld de, $9000
-	ld a, $3e
-	call Predef
+	predef Function5108b
 	ld hl, TileMap ; $c4a0 (aliases: SpritesEnd)
 	ld d, $0
 	ld e, $2
-	ld a, $46
-	call Predef
+	predef Functiond00a3
 	ld hl, $cf64
 	set 6, [hl]
 	ret
@@ -57898,7 +57025,7 @@
 Function4e2bf: ; 4e2bf (13:62bf)
 	ld a, [CurPartyMon] ; $d109
 	ld hl, PartyMons ; $dcdf (aliases: PartyMon1, PartyMon1Species)
-	ld bc, $30
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	ld b, h
 	ld c, l
@@ -57911,7 +57038,7 @@
 
 ; no known jump sources
 Function4e2d1: ; 4e2d1 (13:62d1)
-	ld hl, BoxMons
+	ld hl, sBoxMons
 	ld bc, $30
 	ld a, [CurPartyMon] ; $d109
 	call AddNTimes
@@ -58082,13 +57209,11 @@
 	ld [$c2c6], a
 	call Function4e307
 	ld de, $9000
-	ld a, $3e
-	call Predef
+	predef Function5108b
 	pop de
 	ld hl, TileMap ; $c4a0 (aliases: SpritesEnd)
 	ld d, $0
-	ld a, $46
-	call Predef
+	predef Functiond00a3
 	ld hl, $cf64
 	set 6, [hl]
 	ret
@@ -58186,6 +57311,7 @@
 	ret
 ; 4e554
 
+
 Function4e554:: ; 4e554
 	ld a, [BattleType]
 	dec a
@@ -58200,33 +57326,32 @@
 	jp [hl]
 ; 4e564
 
-
-; no known jump sources
 Jumptable_4e564: ; 4e564 (13:6564)
 	dw Function4e56a
 	dw Function4e56a
 	dw Function4e56a
 
-
-; no known jump sources
 Function4e56a: ; 4e56a (13:656a)
 	ld hl, PlayerName ; $d47d
 	ld de, MomsName ; $d488
-	ld bc, $b
+	ld bc, NAME_LENGTH
 	call CopyBytes
-	ld hl, String_4e5da
+
+	ld hl, DudeString
 	ld de, PlayerName ; $d47d
-	ld bc, $b
+	ld bc, NAME_LENGTH
 	call CopyBytes
+
 	call Function4e5b7
+
 	xor a
-	ld [hJoyDown], a ; $ff00+$a8
-	ld [hJoyPressed], a ; $ff00+$a7
-	ld a, [Options] ; $cfcc
+	ld [hJoyDown], a
+	ld [hJoyPressed], a
+	ld a, [Options]
 	push af
 	and $f8
 	add $3
-	ld [Options], a ; $cfcc
+	ld [Options], a
 	ld hl, AutoInput_4e5df
 	ld a, BANK(AutoInput_4e5df)
 	call StartAutoInput
@@ -58233,10 +57358,11 @@
 	callab StartBattle
 	call StopAutoInput
 	pop af
+
 	ld [Options], a ; $cfcc
 	ld hl, MomsName ; $d488
 	ld de, PlayerName ; $d47d
-	ld bc, $b
+	ld bc, NAME_LENGTH
 	call CopyBytes
 	ret
 
@@ -58264,7 +57390,7 @@
 	ret
 ; 4e5da (13:65da)
 
-String_4e5da: ; 4e5da
+DudeString: ; 4e5da
 	db "DUDE@"
 ; 4e5df
 
@@ -58398,8 +57524,7 @@
 	hlcoord 7, 2
 	ld d, $0
 	ld e, $4
-	ld a, $47
-	call Predef
+	predef Functiond008e
 
 	pop af
 	ld [CurPartySpecies], a
@@ -58445,8 +57570,7 @@
 	ld a, $1
 	ld [$c2c6], a
 	ld de, VTiles2
-	ld a, $3e
-	call Predef
+	predef Function5108b
 	xor a
 	ld [$c2c6], a
 	ret
@@ -59114,7 +58238,7 @@
 	push bc
 	push hl
 	push hl
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld a, b
 	call GetNick
 	pop hl
@@ -59186,7 +58310,7 @@
 
 Function50117: ; 50117
 	ld a, b
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	ld hl, PartyMon1HP
 	call AddNTimes
 	ld a, [hli]
@@ -59207,8 +58331,7 @@
 	ld d, a
 	ld a, [hli]
 	ld e, a
-	ld a, $4
-	call Predef
+	predef Functionc699
 	ret
 ; 50138
 
@@ -59226,7 +58349,7 @@
 	jr z, .asm_5016b
 	push hl
 	ld a, b
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	ld hl, PartyMon1HP
 	call AddNTimes
 	ld e, l
@@ -59347,8 +58470,7 @@
 	add hl, de
 	ld a, [hl]
 	ld [CurPartySpecies], a
-	ld a, $e
-	call Predef
+	predef CanLearnTMHMMove
 	pop hl
 	call Function50215
 	call PlaceString
@@ -59399,7 +58521,7 @@
 	jr z, .asm_5025d
 	push hl
 	ld a, b
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	ld hl, PartyMon1Species
 	call AddNTimes
 	ld a, [hl]
@@ -59666,7 +58788,7 @@
 	ret z
 	ld c, a
 	xor a
-	ld [hConnectedMapWidth], a
+	ld [$ffb0], a
 .asm_503ea
 	push bc
 	push hl
@@ -59674,9 +58796,9 @@
 	ld a, BANK(Function8e83f)
 	ld e, $0
 	rst FarCall
-	ld a, [hConnectedMapWidth]
+	ld a, [$ffb0]
 	inc a
-	ld [hConnectedMapWidth], a
+	ld [$ffb0], a
 	pop hl
 	pop bc
 	dec c
@@ -59851,7 +58973,7 @@
 
 Function50566: ; 50566
 	ld a, [CurPartyMon]
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call GetNick
 	ld a, [PartyMenuActionText]
 	and $f
@@ -60043,8 +59165,7 @@
 	ld de, SFX_POISON
 	call PlaySFX
 	ld b, $2
-	ld a, $2e
-	call Predef
+	predef Functioncbcdd
 	call DelayFrame
 	ret
 ; 50669
@@ -60085,8 +59206,7 @@
 	ld a, [PartyCount]
 	cp [hl]
 	jr nz, .asm_50682
-	ld a, $14
-	call Predef
+	predef Function3d873
 	ld a, d
 	ld [ScriptVar], a
 	ret
@@ -60407,7 +59527,7 @@
 	ld a, [CurPartyMon]
 	call AddNTimes
 	ld de, TempMonSpecies
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call CopyBytes
 
 .asm_5088a
@@ -60438,8 +59558,7 @@
 	add hl, bc
 	push bc
 	ld b, $1
-	ld a, $c
-	call Predef
+	predef Functione167
 	pop bc
 	ld hl, TempMonHP - TempMon
 	add hl, bc
@@ -60492,15 +59611,15 @@
 	jr .asm_50905
 
 .asm_508f1
-	ld a, 1 ; BANK(BoxSpecies)
+	ld a, 1 ; BANK(sBoxSpecies)
 	call GetSRAMBank
-	ld hl, BoxSpecies
+	ld hl, sBoxSpecies
 	call .asm_50905
 	call CloseSRAM
 	ret
 
 .asm_50900
-	ld a, [BreedMon1Species]
+	ld a, [wBreedMon1Species]
 	jr .asm_50909
 
 .asm_50905
@@ -60589,48 +59708,27 @@
 	dw OTName
 	dw OTName
 
-.Youngster
-	db "たんパン@"
-.BugCatcher
-	db "むしとり@"
-.Lass
-	db "ミニスカ@"
-.JrTrainerM
-	db "ボーイ@"
-.JrTrainerF
-	db "ガール@"
-.Pokemaniac
-	db "マニア@"
-.SuperNerd
-	db "りかけい@"
-.Burglar
-	db "どろぼう@"
-.Engineer
-	db "ォヤジ@"
-.Jack
-	db "ジャック@"
-.Swimmer
-	db "かいパン@"
-.Beauty
-	db "おねえさん@"
-.Rocker
-	db "グループ@"
-.Juggler
-	db "ジャグラー@"
-.Blackbelt
-	db "からて@"
-.ProfOak
-	db "ォーキド@"
-.Chief
-	db "チーフ@"
-.Scientist
-	db "けんきゅういん@"
-.Rocket
-	db "だんいん@"
-.CooltrainerM
-	db "エりート♂@"
-.CooltrainerF
-	db "エりート♀@"
+.Youngster    db "たんパン@"
+.BugCatcher   db "むしとり@"
+.Lass         db "ミニスカ@"
+.JrTrainerM   db "ボーイ@"
+.JrTrainerF   db "ガール@"
+.Pokemaniac   db "マニア@"
+.SuperNerd    db "りかけい@"
+.Burglar      db "どろぼう@"
+.Engineer     db "ォヤジ@"
+.Jack         db "ジャック@"
+.Swimmer      db "かいパン@"
+.Beauty       db "おねえさん@"
+.Rocker       db "グループ@"
+.Juggler      db "ジャグラー@"
+.Blackbelt    db "からて@"
+.ProfOak      db "ォーキド@"
+.Chief        db "チーフ@"
+.Scientist    db "けんきゅういん@"
+.Rocket       db "だんいん@"
+.CooltrainerM db "エりート♂@"
+.CooltrainerF db "エりート♀@"
 ; 50b0a
 
 
@@ -60678,8 +59776,7 @@
 	ld c, e
 
 .asm_50b41
-	ld a, $4
-	call Predef
+	predef Functionc699
 	ld a, 6
 	ld d, a
 	ld c, a
@@ -60731,16 +59828,16 @@
 	add hl, bc
 	ld bc, $0014
 	add hl, bc
-	ld de, TempMonAtk
+	ld de, TempMonAttack
 	ld bc, $0203
 	call Function50bab
-	ld de, TempMonDef
+	ld de, TempMonDefense
 	call Function50bab
 	ld de, TempMonSpclAtk
 	call Function50bab
 	ld de, TempMonSpclDef
 	call Function50bab
-	ld de, TempMonSpd
+	ld de, TempMonSpeed
 	jp PrintNum
 ; 50bab
 
@@ -60788,11 +59885,11 @@
 	dec a
 	jr z, .PartyMon
 	
-; 2: BoxMon
-	ld hl, BoxMon1DVs
-	ld bc, BoxMon2 - BoxMon1
+; 2: sBoxMon
+	ld hl, sBoxMon1DVs
+	ld bc, sBoxMon2 - sBoxMon1
 	dec a
-	jr z, .BoxMon
+	jr z, .sBoxMon
 	
 ; 3: Unknown
 	ld hl, TempMonDVs
@@ -60807,7 +59904,7 @@
 ; Get our place in the party/box.
 	
 .PartyMon
-.BoxMon
+.sBoxMon
 	ld a, [CurPartyMon]
 	call AddNTimes
 	
@@ -60814,7 +59911,7 @@
 	
 .DVs
 	
-; BoxMon data is read directly from SRAM.
+; sBoxMon data is read directly from SRAM.
 	ld a, [MonType]
 	cp BOXMON
 	ld a, 1
@@ -60833,7 +59930,7 @@
 	or b
 	ld b, a
 
-; Close SRAM if we were dealing with a BoxMon.
+; Close SRAM if we were dealing with a sBoxMon.
 	ld a, [MonType]
 	cp BOXMON
 	call z, CloseSRAM
@@ -60908,8 +60005,8 @@
 	inc hl
 	ld d, h
 	ld e, l
-	ld hl, TempMonMove1
-	ld b, $0
+	ld hl, TempMonMoves
+	ld b, 0
 .asm_50c7a
 	ld a, [hli]
 	and a
@@ -60929,7 +60026,7 @@
 	pop de
 	pop hl
 	push hl
-	ld bc, $0014
+	ld bc, TempMonPP - (TempMonMoves + 1)
 	add hl, bc
 	ld a, [hl]
 	and $3f
@@ -60948,7 +60045,7 @@
 	pop hl
 	ld a, [Buffer1]
 	ld e, a
-	ld d, $0
+	ld d, 0
 	add hl, de
 	ld d, h
 	ld e, l
@@ -60956,7 +60053,7 @@
 	pop bc
 	inc b
 	ld a, b
-	cp $4
+	cp NUM_MOVES
 	jr nz, .asm_50c7a
 
 .asm_50cc8
@@ -60988,7 +60085,7 @@
 Function50cdb: ; 50cdb
 	push hl
 	push hl
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld a, [CurPartyMon]
 	call GetNick
 	pop hl
@@ -61087,7 +60184,8 @@
 ParString: db "PAR@"
 ; 50d6f
 
-Function50d6f: ; 50d6f
+ListMoves: ; 50d6f
+; List moves at hl, spaced every [Buffer1] tiles.
 	ld de, $d25e
 	ld b, $0
 .asm_50d74
@@ -61099,7 +60197,7 @@
 	push hl
 	push hl
 	ld [CurSpecies], a
-	ld a, $2
+	ld a, MOVE_NAME
 	ld [$cf61], a
 	call GetName
 	ld de, StringBuffer1
@@ -61114,12 +60212,12 @@
 	push bc
 	ld a, [Buffer1]
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	pop bc
 	pop de
 	ld a, b
-	cp $4
+	cp NUM_MOVES
 	jr z, .asm_50db8
 	jr .asm_50d74
 
@@ -61127,14 +60225,14 @@
 	ld a, b
 .asm_50da8
 	push af
-	ld [hl], $e3
+	ld [hl], "-"
 	ld a, [Buffer1]
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	pop af
 	inc a
-	cp $4
+	cp NUM_MOVES
 	jr nz, .asm_50da8
 
 .asm_50db8
@@ -61143,41 +60241,42 @@
 
 Function50db9: ; 50db9
 	ld a, [$d263]
+
 	cp $1
 	jr nz, .asm_50dca
 	ld hl, OTPartyCount
-	ld de, OTPartyMon1OT
-	ld a, $6
+	ld de, OTPartyMonOT
+	ld a, ENEMY_OT_NAME
 	jr .asm_50dfc
-
 .asm_50dca
+
 	cp $4
 	jr nz, .asm_50dd8
 	ld hl, PartyCount
-	ld de, PartyMon1OT
-	ld a, $5
+	ld de, PartyMonOT
+	ld a, PARTY_OT_NAME
 	jr .asm_50dfc
-
 .asm_50dd8
+
 	cp $5
 	jr nz, .asm_50de6
 	ld hl, $d0f0
 	ld de, PokemonNames
-	ld a, $1
+	ld a, PKMN_NAME
 	jr .asm_50dfc
-
 .asm_50de6
+
 	cp $2
 	jr nz, .asm_50df4
 	ld hl, NumItems
-	ld de, Function50000
-	ld a, $4
+	ld de, ItemNames
+	ld a, ITEM_NAME
 	jr .asm_50dfc
-
 .asm_50df4
+
 	ld hl, $d0f0
-	ld de, Function50000
-	ld a, $4
+	ld de, ItemNames
+	ld a, ITEM_NAME
 
 .asm_50dfc
 	ld [$cf61], a
@@ -61189,7 +60288,7 @@
 	ld [$d102], a
 	ld a, d
 	ld [$d103], a
-	ld bc, $67c1
+	ld bc, $67c1 ; XXX ItemAttributes?
 	ld a, c
 	ld [$d104], a
 	ld a, b
@@ -61466,12 +60565,12 @@
 	ld bc, $30
 	call CopyBytes
 	ld a, [Buffer2] ; $d1eb (aliases: MovementType)
-	ld hl, PartyMonOT ; $ddff (aliases: PartyMon1OT)
+	ld hl, PartyMonOT ; $ddff (aliases: PartyMonOT)
 	call SkipNames
 	push hl
 	call Function51036
 	ld a, [$d1ec]
-	ld hl, PartyMonOT ; $ddff (aliases: PartyMon1OT)
+	ld hl, PartyMonOT ; $ddff (aliases: PartyMonOT)
 	call SkipNames
 	pop de
 	push hl
@@ -61479,12 +60578,12 @@
 	pop de
 	ld hl, DefaultFlypoint ; $d002
 	call Function51039
-	ld hl, PartyMonNicknames ; $de41 (aliases: PartyMon1Nickname)
+	ld hl, PartyMonNicknames ; $de41 (aliases: PartyMonNicknames)
 	ld a, [Buffer2] ; $d1eb (aliases: MovementType)
 	call SkipNames
 	push hl
 	call Function51036
-	ld hl, PartyMonNicknames ; $de41 (aliases: PartyMon1Nickname)
+	ld hl, PartyMonNicknames ; $de41 (aliases: PartyMonNicknames)
 	ld a, [$d1ec]
 	call SkipNames
 	pop de
@@ -61535,8 +60634,8 @@
 ; Return Unown letter in UnownLetter based on DVs at hl
 
 ; Take the middle 2 bits of each DV and place them in order:
-;	AtkDefDV | SpdSpcDV
-;	.ww..xx.   .yy..zz.
+;	atk  def  spd  spc
+;	.ww..xx.  .yy..zz.
 
 	; atk
 	ld a, [hl]
@@ -61583,7 +60682,7 @@
 ; 51077
 
 
-Function51077: ; 51077
+GetFrontpic: ; 51077
 	ld a, [CurPartySpecies]
 	ld [CurSpecies], a
 	call IsAPokemon
@@ -61590,7 +60689,7 @@
 	ret c
 	ld a, [rSVBK]
 	push af
-	call Function510a5
+	call _GetFrontpic
 	pop af
 	ld [rSVBK], a
 	ret
@@ -61605,7 +60704,7 @@
 	push af
 	xor a
 	ld [hBGMapMode], a
-	call Function510a5
+	call _GetFrontpic
 	call Function51103
 	pop af
 	ld [rSVBK], a
@@ -61612,7 +60711,7 @@
 	ret
 ; 510a5
 
-Function510a5: ; 510a5
+_GetFrontpic: ; 510a5
 	push de
 	call GetBaseData
 	ld a, [BasePicSize]
@@ -61619,7 +60718,7 @@
 	and $f
 	ld b, a
 	push bc
-	call Function510d7
+	call GetFrontpicPointer
 	ld a, $6
 	ld [rSVBK], a
 	ld a, b
@@ -61626,12 +60725,12 @@
 	ld de, $d800
 	call FarDecompress
 	pop bc
-	ld hl, Unkn1Pals
+	ld hl, $d000
 	ld de, $d800
 	call Function512ab
 	pop hl
 	push hl
-	ld de, Unkn1Pals
+	ld de, $d000
 	ld c, 7 * 7
 	ld a, [hROMBank]
 	ld b, a
@@ -61640,28 +60739,28 @@
 	ret
 ; 510d7
 
-Function510d7: ; 510d7
+GetFrontpicPointer: ; 510d7
 GLOBAL PicPointers, UnownPicPointers
 
 	ld a, [CurPartySpecies]
 	cp UNOWN
-	jr z, .asm_510e5
+	jr z, .unown
 	ld a, [CurPartySpecies]
 	ld d, BANK(PicPointers)
-	jr .asm_510ea
+	jr .ok
 
-.asm_510e5
+.unown
 	ld a, [UnownLetter]
 	ld d, BANK(UnownPicPointers)
 
-.asm_510ea
-	ld hl, Function50000
+.ok
+	ld hl, PicPointers ; UnownPicPointers
 	dec a
-	ld bc, $0006
+	ld bc, 6
 	call AddNTimes
 	ld a, d
 	call GetFarByte
-	call Function511c5
+	call FixPicBank
 	push af
 	inc hl
 	ld a, d
@@ -61674,13 +60773,13 @@
 	ld a, $1
 	ld [rVBK], a
 	push hl
-	ld de, Unkn1Pals
-	ld c, $31
+	ld de, $d000
+	ld c, 7 * 7
 	ld a, [hROMBank]
 	ld b, a
 	call Get2bpp
 	pop hl
-	ld de, $0310
+	ld de, 7 * 7 * $10
 	add hl, de
 	push hl
 	ld a, $1
@@ -61688,24 +60787,24 @@
 	call GetFarWRAMByte
 	pop hl
 	and $f
-	ld de, $d990
+	ld de, $d800 + 5 * 5 * $10
 	ld c, 5 * 5
 	cp 5
 	jr z, .asm_5113b
-	ld de, $da40
+	ld de, $d800 + 6 * 6 * $10
 	ld c, 6 * 6
 	cp 6
 	jr z, .asm_5113b
-	ld de, $db10
+	ld de, $d800 + 7 * 7 * $10
 	ld c, 7 * 7
-
 .asm_5113b
+
 	push hl
 	push bc
 	call Function5114f
 	pop bc
 	pop hl
-	ld de, Unkn1Pals
+	ld de, $d000
 	ld a, [hROMBank]
 	ld b, a
 	call Get2bpp
@@ -61736,10 +60835,11 @@
 	ret
 ; 5116c
 
-Function5116c: ; 5116c
+GetBackpic: ; 5116c
 	ld a, [CurPartySpecies]
 	call IsAPokemon
 	ret c
+
 	ld a, [CurPartySpecies]
 	ld b, a
 	ld a, [UnownLetter]
@@ -61757,31 +60857,30 @@
 	ld a, b
 	ld d, BANK(PicPointers)
 	cp UNOWN
-	jr nz, .asm_51190
+	jr nz, .ok
 	ld a, c
 	ld d, BANK(UnownPicPointers)
-
-.asm_51190
+.ok
 	dec a
-	ld bc, $0006
+	ld bc, 6
 	call AddNTimes
-	ld bc, $0003
+	ld bc, 3
 	add hl, bc
 	ld a, d
 	call GetFarByte
-	call Function511c5
+	call FixPicBank
 	push af
 	inc hl
 	ld a, d
 	call GetFarHalfword
-	ld de, Unkn1Pals
+	ld de, $d000
 	pop af
 	call FarDecompress
-	ld hl, Unkn1Pals
-	ld c, $24
+	ld hl, $d000
+	ld c, 6 * 6
 	call Function5127c
 	pop hl
-	ld de, Unkn1Pals
+	ld de, $d000
 	ld a, [hROMBank]
 	ld b, a
 	call Get2bpp
@@ -61791,10 +60890,11 @@
 ; 511c5
 
 
-Function511c5: ; 511c5
+FixPicBank: ; 511c5
+; This is a thing for some reason.
 	push hl
 	push bc
-	sub $12
+	sub PICS_1 - $36
 	ld c, a
 	ld b, 0
 	ld hl, Unknown_511d4
@@ -61806,10 +60906,53 @@
 ; 511d4
 
 Unknown_511d4: ; 511d4
-INCBIN "baserom.gbc",$511d4,$5120d - $511d4
+	db PICS_1
+	db PICS_2
+	db PICS_3
+	db PICS_4
+	db PICS_5
+	db PICS_6
+	db PICS_7
+	db PICS_8
+	db PICS_9
+	db PICS_10
+	db PICS_11
+	db PICS_12
+	db PICS_13
+	db PICS_14
+	db PICS_15
+	db PICS_16
+	db PICS_17
+	db PICS_18
+	db PICS_19
+	db PICS_19 + 1
+	db PICS_19 + 2
+	db PICS_19 + 3
+	db PICS_19 + 4
+	db PICS_19 + 5
 
+Function511ec: ; 511ec
+	ld a, c
+	push de
+	ld hl, PicPointers
+	dec a
+	ld bc, 6
+	call AddNTimes
+	ld a, BANK(PicPointers)
+	call GetFarByte
+	call FixPicBank
+	push af
+	inc hl
+	ld a, BANK(PicPointers)
+	call GetFarHalfword
+	pop af
+	pop de
+	call FarDecompress
+	ret
+; 0x5120d
 
-Function5120d: ; 5120d
+
+GetTrainerPic: ; 5120d
 	ld a, [TrainerClass]
 	and a
 	ret z
@@ -61818,10 +60961,10 @@
 	call WaitBGMap
 	xor a
 	ld [hBGMapMode], a
-	ld hl, Function50000
+	ld hl, TrainerPicPointers
 	ld a, [TrainerClass]
 	dec a
-	ld bc, $0003
+	ld bc, 3
 	call AddNTimes
 	ld a, [rSVBK]
 	push af
@@ -61828,12 +60971,12 @@
 	ld a, $6
 	ld [rSVBK], a
 	push de
-	ld a, $4a
+	ld a, BANK(TrainerPicPointers)
 	call GetFarByte
-	call Function511c5
+	call FixPicBank
 	push af
 	inc hl
-	ld a, $4a
+	ld a, BANK(TrainerPicPointers)
 	call GetFarHalfword
 	pop af
 	ld de, $d000
@@ -61840,7 +60983,7 @@
 	call FarDecompress
 	pop hl
 	ld de, $d000
-	ld c, $31
+	ld c, 7 * 7
 	ld a, [hROMBank]
 	ld b, a
 	call Get2bpp
@@ -61887,13 +61030,13 @@
 	and a
 	jr z, .asm_512a8
 	ld a, c
-	cp $31
-	ld de, $0310
+	cp 7 * 7
+	ld de, 7 * 7 * $10
 	jr z, .asm_51296
-	cp $24
-	ld de, $0240
+	cp 6 * 6
+	ld de, 6 * 6 * $10
 	jr z, .asm_51296
-	ld de, $0190
+	ld de, 5 * 5 * $10
 
 .asm_51296
 	ld a, [hl]
@@ -61919,25 +61062,26 @@
 
 Function512ab: ; 512ab
 	ld a, b
-	cp $6
-	jr z, .asm_512bd
-	cp $5
-	jr z, .asm_512d2
-.asm_512b4
+	cp 6
+	jr z, .six
+	cp 5
+	jr z, .five
+
+.seven
 	ld c, $70
 	call Function512f2
 	dec b
-	jr nz, .asm_512b4
+	jr nz, .seven
 	ret
 
-.asm_512bd
+.six
 	ld c, $70
 	xor a
-	call Function512ed
+	call .Fill
 .asm_512c3
 	ld c, $10
 	xor a
-	call Function512ed
+	call .Fill
 	ld c, $60
 	call Function512f2
 	dec b
@@ -61944,14 +61088,14 @@
 	jr nz, .asm_512c3
 	ret
 
-.asm_512d2
+.five
 	ld c, $70
 	xor a
-	call Function512ed
+	call .Fill
 .asm_512d8
 	ld c, $20
 	xor a
-	call Function512ed
+	call .Fill
 	ld c, $50
 	call Function512f2
 	dec b
@@ -61958,15 +61102,13 @@
 	jr nz, .asm_512d8
 	ld c, $70
 	xor a
-	call Function512ed
+	call .Fill
 	ret
-; 512ed
 
-Function512ed: ; 512ed
-.asm_512ed
+.Fill
 	ld [hli], a
 	dec c
-	jr nz, .asm_512ed
+	jr nz, .Fill
 	ret
 ; 512f2
 
@@ -61989,22 +61131,10 @@
 	inc de
 	ld b, a
 	xor a
+	rept 8
 	rr b
 	rla
-	rr b
-	rla
-	rr b
-	rla
-	rr b
-	rla
-	rr b
-	rla
-	rr b
-	rla
-	rr b
-	rla
-	rr b
-	rla
+	endr
 	ld [hli], a
 	dec c
 	jr nz, .asm_51300
@@ -62015,36 +61145,36 @@
 Function51322: ; 51322
 	ld a, $1
 	call GetSRAMBank
-	ld hl, BoxCount
+	ld hl, sBoxCount
 	call Function513cb
-	ld a, [BoxCount]
+	ld a, [sBoxCount]
 	dec a
 	ld [$d265], a
-	ld hl, BoxMon1Nickname
-	ld bc, $000b
-	ld de, DefaultFlypoint
+	ld hl, sBoxMonNicknames
+	ld bc, PKMN_NAME_LENGTH
+	ld de, $d002
 	call Function513e0
-	ld a, [BoxCount]
+	ld a, [sBoxCount]
 	dec a
 	ld [$d265], a
-	ld hl, BoxMon1OT
-	ld bc, $000b
+	ld hl, sBoxMonOT
+	ld bc, NAME_LENGTH
 	ld de, $d00d
 	call Function513e0
-	ld a, [BoxCount]
+	ld a, [sBoxCount]
 	dec a
 	ld [$d265], a
-	ld hl, BoxMon1Species
-	ld bc, $0020
+	ld hl, sBoxMons
+	ld bc, sBoxMon1End - sBoxMon1
 	ld de, $d018
 	call Function513e0
 	ld hl, $d01a
-	ld de, TempMonMove1
-	ld bc, $0004
+	ld de, TempMonMoves
+	ld bc, NUM_MOVES
 	call CopyBytes
 	ld hl, $d02f
 	ld de, TempMonPP
-	ld bc, $0004
+	ld bc, NUM_MOVES
 	call CopyBytes
 	ld a, [CurPartyMon]
 	ld b, a
@@ -62058,22 +61188,22 @@
 	ld a, [PartyCount]
 	dec a
 	ld [$d265], a
-	ld hl, PartyMon1Nickname
-	ld bc, $000b
-	ld de, DefaultFlypoint
+	ld hl, PartyMonNicknames
+	ld bc, PKMN_NAME_LENGTH
+	ld de, $d002
 	call Function513e0
 	ld a, [PartyCount]
 	dec a
 	ld [$d265], a
-	ld hl, PartyMon1OT
-	ld bc, $000b
+	ld hl, PartyMonOT
+	ld bc, NAME_LENGTH
 	ld de, $d00d
 	call Function513e0
 	ld a, [PartyCount]
 	dec a
 	ld [$d265], a
-	ld hl, PartyMon1Species
-	ld bc, $0030
+	ld hl, PartyMons
+	ld bc, PartyMon2 - PartyMon1
 	ld de, $d018
 	call Function513e0
 	ret
@@ -62084,7 +61214,7 @@
 	inc hl
 	ld a, [CurPartyMon]
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [CurPartySpecies]
 	ld c, a
@@ -62797,7 +61927,7 @@
 IsNPCInFront: ; 80341
 
 	ld a, 0
-	ld [hConnectionStripLength], a
+	ld [$ffaf], a
 	ld a, [MapX]
 	ld d, a
 	ld a, [WalkingX]
@@ -62808,7 +61938,7 @@
 	ld a, [WalkingY]
 	add e
 	ld e, a
-	ld bc, $d4d6
+	ld bc, ObjectStructs ; redundant
 	callba Function7041
 	jr nc, .asm_80369
 	call Function8036f
@@ -63182,7 +62312,7 @@
 Function806c5: ; 806c5
 ; Caught mons.
 	ld hl, PokedexCaught
-	ld b, $20
+	ld b, EndPokedexCaught - PokedexCaught
 	call CountSetBits
 	ld a, [$d265]
 	jp Function8066c
@@ -63191,7 +62321,7 @@
 Function806d3: ; 806d3
 ; Seen mons.
 	ld hl, PokedexSeen
-	ld b, $20
+	ld b, EndPokedexSeen - PokedexSeen
 	call CountSetBits
 	ld a, [$d265]
 	jp Function8066c
@@ -63199,7 +62329,7 @@
 
 Function806e1: ; 806e1
 ; Number of owned badges.
-	ld hl, JohtoBadges ; $d857
+	ld hl, Badges ; $d857
 	ld b, 2
 	call CountSetBits
 	ld a, [$d265]
@@ -63243,10 +62373,10 @@
 
 Function80715: ; 80715
 ; Remaining slots in the current box.
-	ld a, $1
+	ld a, 1 ; BANK(sBoxCount)
 	call GetSRAMBank
-	ld hl, BoxCount
-	ld a, 20
+	ld hl, sBoxCount
+	ld a, MONS_PER_BOX
 	sub [hl]
 	ld b, a
 	call CloseSRAM
@@ -63447,13 +62577,13 @@
 	dec c
 	jr nz, .asm_819d6
 	ld a, $94
-	ld [EnemyMoveAnimation], a
+	ld [$c608], a
 	ld a, $52
-	ld [EnemyMoveEffect], a
+	ld [$c609], a
 	ld a, $4a
-	ld [EnemyMovePower], a
+	ld [$c60a], a
 	ld a, $29
-	ld [EnemyMoveType], a
+	ld [$c60b], a
 	pop af
 	ld [rSVBK], a
 	ret
@@ -63665,14 +62795,12 @@
 	hlcoord 12, 3
 	call Function378b
 	ld de, $9310
-	ld a, $3d
-	call Predef
+	predef GetBackpic
 	ld a, $31
 	ld [$ffad], a
 	hlcoord 2, 4
 	ld bc, $0606
-	ld a, $13
-	call Predef
+	predef FillBox
 	ld a, [$d003]
 	and a
 	jr z, .asm_81b66
@@ -63698,14 +62826,13 @@
 	hlcoord 4, 1
 	call PlaceString
 	ld de, VTiles2
-	callab Function5120d
+	callab GetTrainerPic
 	xor a
 	ld [TempEnemyMonSpecies], a
 	ld [$ffad], a
 	hlcoord 2, 3
 	ld bc, $0707
-	ld a, $13
-	call Predef
+	predef FillBox
 
 .asm_81ba9
 	ld a, $1
@@ -63755,13 +62882,13 @@
 	add hl, hl
 	ld de, OverworldMap
 	add hl, de
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld bc, $0004
 	call CopyBytes
 	xor a
 	ld [$cf64], a
 	ld [$cf65], a
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	call Function81ea5
 	ret
 ; 81c18
@@ -63792,14 +62919,14 @@
 	ld a, $5
 	ld [rSVBK], a
 	ld hl, BGPals
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld c, $1
 	call Function81ee3
 	hlcoord 10, 2
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	call Function81ca7
 	hlcoord 15, 2
-	ld de, EnemyMovePower
+	ld de, $c60a
 	call Function81ca7
 	ld a, $1
 	ld [hCGBPalUpdate], a
@@ -63817,13 +62944,13 @@
 	ld [hli], a
 	ld a, $7f
 	ld [hli], a
-	ld a, [EnemyMoveAnimation]
+	ld a, [$c608]
 	ld [hli], a
-	ld a, [EnemyMoveEffect]
+	ld a, [$c609]
 	ld [hli], a
-	ld a, [EnemyMovePower]
+	ld a, [$c60a]
 	ld [hli], a
-	ld a, [EnemyMoveType]
+	ld a, [$c60b]
 	ld [hli], a
 	xor a
 	ld [hli], a
@@ -63832,10 +62959,10 @@
 	ld hl, $cda9
 	call Function81f0c
 	hlcoord 10, 2
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	call Function81ca7
 	hlcoord 15, 2
-	ld de, EnemyMovePower
+	ld de, $c60a
 	call Function81ca7
 	ld a, $3
 	ld [$cf63], a
@@ -63928,7 +63055,7 @@
 .asm_81d1d
 	xor a
 	ld [$cf65], a
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	call Function81ea5
 	ret
 
@@ -63935,7 +63062,7 @@
 .asm_81d28
 	ld a, $1
 	ld [$cf65], a
-	ld de, EnemyMovePower
+	ld de, $c60a
 	call Function81ea5
 	ret
 
@@ -63947,7 +63074,7 @@
 	ld a, [hl]
 	and $40
 	jr nz, Function81d84
-	ld hl, PlayerMoveType
+	ld hl, $c612
 	jr Function81d63
 
 Function81d46: ; 81d46
@@ -63958,7 +63085,7 @@
 	ld a, [hl]
 	and $40
 	jr nz, Function81d84
-	ld hl, PlayerMoveAccuracy
+	ld hl, $c613
 	jr Function81d63
 
 Function81d58: ; 81d58
@@ -63966,7 +63093,7 @@
 	ld a, [hl]
 	and $40
 	jr nz, Function81d84
-	ld hl, PlayerMovePP
+	ld hl, $c614
 
 Function81d63: ; 81d63
 	ld a, [$ffa9]
@@ -64092,8 +63219,7 @@
 	ld a, [$d004]
 	inc a
 	ld [$d265], a
-	ld a, $f
-	call Predef
+	predef GetTMHMMove
 	ld a, [$d265]
 	ld [$d262], a
 	call GetMoveName
@@ -64102,8 +63228,7 @@
 	ld a, [$d004]
 	call Function81e55
 	ld [CurItem], a
-	ld a, $e
-	call Predef
+	predef CanLearnTMHMMove
 	ld a, c
 	and a
 	ld de, String_81e46
@@ -64139,21 +63264,21 @@
 ; 81e67
 
 Function81e67: ; 81e67
-	ld a, [PlayerMoveType]
+	ld a, [$c612]
 	and $1f
 	ld e, a
-	ld a, [PlayerMoveAccuracy]
+	ld a, [$c613]
 	and $7
 	sla a
 	swap a
 	or e
 	ld e, a
-	ld a, [PlayerMoveAccuracy]
+	ld a, [$c613]
 	and $18
 	sla a
 	swap a
 	ld d, a
-	ld a, [PlayerMovePP]
+	ld a, [$c614]
 	and $1f
 	sla a
 	sla a
@@ -64163,16 +63288,16 @@
 	and a
 	jr z, .asm_81e9c
 	ld a, e
-	ld [EnemyMovePower], a
+	ld [$c60a], a
 	ld a, d
-	ld [EnemyMoveType], a
+	ld [$c60b], a
 	ret
 
 .asm_81e9c
 	ld a, e
-	ld [EnemyMoveAnimation], a
+	ld [$c608], a
 	ld a, d
-	ld [EnemyMoveEffect], a
+	ld [$c609], a
 	ret
 ; 81ea5
 
@@ -64179,7 +63304,7 @@
 Function81ea5: ; 81ea5
 	ld a, [de]
 	and $1f
-	ld [PlayerMoveType], a
+	ld [$c612], a
 	ld a, [de]
 	and $e0
 	swap a
@@ -64191,12 +63316,12 @@
 	swap a
 	srl a
 	or b
-	ld [PlayerMoveAccuracy], a
+	ld [$c613], a
 	ld a, [de]
 	and $7c
 	srl a
 	srl a
-	ld [PlayerMovePP], a
+	ld [$c614], a
 	ret
 ; 81eca
 
@@ -64211,7 +63336,7 @@
 	add hl, de
 	ld e, l
 	ld d, h
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	ld bc, $0004
 	call CopyBytes
 	ret
@@ -64360,11 +63485,11 @@
 	ld b, $70
 	ld c, $5
 	ld hl, Sprites
-	ld de, PlayerMoveType
+	ld de, $c612
 	call .asm_81fb7
-	ld de, PlayerMoveAccuracy
+	ld de, $c613
 	call .asm_81fb7
-	ld de, PlayerMovePP
+	ld de, $c614
 	call .asm_81fb7
 	ret
 
@@ -64512,10 +63637,10 @@
 	add hl, hl
 	ld de, Unkn1Pals
 	add hl, de
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld bc, $0008
 	call CopyBytes
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	call Function81ea5
 	pop af
 	ld [rSVBK], a
@@ -64561,7 +63686,7 @@
 	ld a, [$cf64]
 	ld bc, $0008
 	call AddNTimes
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld bc, $0008
 	call CopyBytes
 	pop af
@@ -64593,20 +63718,20 @@
 	call AddNTimes
 	ld e, l
 	ld d, h
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	ld bc, $0008
 	call CopyBytes
 	hlcoord 1, 0
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	call Function81ca7
 	hlcoord 6, 0
-	ld de, EnemyMovePower
+	ld de, $c60a
 	call Function81ca7
 	hlcoord 11, 0
-	ld de, EnemyMoveAccuracy
+	ld de, $c60c
 	call Function81ca7
 	hlcoord 16, 0
-	ld de, EnemyMoveEffectChance
+	ld de, $c60e
 	call Function81ca7
 	pop af
 	ld [rSVBK], a
@@ -64664,7 +63789,7 @@
 	ld [$cf66], a
 	ld e, a
 	ld d, $0
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	add hl, de
 	add hl, de
 	ld e, l
@@ -64680,7 +63805,7 @@
 	ld a, [hl]
 	and $40
 	jr nz, Function82387
-	ld hl, PlayerMoveType
+	ld hl, $c612
 	jr Function82368
 
 Function8234b: ; 8234b
@@ -64691,7 +63816,7 @@
 	ld a, [hl]
 	and $40
 	jr nz, Function82387
-	ld hl, PlayerMoveAccuracy
+	ld hl, $c613
 	jr Function82368
 
 Function8235d: ; 8235d
@@ -64699,7 +63824,7 @@
 	ld a, [hl]
 	and $40
 	jr nz, Function82387
-	ld hl, PlayerMovePP
+	ld hl, $c614
 
 Function82368: ; 82368
 	ld a, [$ffa9]
@@ -64740,21 +63865,21 @@
 ; 82391
 
 Function82391: ; 82391
-	ld a, [PlayerMoveType]
+	ld a, [$c612]
 	and $1f
 	ld e, a
-	ld a, [PlayerMoveAccuracy]
+	ld a, [$c613]
 	and $7
 	sla a
 	swap a
 	or e
 	ld e, a
-	ld a, [PlayerMoveAccuracy]
+	ld a, [$c613]
 	and $18
 	sla a
 	swap a
 	ld d, a
-	ld a, [PlayerMovePP]
+	ld a, [$c614]
 	and $1f
 	sla a
 	sla a
@@ -64763,7 +63888,7 @@
 	ld a, [$cf66]
 	ld c, a
 	ld b, $0
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	add hl, bc
 	add hl, bc
 	ld a, e
@@ -66025,13 +65150,13 @@
 ; known jump sources: 844f2 (21:44f2)
 Function84817: ; 84817 (21:4817)
 	xor a
-	ld [DefaultFlypoint], a ; $d002
-	ld hl, TileMap ; $c4a0 (aliases: SpritesEnd)
+	ld [$d002], a
+	ld hl, TileMap
 	ld bc, $168
 	ld a, $7f
 	call ByteFill
 	call Function84a0e
-	ld hl, TileMap ; $c4a0 (aliases: SpritesEnd)
+	ld hl, TileMap
 	ld bc, $b4
 	ld a, $7f
 	call ByteFill
@@ -66040,9 +65165,9 @@
 	hlcoord 4, 3
 	ld de, String_84865
 	call PlaceString
-	ld a, [MovementBuffer] ; $d007
-	ld bc, $9
-	ld hl, Box1Name ; $db75
+	ld a, [$d007]
+	ld bc, 9
+	ld hl, wBoxNames
 	call AddNTimes
 	ld d, h
 	ld e, l
@@ -66429,7 +65554,7 @@
 	ld a, [$cf64]
 	cp $6
 	jr nc, .asm_864fb
-	ld hl, EnemyMoveEffect
+	ld hl, $c609
 	ld bc, $0010
 	call AddNTimes
 	ld a, [hl]
@@ -66462,8 +65587,7 @@
 	call WaitBGMap
 	decoord 6, 5
 	ld c, $6
-	ld a, $49
-	call Predef
+	predef Functiond066e
 	ld c, $3c
 	call DelayFrames
 	and a
@@ -66501,7 +65625,7 @@
 	push bc
 	ld a, c
 	ld hl, PartyMon1Species
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	ld c, l
 	ld b, h
@@ -66534,7 +65658,7 @@
 	pop bc
 	push bc
 	ld a, c
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld bc, $000b
 	call AddNTimes
 	ld bc, $000a
@@ -66570,21 +65694,18 @@
 	ld a, [hli]
 	ld [$d124], a
 	ld hl, TempMonDVs
-	ld a, $2d
-	call Predef
+	predef GetUnownLetter
 	ld hl, TileMap
 	ld bc, $0168
 	ld a, $7f
 	call ByteFill
 	ld de, $9310
-	ld a, $3d
-	call Predef
+	predef GetBackpic
 	ld a, $31
 	ld [$ffad], a
 	hlcoord 6, 6
 	ld bc, $0606
-	ld a, $13
-	call Predef
+	predef FillBox
 	ld a, $d0
 	ld [hSCY], a
 	ld a, $90
@@ -66690,7 +65811,7 @@
 	ld a, [$cf64]
 	cp $6
 	jr nc, .asm_866a7
-	ld hl, EnemyMoveEffect
+	ld hl, $c609
 	ld bc, $0010
 	call AddNTimes
 	ld a, [hl]
@@ -66706,7 +65827,7 @@
 	call WhiteBGMap
 	pop hl
 	call Function86748
-	ld a, [EnemyMoveAnimation]
+	ld a, [$c608]
 	cp 200 + 1
 	jr c, .asm_866c6
 	ld de, String_866fc
@@ -66720,7 +65841,7 @@
 	hlcoord 1, 2
 	call PlaceString
 	hlcoord 2, 2
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld bc, $0103
 	call PrintNum
 	hlcoord 11, 2
@@ -66734,8 +65855,7 @@
 	call Function32f9
 	decoord 6, 5
 	ld c, $6
-	ld a, $49
-	call Predef
+	predef Functiond066e
 	and a
 	ret
 ; 866fb
@@ -66765,7 +65885,7 @@
 	ld a, [hl]
 	and a
 	jr z, .asm_86743
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld bc, $0062
 	call CopyBytes
 	call CloseSRAM
@@ -66814,8 +65934,7 @@
 	ld [CurPartySpecies], a
 	ld [$d265], a
 	ld hl, TempMonDVs
-	ld a, $2d
-	call Predef
+	predef GetUnownLetter
 	xor a
 	ld [$c2c6], a
 	hlcoord 6, 5
@@ -66883,8 +66002,7 @@
 	ld [$ffad], a
 	hlcoord 6, 6
 	ld bc, $0606
-	ld a, $13
-	call Predef
+	predef FillBox
 	ld a, $d0
 	ld [hSCY], a
 	ld a, $90
@@ -66908,8 +66026,7 @@
 	ld [$ffad], a
 	hlcoord 12, 5
 	ld bc, $0707
-	ld a, $13
-	call Predef
+	predef FillBox
 	ld a, $c0
 	ld [hSCX], a
 	call WaitBGMap
@@ -67396,8 +66513,7 @@
 	xor a
 	ld [hBGMapMode], a
 	ld bc, $0707
-	ld a, $13
-	call Predef
+	predef FillBox
 	xor a
 	ld [hBGMapThird], a
 	call WaitBGMap
@@ -67559,8 +66675,7 @@
 	ld b, BANK(ChrisBackpic)
 	ld de, $9310
 	ld c, $31
-	ld a, $40
-	call Predef
+	predef DecompressPredef
 	ret
 ; 88840
 
@@ -67626,8 +66741,7 @@
 	ld [$ffad], a
 	hlcoord 6, 4
 	ld bc, $0707
-	ld a, $13
-	call Predef
+	predef FillBox
 	ret
 ; 888a9
 
@@ -68588,12 +67702,12 @@
 ; 89655
 
 Function89655: ; 89655
-	ld hl, $ceca
-	ld de, $0014
-	ld a, $5
-	ld b, $4
+	ld hl, AttrMap + SCREEN_WIDTH * 12 + 1
+	ld de, SCREEN_WIDTH
+	ld a, 5
+	ld b, 4
 .asm_8965f
-	ld c, $12
+	ld c, 18
 	push hl
 .asm_89662
 	ld [hli], a
@@ -68895,7 +68009,7 @@
 	xor a
 	ld [CurPartySpecies], a
 	ld de, $9370
-	callba Function5120d
+	callba GetTrainerPic
 	pop bc
 	ret
 ; 897d5
@@ -68927,8 +68041,7 @@
 	ld [$ffad], a
 	hlcoord 12, 3
 	ld bc, $0707
-	ld a, $13
-	call Predef
+	predef FillBox
 	call Function8963d
 	pop bc
 	ret
@@ -73153,7 +72266,7 @@
 
 Function8b31a: ; 8b31a
 	push bc
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	add hl, bc
 	inc de
 	pop bc
@@ -74372,6 +73485,7 @@
 SECTION "bank23", ROMX, BANK[$23]
 
 Function8c000: ; 8c000
+Function8c000_2:
 	ret
 ; 8c001
 
@@ -79523,9 +78637,9 @@
 ; known jump sources: 8e865 (23:6865)
 Function8e86c: ; 8e86c (23:686c)
 	push bc
-	ld a, [hConnectedMapWidth] ; $ff00+$b0
+	ld a, [$ffb0]
 	ld hl, PartyMon1Item ; $dce0
-	ld bc, $30
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	pop bc
 	ld a, [hl]
@@ -79584,9 +78698,9 @@
 	ld a, $60
 	ld [hl], a
 	ld a, c
-	ld [EnemyMoveAnimation], a ; $c608 (aliases: EnemyMoveStruct)
+	ld [$c608], a
 	ld a, b
-	ld [EnemyMoveEffect], a ; $c609
+	ld [$c609], a
 	ret
 
 ; known jump sources: 8e898 (23:6898)
@@ -79599,7 +78713,7 @@
 ; known jump sources: 8e8d8 (23:68d8)
 Function8e8df: ; 8e8df (23:68df)
 	push bc
-	ld a, [hConnectedMapWidth] ; $ff00+$b0
+	ld a, [$ffb0]
 	ld hl, PartyMon1Item ; $dce0
 	ld bc, $30
 	call AddNTimes
@@ -79628,7 +78742,7 @@
 Function8e908: ; 8e908 (23:6908)
 	ld a, [$c3b7]
 	push af
-	ld a, [hConnectedMapWidth] ; $ff00+$b0
+	ld a, [$ffb0]
 	ld hl, PartySpecies ; $dcd8
 	ld e, a
 	ld d, $0
@@ -79637,7 +78751,7 @@
 	call ReadMonMenuIcon
 	ld [CurIcon], a ; $c3b6
 	call Function8e9db
-	ld a, [hConnectedMapWidth] ; $ff00+$b0
+	ld a, [$ffb0]
 	add a
 	add a
 	add a
@@ -79656,7 +78770,7 @@
 ; known jump sources: 8e868 (23:6868), 8e8b4 (23:68b4), 8e8db (23:68db)
 Function8e936: ; 8e936 (23:6936)
 	push bc
-	ld a, [hConnectedMapWidth] ; $ff00+$b0
+	ld a, [$ffb0]
 	ld b, a
 	call Function8e94c
 	ld a, b
@@ -80360,7 +79474,7 @@
 	end
 ; 0x90255
 
-UnknownScript_0x90255: ; 0x90255
+UnknownScript_0x90255:: ; 0x90255
 	3callasm Function9025c
 	2jump UnknownScript_0x90241
 ; 0x9025c
@@ -83955,8 +83069,7 @@
 	ld hl, VisitedSpawns
 	ld b, CHECK_FLAG
 	ld d, 0
-	ld a, PREDEF_FLAG
-	call Predef
+	predef FlagPredef
 	ld a, c
 	ret
 ; 91c5e
@@ -87322,7 +86435,7 @@
 	jr nc, .asm_b8214
 	call Functionb83e5
 	jr nc, .asm_b8214
-	ld a, $8
+	ld a, BATTLETYPE_TREE
 	ld [BattleType], a
 	ld a, $1
 	ld [ScriptVar], a
@@ -91299,7 +90412,7 @@
 	call PrintNum
 
 	hlcoord 11, 10
-	ld de, EnemyMonMaxHPHi
+	ld de, EnemyMonMaxHP
 	call PrintNum
 
 	ld hl, SwitchMonText
@@ -93241,7 +92354,7 @@
 	xor a
 	ld [hBGMapMode], a
 	call DisableLCD
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	ld bc, $01e0
 	xor a
 	call ByteFill
@@ -93923,7 +93036,7 @@
 ; e16e2
 
 Functione16e2: ; e16e2
-	ld bc, $0404
+	lb bc, 4, 4
 .asm_e16e5
 	push bc
 .asm_e16e6
@@ -95752,12 +94865,10 @@
 	ld [CurPartySpecies], a
 	ld [CurSpecies], a
 	ld hl, TempMonDVs
-	ld a, $2d
-	call Predef
+	predef GetUnownLetter
 	call GetBaseData
 	ld de, $9000
-	ld a, $3c
-	call Predef
+	predef GetFrontpic
 	xor a
 	ld [$cb32], a
 	ld a, [CurPartySpecies]
@@ -96011,7 +95122,7 @@
 	ld a, [hl]
 	and a
 	jr z, .asm_e2cee
-	ld hl, PartyMonNicknames ; $de41 (aliases: PartyMon1Nickname)
+	ld hl, PartyMonNicknames ; $de41 (aliases: PartyMonNicknames)
 	ld bc, $b
 	ld a, e
 	call AddNTimes
@@ -96402,8 +95513,7 @@
 	call Functione2fd6
 	ld a, $3
 	ld [MonType], a ; $cf5f
-	ld a, $25
-	call Predef
+	predef StatsScreenInit
 	call Functione33e8
 	call MaxVolume
 	ret
@@ -96431,8 +95541,7 @@
 	ld [CurPartySpecies], a ; $d108
 	ld [CurSpecies], a ; $cf60
 	ld hl, TempMonDVs ; $d123
-	ld a, $2d
-	call Predef
+	predef GetUnownLetter
 	call GetBaseData
 	call Functione2fd6
 .asm_e2fd0
@@ -96474,9 +95583,9 @@
 .asm_e3020
 	ld hl, PartySpecies ; $dcd8
 	call Functione3357
-	ld hl, PartyMonNicknames ; $de41 (aliases: PartyMon1Nickname)
+	ld hl, PartyMonNicknames ; $de41 (aliases: PartyMonNicknames)
 	call Functione3363
-	ld hl, PartyMonOT ; $ddff (aliases: PartyMon1OT)
+	ld hl, PartyMonOT ; $ddff (aliases: PartyMonOT)
 	call Functione3376
 	ld hl, PartyMons ; $dcdf (aliases: PartyMon1, PartyMon1Species)
 	ld bc, $30
@@ -96519,13 +95628,12 @@
 	ld hl, $cb2a
 	add [hl]
 	ld [CurPartyMon], a ; $d109
-	ld hl, PartyMonNicknames ; $de41 (aliases: PartyMon1Nickname)
+	ld hl, PartyMonNicknames ; $de41 (aliases: PartyMonNicknames)
 	ld a, [CurPartyMon] ; $d109
 	call GetNick
 	ld a, $1
 	ld [$d10b], a
-	ld a, $8
-	call Predef
+	predef Functiondb3f
 	jr c, .asm_e30e4
 	xor a
 	ld [$d10b], a
@@ -96580,8 +95688,7 @@
 	call CloseSRAM
 	xor a
 	ld [$d10b], a
-	ld a, $8
-	call Predef
+	predef Functiondb3f
 	jr c, .asm_e316a
 	ld a, $1
 	ld [$d10b], a
@@ -96806,14 +95913,14 @@
 	ld [CurPartyMon], a
 	ld a, $1
 	call GetSRAMBank
-	ld hl, BoxSpecies
+	ld hl, sBoxSpecies
 	call Functione3357
-	ld hl, BoxMon1Nickname
+	ld hl, sBoxMonNicknames
 	call Functione3363
-	ld hl, BoxMon1OT
+	ld hl, sBoxMonOT
 	call Functione3376
-	ld hl, BoxMon1Species
-	ld bc, $0020
+	ld hl, sBoxMons
+	ld bc, sBoxMon1End - sBoxMon1
 	call Functione3389
 	call CloseSRAM
 	callba Function5088b
@@ -96843,12 +95950,12 @@
 	ld [CurPartyMon], a
 	ld hl, PartySpecies
 	call Functione3357
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call Functione3363
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	call Functione3376
 	ld hl, PartyMon1Species
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call Functione3389
 	xor a
 	ld [$d10b], a
@@ -97077,8 +96184,8 @@
 
 ; known jump sources: e36e7 (38:76e7), e375d (38:775d), e376e (38:776e)
 Functione3626: ; e3626 (38:7626)
-	ld bc, $9
-	ld hl, Box1Name ; $db75
+	ld bc, 9
+	ld hl, wBoxNames
 	call AddNTimes
 	ld d, h
 	ld e, l
@@ -97111,7 +96218,10 @@
 ; e3668
 
 String_e3668: ; e3668
-	db "/20@"
+	db "/"
+	db "0" + MONS_PER_BOX / 10
+	db "0" + MONS_PER_BOX % 10
+	db "@"
 ; e366c
 
 ; known jump sources: e3717 (38:7717)
@@ -101138,7 +100248,7 @@
 	jr nz, .asm_fbba4
 	ld a, [CurPartyMon]
 	ld hl, PartyMon1Species
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
 	push hl
 	ld bc, $0015
@@ -101169,7 +100279,7 @@
 	ld [de], a
 	inc de
 	ld a, [CurPartyMon]
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	call SkipNames
 	call CopyBytes
 	ld a, $3
@@ -101284,8 +100394,7 @@
 	ld a, $31
 .asm_fbd8a
 	ld [$FF00+$ad], a
-	ld a, $13
-	call Predef
+	predef FillBox
 Functionfbd91: ; fbd91 (3e:7d91)
 	ld a, $1
 	ld [hBGMapMode], a ; $ff00+$d4
@@ -101596,8 +100705,7 @@
 	push af
 	ld a, [$cf64]
 	push af
-	ld a, $1e
-	call Predef
+	predef Function28f24
 	pop af
 	ld [$cf64], a
 	pop af
@@ -101639,8 +100747,7 @@
 	ld hl, $d960
 	ld a, [$cf63]
 	ld c, a
-	ld a, PREDEF_FLAG
-	call Predef
+	predef FlagPredef
 	ld a, c
 	and a
 	ret
@@ -101675,7 +100782,7 @@
 	call Functionfcde8
 	call Functionfcdf4
 
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	ld bc, $000b
 	call Functionfcdd7
 	ld de, $c6f2
@@ -101727,8 +100834,7 @@
 	ld [MonType], a
 	ld [$d10b], a
 	callab Functione039
-	ld a, PREDEF_ADDPARTYMON
-	call Predef
+	predef Functiond88c
 
 	ld e, TRADE_DIALOG
 	call GetTradeAttribute
@@ -101745,7 +100851,7 @@
 	ld de, $c70e
 	call Functionfcdf4
 
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld bc, PKMN_NAME_LENGTH
 	call Functionfcdde
 	ld hl, $c70e
@@ -101760,7 +100866,7 @@
 	ld de, $c719
 	call Functionfcdf4
 
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	ld bc, $000b
 	call Functionfcdde
 	ld hl, $c724
@@ -102478,7 +101584,7 @@
 	call ByteFill
 	xor a
 	ld hl, $c300
-	ld bc, Start
+	ld bc, $100
 	call ByteFill
 	ld a, [rIE]
 	ld [BGMapBuffer], a
@@ -103852,11 +102958,11 @@
 Function100b12: ; 100b12
 	call Function100dd8
 	ret c
-	ld hl, $4f2c
-	ld a, $9
+	ld hl, BattleMenuDataHeader
+	ld a, BANK(BattleMenuDataHeader)
 	ld de, LoadMenuDataHeader
 	call FarCall_de
-	ld a, $9
+	ld a, BANK(BattleMenuDataHeader)
 	ld [$cf94], a
 	ld a, [$d0d2]
 	ld [$cf88], a
@@ -103989,8 +103095,8 @@
 	ld a, [$cfa9]
 	dec a
 	ld c, a
-	ld b, $0
-	ld hl, BattleMonPPMove1
+	ld b, 0
+	ld hl, BattleMonPP
 	add hl, bc
 	ld a, [hl]
 	and $3f
@@ -104004,8 +103110,8 @@
 	ld a, [$cfa9]
 	dec a
 	ld c, a
-	ld b, $0
-	ld hl, BattleMonMove1
+	ld b, 0
+	ld hl, BattleMonMoves
 	add hl, bc
 	ld a, [hl]
 	ld [CurPlayerMove], a
@@ -104027,23 +103133,22 @@
 
 Function100c74: ; 100c74
 	hlcoord 0, 8
-	ld b, $8
-	ld c, $8
+	ld b, 8
+	ld c, 8
 	call TextBox
-	ld hl, BattleMonMove1
+	ld hl, BattleMonMoves
 	ld de, $d25e
-	ld bc, $0004
+	ld bc, NUM_MOVES
 	call CopyBytes
-	ld a, $28
+	ld a, SCREEN_WIDTH * 2
 	ld [Buffer1], a
 	hlcoord 2, 10
-	ld a, $20
-	call Predef
+	predef ListMoves
 	ret
 ; 100c98
 
 Function100c98: ; 100c98
-	ld de, $4cad
+	ld de, Unknown_100cad
 	call Function1bb1
 	ld a, [$d0eb]
 	inc a
@@ -104054,6 +103159,7 @@
 	ret
 ; 100cad
 
+Unknown_100cad: ; 100cad
 INCBIN "baserom.gbc",$100cad,$100cb5 - $100cad
 
 
@@ -104584,10 +103690,10 @@
 	bit 2, [hl]
 	jr nz, .asm_102110
 	call Function10218d
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	bit 4, [hl]
 	jr z, .asm_102110
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	bit 2, [hl]
 	jr nz, .asm_102110
 	call Function102112
@@ -104607,7 +103713,7 @@
 	ld c, $28
 .asm_10211c
 	push hl
-	ld de, PlayerMoveAnimation
+	ld de, $c60f
 	ld b, $1f
 .asm_102122
 	ld a, [de]
@@ -104666,7 +103772,7 @@
 ; 102180
 
 Function102180: ; 102180
-	ld hl, EnemyMoveEffect
+	ld hl, $c609
 	ld de, StringBuffer2
 	ld bc, $000b
 	call CopyBytes
@@ -104675,11 +103781,11 @@
 
 Function10218d: ; 10218d
 	ld hl, $dc00
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld bc, $0026
 	ld a, $5
 	call FarCopyWRAM
-	ld de, EnemyMoveEffect
+	ld de, $c609
 	ret
 ; 10219f
 
@@ -104686,7 +103792,7 @@
 Function10219f: ; 10219f
 	call FadeToMenu
 	call Function10218d
-	ld de, EnemyMoveEffect
+	ld de, $c609
 	callba Function8ac4e
 	call Functiona36
 	call PlayClickSFX
@@ -104697,7 +103803,7 @@
 Function1021b8: ; 1021b8
 	call FadeToMenu
 	call Function10218d
-	ld de, PlayerMoveAnimation
+	ld de, $c60f
 	callba Function8ac70
 	ld a, c
 	ld [StringBuffer1], a
@@ -105289,10 +104395,10 @@
 
 ; known jump sources: 104261 (41:4261)
 asm_104265: ; 104265 (41:4265)
-	ld a, [hConnectionStripLength] ; $ff00+$af
+	ld a, [$ffaf]
 	push af
 	ld a, c
-	ld [hConnectionStripLength], a ; $ff00+$af
+	ld [$ffaf], a
 	ld c, $12
 .asm_10426d
 	ld b, $14
@@ -105302,7 +104408,7 @@
 	ld [hli], a
 	dec b
 	jr nz, .asm_10426f
-	ld a, [hConnectionStripLength] ; $ff00+$af
+	ld a, [$ffaf]
 	ld b, $c
 .asm_104279
 	ld [hli], a
@@ -105311,7 +104417,7 @@
 	dec c
 	jr nz, .asm_10426d
 	pop af
-	ld [hConnectionStripLength], a ; $ff00+$af
+	ld [$ffaf], a
 	ret
 
 
@@ -105366,7 +104472,7 @@
 	ld d, h
 	ld e, l
 	pop hl
-	ld bc, Start
+	ld bc, $100
 	add hl, bc
 	pop bc
 	ld a, c
@@ -106122,7 +105228,7 @@
 	ld a, [$FF00+$bb]
 	cp $2
 	jr z, Function104b22
-	ld hl, hPastLeadingZeroes ; $ffb3 (aliases: hDividend, hProduct)
+	ld hl, $ffb3
 	ld b, $1
 	call Function104d56
 	jr nz, .asm_104ac8
@@ -106200,7 +105306,7 @@
 
 ; known jump sources: 104b04 (41:4b04), 104b2e (41:4b2e)
 Function104b40: ; 104b40 (41:4b40)
-	ld hl, hPastLeadingZeroes ; $ffb3 (aliases: hDividend, hProduct)
+	ld hl, $ffb3
 	ld b, $1
 	call Function104d56
 	ret nz
@@ -106211,14 +105317,14 @@
 	ld a, [$FF00+$bc]
 	cp $6c
 	ret nz
-	ld a, [hPastLeadingZeroes] ; $ff00+$b3 (aliases: hDividend, hProduct)
+	ld a, [$ffb3]
 	cp $96
 	jp nz, Function104d32
 	ld a, $90
-	ld [hPastLeadingZeroes], a ; $ff00+$b3 (aliases: hDividend, hProduct)
+	ld [$ffb3], a
 	call Function104d38
 	ret nz
-	ld hl, hPastLeadingZeroes ; $ffb3 (aliases: hDividend, hProduct)
+	ld hl, $ffb3
 	ld b, $1
 	call Function104d4e
 	ret nz
@@ -106241,8 +105347,8 @@
 ; known jump sources: 104b10 (41:4b10), 104b22 (41:4b22)
 Function104b88: ; 104b88 (41:4b88)
 	ld a, $96
-	ld [hPastLeadingZeroes], a ; $ff00+$b3 (aliases: hDividend, hProduct)
-	ld hl, hPastLeadingZeroes ; $ffb3 (aliases: hDividend, hProduct)
+	ld [$ffb3], a
+	ld hl, $ffb3
 	ld b, $1
 	call Function104d4e
 	ret nz
@@ -106252,7 +105358,7 @@
 	ret nz
 	call Function104d43
 	ret nz
-	ld hl, hPastLeadingZeroes ; $ffb3 (aliases: hDividend, hProduct)
+	ld hl, $ffb3
 	ld b, $1
 	call Function104d56
 	ret nz
@@ -106260,7 +105366,7 @@
 	ld a, [$FF00+$bc]
 	cp $6c
 	ret nz
-	ld a, [hPastLeadingZeroes] ; $ff00+$b3 (aliases: hDividend, hProduct)
+	ld a, [$ffb3]
 	cp $90
 	jp nz, Function104d32
 	call Function104d38
@@ -106361,7 +105467,7 @@
 
 ; known jump sources: 104c4e (41:4c4e), 104c78 (41:4c78)
 Function104c8a: ; 104c8a (41:4c8a)
-	ld hl, hPastLeadingZeroes ; $ffb3 (aliases: hDividend, hProduct)
+	ld hl, $ffb3
 	ld b, $1
 	call Function104d56
 	ret nz
@@ -106369,14 +105475,14 @@
 	ld a, [$FF00+$bc]
 	cp $6c
 	ret nz
-	ld a, [hPastLeadingZeroes] ; $ff00+$b3 (aliases: hDividend, hProduct)
+	ld a, [$ffb3]
 	cp $3c
 	jp nz, Function104d32
 	swap a
-	ld [hPastLeadingZeroes], a ; $ff00+$b3 (aliases: hDividend, hProduct)
+	ld [$ffb3], a
 	call Function104d38
 	ret nz
-	ld hl, hPastLeadingZeroes ; $ffb3 (aliases: hDividend, hProduct)
+	ld hl, $ffb3
 	ld b, $1
 	call Function104d4e
 	ret nz
@@ -106399,8 +105505,8 @@
 ; known jump sources: 104c5a (41:4c5a), 104c6c (41:4c6c)
 Function104cd2: ; 104cd2 (41:4cd2)
 	ld a, $3c
-	ld [hPastLeadingZeroes], a ; $ff00+$b3 (aliases: hDividend, hProduct)
-	ld hl, hPastLeadingZeroes ; $ffb3 (aliases: hDividend, hProduct)
+	ld [$ffb3], a
+	ld hl, $ffb3
 	ld b, $1
 	call Function104d4e
 	ret nz
@@ -106410,7 +105516,7 @@
 	ret nz
 	call Function104d43
 	ret nz
-	ld hl, hPastLeadingZeroes ; $ffb3 (aliases: hDividend, hProduct)
+	ld hl, $ffb3
 	ld b, $1
 	call Function104d56
 	ret nz
@@ -106418,7 +105524,7 @@
 	ld a, [$FF00+$bc]
 	cp $6c
 	ret nz
-	ld a, [hPastLeadingZeroes] ; $ff00+$b3 (aliases: hDividend, hProduct)
+	ld a, [$ffb3]
 	swap a
 	cp $3c
 	jp nz, Function104d32
@@ -107013,7 +106119,7 @@
 	ld d, $0
 	ld b, $2
 	ld hl, $abf0
-	ld a, $3
+	predef_id FlagPredef
 	push hl
 	push bc
 	call Predef
@@ -107025,8 +106131,7 @@
 	ret nz
 	call Function105106
 	ld b, $1
-	ld a, $3
-	call Predef
+	predef FlagPredef
 	call CloseSRAM
 	xor a
 	ret
@@ -107040,8 +106145,7 @@
 	ld d, $0
 	ld b, $2
 	ld hl, $abf0
-	ld a, $3
-	call Predef
+	predef FlagPredef
 	ld a, c
 	and a
 	pop bc
@@ -107623,45 +106727,37 @@
 
 
 UsedMoveText: ; 105db9
-
 ; this is a stream of text and asm from 105db9 to 105ef6
 
-; print actor name
 	text_jump _ActorNameText
 	start_asm
 
-; ????
 	ld a, [hBattleTurn]
 	and a
 	jr nz, .start
 	
-; append used move list
-	ld a, [PlayerMoveAnimation]
+	ld a, [wPlayerMoveStruct + MOVE_ANIM]
 	call UpdateUsedMoves
 	
 .start
-; get address for last move
-	ld a, $13 ; last move
-	call _GetBattleVar
+	ld a, BATTLE_VARS_LAST_MOVE
+	call GetBattleVarAddr
 	ld d, h
 	ld e, l
 	
-; get address for last counter move
-	ld a, $11
-	call _GetBattleVar
+	ld a, BATTLE_VARS_LAST_COUNTER_MOVE
+	call GetBattleVarAddr
 	
-; get move animation (id)
-	ld a, $c ; move animation
+	ld a, BATTLE_VARS_MOVE_ANIM
 	call GetBattleVar
 	ld [$d265], a
 	
-; check actor ????
 	push hl
 	callba Function34548
 	pop hl
 	jr nz, .grammar
 	
-; update last move
+	; update last move
 	ld a, [$d265]
 	ld [hl], a
 	ld [de], a
@@ -107673,13 +106769,13 @@
 	
 ; everything except 'instead' made redundant in localization
 
-; check obedience
+	; check obedience
 	ld a, [AlreadyDisobeyed]
 	and a
 	ld hl, UsedMove2Text
 	ret nz
 	
-; check move grammar
+	; check move grammar
 	ld a, [$d265]
 	cp $3
 	ld hl, UsedMove2Text
@@ -108246,7 +107342,7 @@
 
 Function106051: ; 106051
 	ld a, [BattleType]
-	cp $3
+	cp BATTLETYPE_TUTORIAL
 	ret z
 	ld hl, $a01b
 	jp Function10611d
@@ -108259,7 +107355,7 @@
 
 Function10605e: ; 10605e
 	ld a, [BattleType]
-	cp $3
+	cp BATTLETYPE_TUTORIAL
 	ret z
 	ld hl, $a01e
 	jp Function10611d
@@ -111517,25 +110613,25 @@
 Function119471: ; 119471 (46:5471)
 	push af
 	ld a, [hli]
-	ld [EnemyMoveAnimation], a ; $c608 (aliases: EnemyMoveStruct)
+	ld [$c608], a
 	ld a, [hli]
-	ld [EnemyMoveType], a ; $c60b
+	ld [$c60b], a
 	ld a, [hli]
-	ld [EnemyMoveEffect], a ; $c609
+	ld [$c609], a
 	ld a, [hli]
-	ld [EnemyMovePower], a ; $c60a
+	ld [$c60a], a
 	ld a, [hli]
-	ld [EnemyMoveAccuracy], a ; $c60c
+	ld [$c60c], a
 	ld a, [hli]
-	ld [EnemyMovePP], a ; $c60d
+	ld [$c60d], a ; $c60d
 	push hl
-	ld a, [EnemyMoveAnimation] ; $c608 (aliases: EnemyMoveStruct)
+	ld a, [$c608]
 	cp $ff
 	jr z, .asm_1194a7
-	ld a, [EnemyMovePower] ; $c60a
+	ld a, [$c60a]
 	cp $ff
 	jr z, .asm_1194a7
-	ld a, [EnemyMoveEffect] ; $c609
+	ld a, [$c609]
 	cp $ff
 	jr nz, .asm_1194a7
 	call Function119584
@@ -111542,8 +110638,8 @@
 	jr c, .asm_11950c
 	jr .asm_1194f0
 .asm_1194a7
-	ld hl, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct)
-	ld de, EnemyMoveType ; $c60b
+	ld hl, $c608
+	ld de, $c60b
 	ld c, $3
 .asm_1194af
 	ld a, [de]
@@ -111559,7 +110655,7 @@
 .asm_1194bc
 	ld c, $3
 	ld hl, $cd49
-	ld de, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct)
+	ld de, $c608
 .asm_1194c4
 	ld a, [de]
 	inc de
@@ -111576,7 +110672,7 @@
 .asm_1194d5
 	ld c, $3
 	ld hl, $cd49
-	ld de, EnemyMoveType ; $c60b
+	ld de, $c60b
 .asm_1194dd
 	ld a, [de]
 	inc de
@@ -111597,7 +110693,7 @@
 .asm_1194f3
 	ld c, $3
 	ld hl, $cd49
-	ld de, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct)
+	ld de, $c608
 .asm_1194fb
 	ld a, [de]
 	inc de
@@ -111616,9 +110712,9 @@
 	ld a, $1
 	ld [$cd50], a
 	ld a, l
-	ld [EnemyMoveAnimation], a ; $c608 (aliases: EnemyMoveStruct)
+	ld [$c608], a
 	ld a, h
-	ld [EnemyMoveEffect], a ; $c609
+	ld [$c609], a
 	ld de, $cd69
 	ld c, $10
 	ld b, $0
@@ -111698,9 +110794,9 @@
 
 ; known jump sources: 1194a0 (46:54a0)
 Function119584: ; 119584 (46:5584)
-	ld a, [EnemyMoveAnimation] ; $c608 (aliases: EnemyMoveStruct)
+	ld a, [$c608]
 	ld b, a
-	ld a, [EnemyMoveType] ; $c60b
+	ld a, [$c60b]
 	ld c, a
 	cp b
 	jr c, .asm_11959c
@@ -111717,9 +110813,9 @@
 	cp b
 	jr c, .asm_119595
 .asm_1195a2
-	ld a, [EnemyMovePower] ; $c60a
+	ld a, [$c60a]
 	ld b, a
-	ld a, [EnemyMovePP] ; $c60d
+	ld a, [$c60d] ; $c60d
 	ld c, a
 	cp b
 	jr c, .asm_1195ba
@@ -111764,9 +110860,9 @@
 	call CopyBytes
 	xor a
 	ld [de], a
-	ld a, [EnemyMoveAnimation] ; $c608 (aliases: EnemyMoveStruct)
+	ld a, [$c608]
 	ld l, a
-	ld a, [EnemyMoveEffect] ; $c609
+	ld a, [$c609]
 	ld h, a
 	ld de, $cd69
 	ld bc, $10
@@ -111938,11 +111034,11 @@
 	ld a, $1
 	ld [rSVBK], a ; $ff00+$70
 	ld a, [$cd4f]
-	ld c, $a
+	ld c, 10
 	call SimpleMultiply
 	ld hl, $cd50
 	ld [hl], a
-	ld bc, $30
+	ld bc, PartyMon2 - PartyMon1
 	ld de, PartyMon1Level ; $dcfe
 	ld a, [PartyCount] ; $dcd7
 .asm_119daf
@@ -111980,28 +111076,28 @@
 	ld a, [rSVBK] ; $ff00+$70
 	push af
 	ld a, [$cd4f]
-	cp $7
+	cp 70 / 10
 	jr nc, .asm_119e08
 	ld a, $1
 	ld [rSVBK], a ; $ff00+$70
 	ld hl, PartyMon1Level ; $dcfe
-	ld bc, $30
+	ld bc, PartyMon2 - PartyMon1
 	ld de, PartySpecies ; $dcd8
 	ld a, [PartyCount] ; $dcd7
 .asm_119deb
 	push af
 	ld a, [de]
-	cp $96
+	cp MEWTWO
 	jr z, .asm_119dfd
-	cp $97
+	cp MEW
 	jr z, .asm_119dfd
-	cp $f9
+	cp LUGIA
 	jr c, .asm_119e02
-	cp $fc
+	cp NUM_POKEMON + 1
 	jr nc, .asm_119e02
 .asm_119dfd
 	ld a, [hl]
-	cp $46
+	cp 70
 	jr c, .asm_119e0d
 .asm_119e02
 	add hl, bc
@@ -112021,7 +111117,7 @@
 	call GetPokemonName
 	ld hl, StringBuffer1 ; $d073
 	ld de, $cd49
-	ld bc, $b
+	ld bc, PKMN_NAME_LENGTH
 	call CopyBytes
 	ld a, $a
 	ld [$cf66], a
@@ -112355,7 +111451,7 @@
 	ld a, [$cfa9]
 	ld [$cd82], a
 	dec a
-	ld [hConnectedMapWidth], a
+	ld [$ffb0], a
 	ld a, $10
 	ld [$c3b7], a
 	ld hl, Function8e83f
@@ -112591,13 +111687,13 @@
 	ld a, $0
 	call GetSRAMBank
 	ld hl, $d4ba
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld bc, $0004
 	call CopyBytes
 	call CloseSRAM
 	ld a, $5
 	call GetSRAMBank
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	ld de, $b08c
 	ld bc, $0004
 	call CopyBytes
@@ -112651,7 +111747,7 @@
 INCBIN "baserom.gbc",$11b669,$11b7e5 - $11b669
 
 Function11b7e5: ; 11b7e5
-	ld a, [EnemyMovePP]
+	ld a, [$c60d]
 	ld [PlayerLightScreenCount], a
 	ld [CurPartySpecies], a
 	ld a, [$cd81]
@@ -112662,9 +111758,9 @@
 	call CopyBytes
 	ld a, $50
 	ld [de], a
-	ld a, [PlayerMoveAccuracy]
+	ld a, [$c613]
 	ld [$c731], a
-	ld a, [PlayerMovePP]
+	ld a, [$c614]
 	ld [$c732], a
 	ld hl, $c622
 	ld a, [hli]
@@ -112671,7 +111767,7 @@
 	ld [$c72f], a
 	ld a, [hl]
 	ld [$c730], a
-	ld bc, EnemyMovePP
+	ld bc, $c60d
 	callba GetCaughtGender
 	ld a, c
 	ld [$c733], a
@@ -112821,7 +111917,7 @@
 	xor a
 	ld [$a800], a
 	ld hl, $a823
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld bc, $008f
 	call CopyBytes
 	call CloseSRAM
@@ -112874,7 +111970,7 @@
 	ld a, $ff
 	ld [bc], a
 	ld hl, PartyMon1Species
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	ld a, e
 	ld [$cd2a], a
 .asm_11b9ba
@@ -112888,9 +111984,9 @@
 	ld l, a
 	ld a, [$cd23]
 	ld h, a
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	call CopyBytes
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	ld bc, $000b
 	ld a, [$cd2a]
 .asm_11b9d8
@@ -112908,7 +112004,7 @@
 	call CopyBytes
 	ld a, $50
 	ld [de], a
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	ld bc, $000b
 	ld a, [$cd2a]
 .asm_11b9f9
@@ -113187,7 +112283,7 @@
 .asm_11c123
 	sub e
 	ld [$cf64], a
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 .asm_11c12a
 	ld a, [de]
 	cp $50
@@ -113214,7 +112310,7 @@
 
 Function11c14a: ; 11c14a
 	ld c, $0
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 .asm_11c14f
 	ld a, [hli]
 	cp $50
@@ -113229,7 +112325,7 @@
 	ld a, $1
 	ld [rSVBK], a
 	ld a, $50
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	ld bc, $000b
 	call ByteFill
 	ld a, d
@@ -113258,9 +112354,9 @@
 	add hl, bc
 	ld bc, $0005
 .asm_11c18f
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	call CopyBytes
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	pop af
 	ld [rSVBK], a
 	ret
@@ -113338,7 +112434,7 @@
 	ld [rSVBK], a
 	ld hl, PlayerSDefLevel
 	ld de, LYOverrides
-	ld bc, Start
+	ld bc, $100
 	call CopyBytes
 	pop af
 	ld [rSVBK], a
@@ -115882,8 +114978,7 @@
 	hlcoord 4, 10
 	ld b, $1
 	ld c, $a
-	ld a, $10
-	call Predef
+	predef Function28eef
 	hlcoord 5, 11
 	ld de, $5701
 	call PlaceString
@@ -116098,7 +115193,7 @@
 	ld a, $5
 	call GetSRAMBank
 	ld hl, $a948
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld bc, $00f6
 	call CopyBytes
 	call CloseSRAM
@@ -116617,21 +115712,21 @@
 Function17093c: ; 17093c (5c:493c)
 	xor a
 	ld [ScriptVar], a ; $c2dd
-	ld a, $81
+	ld a, EGG_TICKET
 	ld [CurItem], a ; $d106
 	ld hl, NumItems ; $d892 (aliases: TMsHMsEnd)
 	call CheckItem
 	ret nc
 	ld a, [PartyCount] ; $dcd7
-	ld b, $0
+	ld b, 0
 	ld c, a
 	ld hl, PartySpecies ; $dcd8
 .asm_170955
 	ld a, [hli]
-	cp $fd
+	cp EGG
 	jr nz, .asm_17099f
 	push hl
-	ld hl, PartyMonOT ; $ddff (aliases: PartyMon1OT)
+	ld hl, PartyMonOT ; $ddff (aliases: PartyMonOT)
 	ld de, $6
 	ld a, b
 	and a
@@ -116641,7 +115736,7 @@
 	dec a
 	jr nz, .asm_170965
 .asm_170969
-	ld de, $49a4
+	ld de, String_1709a4
 	ld a, $6
 .asm_17096e
 	push af
@@ -116661,7 +115756,7 @@
 	ld [hli], a
 	ld [hli], a
 	pop hl
-	ld a, $81
+	ld a, EGG_TICKET
 	ld [CurItem], a ; $d106
 	ld a, $1
 	ld [$d10c], a
@@ -116672,6 +115767,7 @@
 	ld a, $1
 	ld [ScriptVar], a ; $c2dd
 	ret
+
 .asm_17099d
 	pop af
 	pop hl
@@ -116682,7 +115778,8 @@
 	ret
 ; 1709a4 (5c:49a4)
 
-INCBIN "baserom.gbc",$1709a4,$1709aa - $1709a4
+String_1709a4: ; 1709a4
+	db "なぞナゾ@@"
 
 ; no known jump sources
 Function1709aa: ; 1709aa (5c:49aa)
@@ -116802,7 +115899,7 @@
 	call GetSRAMBank
 	ld a, [$b2fb]
 	call CloseSRAM
-	ld c, $a
+	ld c, 10
 	call SimpleDivide
 	ld a, b
 	ld [$cd4f], a
@@ -117028,10 +116125,10 @@
 ; no known jump sources
 Function171ad7: ; 171ad7 (5c:5ad7)
 	xor a
-	ld hl, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct)
+	ld hl, $c608
 	ld bc, $66
 	call ByteFill
-	ld de, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct)
+	ld de, $c608
 	ld a, $c
 	call Function3e32
 	jp Function171c66
@@ -117061,7 +116158,7 @@
 	jr nz, .asm_171b01
 	hlcoord 2, 7
 	ld a, $3
-	ld de, EnemyMoveAnimation ; $c608 (aliases: EnemyMoveStruct)
+	ld de, $c608
 .asm_171b1b
 	push af
 	push hl
@@ -117428,7 +116525,7 @@
 	callba DrawPlayerHUD
 	ld hl, PlayerHPPal ; $cd99
 	call SetHPPal
-	callba Function3e043
+	callba DrawEnemyHUD
 	ld hl, EnemyHPPal ; $cd9a
 	call SetHPPal
 	callba Function3ee27
@@ -117663,8 +116760,7 @@
 	dec a
 	ld bc, PartyMon2 - PartyMon1
 	call AddNTimes
-	ld a, $2d
-	call Predef
+	predef GetUnownLetter
 	callab Functionfba18
 	ld a, [$def4]
 	and a
@@ -117843,7 +116939,7 @@
 	callba Function104061
 	call DisableLCD
 	ld hl, $8ee0
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld bc, $0010
 	call CopyBytes
 	ld a, $1
@@ -117856,7 +116952,7 @@
 	ld hl, $97f0
 	ld bc, $0010
 	call ByteFill
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	ld de, $8ee0
 	ld bc, $0010
 	call CopyBytes
@@ -117919,7 +117015,7 @@
 	ld a, $5
 	call GetSRAMBank
 	ld hl, $b1d3
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld bc, $0020
 	call CopyBytes
 	ld a, [$b1b1]
@@ -117954,7 +117050,7 @@
 	ld [$cd49], a
 	push hl
 	push de
-	ld hl, EnemyMoveAnimation
+	ld hl, $c608
 	ld e, b
 	ld d, $0
 	add hl, de
@@ -118198,7 +117294,7 @@
 	ld a, [$cd55]
 	ld d, a
 	add hl, de
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld a, [$cd56]
 	ld c, a
 	ld b, $0
@@ -118206,7 +117302,7 @@
 	ld a, $50
 	ld [de], a
 	pop hl
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	call PlaceString
 	ld a, c
 	ld [$cd52], a
@@ -118298,10 +117394,10 @@
 	add hl, de
 	ld a, [hl]
 	ld c, a
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	callba Function48c63
 	pop hl
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	call PlaceString
 	ld a, c
 	ld [$cd52], a
@@ -118533,13 +117629,13 @@
 	ld a, $1
 	ld [rSVBK], a
 	ld hl, PlayerName
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld bc, $0006
 	call CopyBytes
 	ld a, $4
 	ld [rSVBK], a
 	pop hl
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	call PlaceString
 	ld a, c
 	ld [$cd52], a
@@ -118580,10 +117676,10 @@
 .asm_17f35d
 	ld c, a
 	call CloseSRAM
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	callba Function48c63
 	pop hl
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	call PlaceString
 	ld a, c
 	ld [$cd52], a
@@ -118797,7 +117893,7 @@
 	ld l, a
 	ld a, [$cd56]
 	ld h, a
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	ld a, [$cd57]
 	ld c, a
 	ld b, $0
@@ -118815,7 +117911,7 @@
 	call GetSRAMBank
 
 .asm_17f4b7
-	ld de, EnemyMoveAnimation
+	ld de, $c608
 	pop hl
 	push hl
 	ld a, [$cd57]
@@ -119445,7 +118541,7 @@
 	ld a, [CurPartySpecies]
 	ld [$d265], a
 	ld [CurSpecies], a
-	ld hl, PartyMon1Nickname
+	ld hl, PartyMonNicknames
 	call Function1dc50e
 	hlcoord 8, 4
 	call PlaceString
@@ -119465,7 +118561,7 @@
 	hlcoord 1, 9
 	ld de, String1dc550
 	call PlaceString
-	ld hl, PartyMon1OT
+	ld hl, PartyMonOT
 	call Function1dc50e
 	hlcoord 4, 9
 	call PlaceString
@@ -119480,17 +118576,16 @@
 	ld de, String1dc554
 	call PlaceString
 	hlcoord 7, 14
-	ld a, [TempMonMove1]
+	ld a, [TempMonMoves + 0]
 	call Function1dc51a
 	call Function1dc52c
 	ld hl, TempMonDVs
-	ld a, $2d
-	call Predef
+	predef GetUnownLetter
 	ld hl, $c2c6
 	xor a
 	ld [hl], a
 	ld a, [CurPartySpecies]
-	cp $c9
+	cp UNOWN
 	jr z, .asm_1dc469
 	inc [hl]
 
@@ -119523,22 +118618,22 @@
 	hlcoord 0, 1
 	call CopyBytes
 	hlcoord 7, 0
-	ld a, [TempMonMove2]
+	ld a, [TempMonMoves + 1]
 	call Function1dc51a
 	hlcoord 7, 2
-	ld a, [TempMonMove3]
+	ld a, [TempMonMoves + 2]
 	call Function1dc51a
 	hlcoord 7, 4
-	ld a, [TempMonMove4]
+	ld a, [TempMonMoves + 3]
 	call Function1dc51a
 	hlcoord 7, 7
 	ld de, String1dc55d
 	call PlaceString
 	hlcoord 16, 7
-	ld de, TempMonAtk
+	ld de, TempMonAttack
 	call Function1dc507
 	hlcoord 16, 9
-	ld de, TempMonDef
+	ld de, TempMonDefense
 	call Function1dc507
 	hlcoord 16, 11
 	ld de, TempMonSpclAtk
@@ -119547,7 +118642,7 @@
 	ld de, TempMonSpclDef
 	call Function1dc507
 	hlcoord 16, 15
-	ld de, TempMonSpd
+	ld de, TempMonSpeed
 	call Function1dc507
 	call WaitBGMap
 	ld b, $3
--- a/maps/CherrygroveCity.asm
+++ b/maps/CherrygroveCity.asm
@@ -130,7 +130,7 @@
 	winlosstext UnknownText_0x19c57f, UnknownText_0x19c5e6
 	setlasttalked $3
 	loadtrainer RIVAL1, RIVAL1_3
-	writecode $3, $1
+	writecode $3, BATTLETYPE_CANLOSE
 	startbattle
 	reloadmapmusic
 	reloadmap
@@ -142,7 +142,7 @@
 	winlosstext UnknownText_0x19c57f, UnknownText_0x19c5e6
 	setlasttalked $3
 	loadtrainer RIVAL1, RIVAL1_1
-	writecode $3, $1
+	writecode $3, BATTLETYPE_CANLOSE
 	startbattle
 	reloadmapmusic
 	reloadmap
@@ -154,7 +154,7 @@
 	winlosstext UnknownText_0x19c57f, UnknownText_0x19c5e6
 	setlasttalked $3
 	loadtrainer RIVAL1, RIVAL1_2
-	writecode $3, $1
+	writecode $3, BATTLETYPE_CANLOSE
 	startbattle
 	reloadmapmusic
 	reloadmap
--- a/maps/LakeofRage.asm
+++ b/maps/LakeofRage.asm
@@ -88,7 +88,7 @@
 	cry GYARADOS
 	loadmovesprites
 	loadpokedata GYARADOS, 30
-	writecode $3, $7
+	writecode $3, BATTLETYPE_SHINY
 	startbattle
 	if_equal $1, UnknownScript_0x7007a
 	disappear $a
--- a/maps/Route29.asm
+++ b/maps/Route29.asm
@@ -52,7 +52,7 @@
 	applymovement $2, MovementData_0x1a109a
 	stopfollow
 	loadpokedata RATTATA, 5
-	catchtutorial $3
+	catchtutorial BATTLETYPE_TUTORIAL
 	spriteface $2, $1
 	loadfont
 	2writetext UnknownText_0x1a114d
@@ -78,7 +78,7 @@
 	applymovement $2, MovementData_0x1a10a1
 	stopfollow
 	loadpokedata RATTATA, 5
-	catchtutorial $3
+	catchtutorial BATTLETYPE_TUTORIAL
 	spriteface $2, $1
 	loadfont
 	2writetext UnknownText_0x1a114d
@@ -121,7 +121,7 @@
 	iffalse UnknownScript_0x1a1022
 	loadmovesprites
 	loadpokedata RATTATA, 5
-	catchtutorial $3
+	catchtutorial BATTLETYPE_TUTORIAL
 	loadfont
 	2writetext UnknownText_0x1a114d
 	closetext
--- a/maps/TeamRocketBaseB1F.asm
+++ b/maps/TeamRocketBaseB1F.asm
@@ -464,7 +464,7 @@
 	cry VOLTORB
 	special $0031
 	setlasttalked $ff
-	writecode $3, $9
+	writecode $3, BATTLETYPE_TRAP
 	loadpokedata VOLTORB, 23
 	startbattle
 	end
@@ -474,7 +474,7 @@
 	cry GEODUDE
 	special $0031
 	setlasttalked $ff
-	writecode $3, $9
+	writecode $3, BATTLETYPE_TRAP
 	loadpokedata GEODUDE, 21
 	startbattle
 	end
@@ -484,7 +484,7 @@
 	cry KOFFING
 	special $0031
 	setlasttalked $ff
-	writecode $3, $9
+	writecode $3, BATTLETYPE_TRAP
 	loadpokedata KOFFING, 21
 	startbattle
 	end
--- a/maps/TinTower1F.asm
+++ b/maps/TinTower1F.asm
@@ -122,7 +122,7 @@
 	cry SUICUNE
 	pause 20
 	loadpokedata SUICUNE, 40
-	writecode $3, $c
+	writecode $3, BATTLETYPE_SUICUNE
 	startbattle
 	reloadmapmusic
 	disappear $2
--- a/maps/TinTowerRoof.asm
+++ b/maps/TinTowerRoof.asm
@@ -36,7 +36,7 @@
 	pause 15
 	loadmovesprites
 	setevent EVENT_FOUGHT_HO_OH
-	writecode $3, $a
+	writecode $3, BATTLETYPE_FORCEITEM
 	loadpokedata HO_OH, 60
 	startbattle
 	disappear $2
--- a/maps/VermilionCity.asm
+++ b/maps/VermilionCity.asm
@@ -56,7 +56,7 @@
 	pause 15
 	cry SNORLAX
 	loadmovesprites
-	writecode $3, $a
+	writecode $3, BATTLETYPE_FORCEITEM
 	loadpokedata SNORLAX, 50
 	startbattle
 	disappear $6
--- a/maps/WhirlIslandLugiaChamber.asm
+++ b/maps/WhirlIslandLugiaChamber.asm
@@ -36,7 +36,7 @@
 	pause 15
 	loadmovesprites
 	setevent EVENT_FOUGHT_LUGIA
-	writecode $3, $a
+	writecode $3, BATTLETYPE_FORCEITEM
 	loadpokedata LUGIA, 60
 	startbattle
 	disappear $2
--- a/predef/cgb.asm
+++ b/predef/cgb.asm
@@ -611,7 +611,7 @@
 
 .asm_91f5
 	ld hl, PartyMon1DVs
-	ld bc, $0030
+	ld bc, PartyMon2 - PartyMon1
 	ld a, [CurPartyMon]
 	call AddNTimes
 	ld c, l
@@ -840,11 +840,13 @@
 
 Function93d3: ; 93d3
 	ld a, [BattleType]
-	cp $3
+	cp BATTLETYPE_TUTORIAL
 	jr z, .asm_93e6
+
 	ld a, [PlayerGender]
 	bit 0, a
 	jr z, .asm_93e6
+
 	ld hl, Palettes_9469
 	jr .asm_93e9
 
--- a/text/battle.asm
+++ b/text/battle.asm
@@ -30,7 +30,7 @@
 	prompt
 ; 0x80793
 
-WildPokemonAppearedText2: ; 0x80793
+WildCelebiAppearedText: ; 0x80793
 	text "Wild @"
 	text_from_ram $c616
 	db $0
@@ -60,43 +60,43 @@
 	prompt
 ; 0x807e2
 
-BattleText_0x807e2: ; 0x807e2
+HurtByPoisonText: ; 0x807e2
 	text $5a
 	line "is hurt by poison!"
 	prompt
 ; 0x807f8
 
-BattleText_0x807f8: ; 0x807f8
+HurtByBurnText: ; 0x807f8
 	text $5a, "'s"
 	line "hurt by its burn!"
 	prompt
 ; 0x8080e
 
-BattleText_0x8080e: ; 0x8080e
+LeechSeedSapsText: ; 0x8080e
 	text "LEECH SEED saps"
 	line $5a, "!"
 	prompt
 ; 0x80822
 
-BattleText_0x80822: ; 0x80822
+HasANightmareText: ; 0x80822
 	text $5a
 	line "has a NIGHTMARE!"
 	prompt
 ; 0x80836
 
-BattleText_0x80836: ; 0x80836
+HurtByCurseText: ; 0x80836
 	text $5a, "'s"
 	line "hurt by the CURSE!"
 	prompt
 ; 0x8084d
 
-BattleText_0x8084d: ; 0x8084d
+SandstormHitsText: ; 0x8084d
 	text "The SANDSTORM hits"
 	line $5a, "!"
 	prompt
 ; 0x80864
 
-BattleText_0x80864: ; 0x80864
+PerishCountText: ; 0x80864
 	text $5a, "'s"
 	line "PERISH count is @"
 	deciram $d265, $11
--- a/text/types.asm
+++ b/text/types.asm
@@ -42,13 +42,13 @@
 	push hl
 	ld a, b
 	dec a
-	ld bc, Move2 - Move1
+	ld bc, MOVE_LENGTH
 	ld hl, Moves
 	call AddNTimes
 	ld de, StringBuffer1
 	ld a, BANK(Moves)
 	call FarCopyBytes
-	ld a, [StringBuffer1 + PlayerMoveType - PlayerMoveStruct]
+	ld a, [StringBuffer1 + MOVE_TYPE]
 	pop hl
 
 	ld b, a
--- a/trainers/trainers.asm
+++ b/trainers/trainers.asm
@@ -5,7 +5,7 @@
 	; Type
 		; 0: Level, species
 		; 1: Level, species, moves
-		; 2: Level, sepcies, item
+		; 2: Level, species, item
 		; 3: Level, species, item, moves
 	; Party
 		; Up to six monsters following the data type
--- a/wram.asm
+++ b/wram.asm
@@ -1,222 +1,120 @@
 INCLUDE "includes.asm"
 
+flag_array: MACRO
+	ds ((\1) + 7) / 8
+ENDM
 
-party_struct: MACRO
-
-\1Species::  db
-\1Item::     db
-
-\1Moves::
-\1Move1::    db
-\1Move2::    db
-\1Move3::    db
-\1Move4::    db
-
-\1ID::       dw
-\1Exp::      ds 3 ; Big endian
+box_struct_length EQU 32
+box_struct: MACRO
+\1Species::        db
+\1Item::           db
+\1Moves::          ds NUM_MOVES
+\1ID::             dw
+\1Exp::            ds 3
 \1StatExp::
-\1HPExp::    dw
-\1AtkExp::   dw
-\1DefExp::   dw
-\1SpdExp::   dw
-\1SpclExp::  dw
-
-\1DVs::
-\1AtkDefDV:: db
-\1SpdSpcDV:: db
-
-\1PP::
-\1PPMove1::  db
-\1PPMove2::  db
-\1PPMove3::  db
-\1PPMove4::  db
-
-\1Happiness::     db
-\1PokerusStatus:: db
-
+\1HPExp::          dw
+\1AtkExp::         dw
+\1DefExp::         dw
+\1SpdExp::         dw
+\1SpcExp::         dw
+\1DVs::            ds 2
+\1PP::             ds NUM_MOVES
+\1Happiness::      db
+\1PokerusStatus::  db
 \1CaughtData::
 \1CaughtTime::
 \1CaughtLevel::    db
 \1CaughtGender::
 \1CaughtLocation:: db
+\1Level::          db
+\1End::
+ENDM
 
-\1Level:: db
+party_struct: MACRO
+	box_struct \1
+\1Status::         db
+\1Unused::         db
+\1HP::             dw
+\1MaxHP::          dw
+\1Stats:: ; big endian
+\1Attack::         dw
+\1Defense::        dw
+\1Speed::          dw
+\1SpclAtk::        dw
+\1SpclDef::        dw
+\1StatsEnd::
+ENDM
 
-\1Status::   db
-\1Unused::   db
-
-; Stats are big endian.
-\1HP::       dw
-\1MaxHP::    dw
-\1Attack::   dw
-\1Defense::  dw
-\1Speed::    dw
-\1SpclAtk::  dw
-\1SpclDef::  dw
-
+battle_struct: MACRO
+\1Species::   db
+\1Item::      db
+\1Moves::     ds NUM_MOVES
+\1MovesEnd::
+\1DVs::       ds 2
+\1PP::        ds NUM_MOVES
+\1Happiness:: db
+\1Level::     db
+\1Status::    ds 2
+\1HP::        dw
+\1MaxHP::     dw
+\1Stats:: ; big endian
+\1Attack::    dw
+\1Defense::   dw
+\1Speed::     dw
+\1SpclAtk::   dw
+\1SpclDef::   dw
+\1StatsEnd::
+\1Type::
+\1Type1::     db
+\1Type2::     db
 ENDM
 
 
 channel_struct: MACRO
-; Addresses are Channel1 ($c101).
-
-\1MusicID:: ; c101
-	ds 2
-\1MusicBank:: ; c103
-	ds 1
-\1Flags:: ; c104
-; 0: on/off
-; 1: subroutine
-; 2: 
-; 3: 
-; 4: noise sampling on/off
-; 5: 
-; 6: 
-; 7: 
-	ds 1
-\1Flags2:: ; c105
-; 0: vibrato on/off
-; 1: 
-; 2: duty cycle on/off
-; 3: 
-; 4: 
-; 5: 
-; 6: 
-; 7: 
-	ds 1
-\1Flags3:: ; c106
-; 0: vibrato up/down
-; 1: 
-; 2: 
-; 3: 
-; 4: 
-; 5: 
-; 6: 
-; 7: 
-	ds 1
-\1MusicAddress:: ; c107
-	ds 2
-\1LastMusicAddress:: ; c109
-	ds 2
-; could have been meant as a third-level address
-	ds 2
-\1NoteFlags:: ; c10d
-; 0: 
-; 1: 
-; 2: 
-; 3: 
-; 4: 
-; 5: rest
-; 6: 
-; 7: 
-	ds 1
-\1Condition:: ; c10e
-; used for conditional jumps
-	ds 1
-\1DutyCycle:: ; c10f
-; uses top 2 bits only
-;	0: 12.5%
-;	1: 25%
-;	2: 50%
-;	3: 75%
-	ds 1
-\1Intensity:: ; c110
-;	hi: pressure
-;   lo: velocity
-	ds 1
-\1Frequency::
-; 11 bits
-\1FrequencyLo:: ; c111
-	ds 1
-\1FrequencyHi:: ; c112
-	ds 1
-\1Pitch:: ; c113
-; 0: rest
-; 1: C
-; 2: C#
-; 3: D
-; 4: D#
-; 5: E
-; 6: F
-; 7: F#
-; 8: G
-; 9: G#
-; a: A
-; b: A#
-; c: B
-	ds 1
-\1Octave:: ; c114
-; 0: highest
-; 7: lowest
-	ds 1
-\1StartingOctave:: ; c115
-; raises existing octaves by this value
-; used for repeating phrases in a higher octave to save space
-	ds 1
-\1NoteDuration:: ; c116
-; number of frames remaining in the current note
-	ds 1
-; c117
-	ds 1
-; c118
-	ds 1
-\1LoopCount:: ; c119
-	ds 1
-\1Tempo:: ; c11a
-	ds 2
-\1Tracks:: ; c11c
-; hi: l
-; lo: r
-	ds 1
-; c11d
-	ds 1
-
-\1VibratoDelayCount:: ; c11e
-; initialized at the value in VibratoDelay
-; decrements each frame
-; at 0, vibrato starts
-	ds 1
-\1VibratoDelay:: ; c11f
-; number of frames a note plays until vibrato starts
-	ds 1
-\1VibratoExtent:: ; c120
-; difference in 
-	ds 1
-\1VibratoRate:: ; c121
-; counts down from a max of 15 frames
-; over which the pitch is alternated
-; hi: init frames
-; lo: frame count
-	ds 1
-
-; c122
-	ds 1
-; c123
-	ds 1
-; c124
-	ds 1
-; c125
-	ds 1
-; c126
-	ds 1
-; c127
-	ds 1
-\1CryPitch:: ; c128
-	ds 1
-\1CryEcho:: ; c129
-	ds 1
-	ds 4
-\1NoteLength:: ; c12e
-; # frames per 16th note
-	ds 1
-; c12f
-	ds 1
-; c130
-	ds 1
-; c131
-	ds 1
-; c132
-	ds 1
+; Addreses are Channel1 (c101).
+\1MusicID::           dw
+\1MusicBank::         db
+\1Flags::             db ; 0:on/off 1:subroutine 4:noise
+\1Flags2::            db ; 0:vibrato on/off 2:duty
+\1Flags3::            db ; 0:vibrato up/down
+\1MusicAddress::      dw
+\1LastMusicAddress::  dw
+                      dw
+\1NoteFlags::         db ; 5:rest
+\1Condition::         db ; conditional jumps
+\1DutyCycle::         db ; bits 6-7 (0:12.5% 1:25% 2:50% 3:75%)
+\1Intensity::         db ; hi:pressure lo:velocity
+\1Frequency:: ; 11 bits
+\1FrequencyLo::       db
+\1FrequencyHi::       db
+\1Pitch::             db ; 0:rest 1-c:note
+\1Octave::            db ; 7-0 (0 is highest)
+\1StartingOctave::    db ; raises existing octaves (to repeat phrases)
+\1NoteDuration::      db ; frames remaining for the current note
+                      ds 1 ; c117
+                      ds 1 ; c118
+\1LoopCount::         db
+\1Tempo::             dw
+\1Tracks::            db ; hi:left lo:right
+                      ds 1 ; c11d
+\1VibratoDelayCount:: db ; initialized by \1VibratoDelay
+\1VibratoDelay::      db ; number of frames a note plays until vibrato starts
+\1VibratoExtent::     db
+\1VibratoRate::       db ; hi:frames for each alt lo:frames to the next alt
+                      ds 1 ; c122
+                      ds 1 ; c123
+                      ds 1 ; c124
+                      ds 1 ; c125
+                      ds 1 ; c126
+                      ds 1 ; c127
+\1CryPitch::          db
+\1CryEcho::           db
+                      ds 4
+\1NoteLength::        db ; frames per 16th note
+                      ds 1 ; c12f
+                      ds 1 ; c130
+                      ds 1 ; c131
+                      ds 1 ; c132
 ENDM
 
 SECTION "tiles0",VRAM[$8000],BANK[0]
@@ -235,8 +133,7 @@
 SECTION "WRAMBank0",WRAM0[$c000]
 
 SECTION "stack",WRAM0[$c0ff]
-Stack:: ; c0ff
-	ds -$100
+Stack:: ds -$100 ; c0ff
 
 
 SECTION "audio",WRAM0[$c100]
@@ -245,39 +142,24 @@
 	ds 1
 
 Channels::
-Channel1:: ; c101
-	channel_struct Channel1
-Channel2:: ; c133
-	channel_struct Channel2
-Channel3:: ; c165
-	channel_struct Channel3
-Channel4:: ; c197
-	channel_struct Channel4
+Channel1:: channel_struct Channel1 ; c101
+Channel2:: channel_struct Channel2 ; c133
+Channel3:: channel_struct Channel3 ; c165
+Channel4:: channel_struct Channel4 ; c197
 
 SFXChannels::
-Channel5:: ; c1c9
-	channel_struct Channel5
-Channel6:: ; c1fb
-	channel_struct Channel6
-Channel7:: ; c22d
-	channel_struct Channel7
-Channel8:: ; c25f
-	channel_struct Channel8
+Channel5:: channel_struct Channel5 ; c1c9
+Channel6:: channel_struct Channel6 ; c1fb
+Channel7:: channel_struct Channel7 ; c22d
+Channel8:: channel_struct Channel8 ; c25f
 
-; c291
-	ds 1
-; c292
-	ds 1
-; c293
-	ds 1
-; c294
-	ds 1
-; c295
-	ds 1
-; c296
-	ds 1
-; c297
-	ds 1
+	ds 1 ; c291
+	ds 1 ; c292
+	ds 1 ; c293
+	ds 1 ; c294
+	ds 1 ; c295
+	ds 1 ; c296
+	ds 1 ; c297
 
 CurMusicByte:: ; c298
 	ds 1
@@ -430,119 +312,31 @@
 ;		bit 4: pal # (non-cgb)
 ;		bit 3: vram bank (cgb only)
 ;		bit 2-0: pal # (cgb only)
-	ds 160
+	ds 4 * 40
 SpritesEnd::
 
 TileMap:: ; c4a0
 ; 20x18 grid of 8x8 tiles
-	ds 360
+	ds SCREEN_WIDTH * SCREEN_HEIGHT
 TileMapEnd::
 
-SECTION "BattleMons",WRAM0[$c608]
 
-EnemyMoveStruct::
-EnemyMoveAnimation:: ; c608
-	ds 1
-EnemyMoveEffect:: ; c609
-	ds 1
-EnemyMovePower:: ; c60a
-	ds 1
-EnemyMoveType:: ; c60b
-	ds 1
-EnemyMoveAccuracy:: ; c60c
-	ds 1
-EnemyMovePP:: ; c60d
-	ds 1
-EnemyMoveEffectChance:: ; c60e
-	ds 1
+wBattle::
 
-PlayerMoveStruct::
-PlayerMoveAnimation:: ; c60f
-	ds 1
-PlayerMoveEffect:: ; c610
-	ds 1
-PlayerMovePower:: ; c611
-	ds 1
-PlayerMoveType:: ; c612
-	ds 1
-PlayerMoveAccuracy:: ; c613
-	ds 1
-PlayerMovePP:: ; c614
-	ds 1
-PlayerMoveEffectChance:: ; c615
-	ds 1
+wEnemyMoveStruct::  ds MOVE_LENGTH ; c608
+wPlayerMoveStruct:: ds MOVE_LENGTH ; c60f
 
-EnemyMonNick:: ; c616
-	ds 11
-BattleMonNick:: ; c621
-	ds 11
+EnemyMonNick::  ds PKMN_NAME_LENGTH ; c616
+BattleMonNick:: ds PKMN_NAME_LENGTH ; c621
 
-
-BattleMonSpecies:: ; c62c
-	ds 1
-BattleMonItem:: ; c62d
-	ds 1
-
-BattleMonMoves::
-BattleMonMove1:: ; c62e
-	ds 1
-BattleMonMove2:: ; c62f
-	ds 1
-BattleMonMove3:: ; c630
-	ds 1
-BattleMonMove4:: ; c631
-	ds 1
-
-BattleMonDVs::
-BattleMonAtkDefDV:: ; c632
-	ds 1
-BattleMonSpdSpclDV:: ; c633
-	ds 1
-
-BattleMonPP::
-BattleMonPPMove1:: ; c634
-	ds 1
-BattleMonPPMove2:: ; c635
-	ds 1
-BattleMonPPMove3:: ; c636
-	ds 1
-BattleMonPPMove4:: ; c637
-	ds 1
-
-BattleMonHappiness:: ; c638
-	ds 1
-BattleMonLevel:: ; c639
-	ds 1
-
-BattleMonStatus:: ; c63a
-	ds 2
-
-BattleMonHP:: ; c63c
-	ds 2
-BattleMonMaxHP:: ; c63e
-	ds 2
-
-BattleMonAtk:: ; c640
-	ds 2
-BattleMonDef:: ; c642
-	ds 2
-BattleMonSpd:: ; c644
-	ds 2
-BattleMonSpclAtk:: ; c646
-	ds 2
-BattleMonSpclDef:: ; c648
-	ds 2
-
-BattleMonType1:: ; c64a
-	ds 1
-BattleMonType2:: ; c64b
-	ds 1
-
+BattleMon:: battle_struct BattleMon ; c62c
 	ds 10
 
 OTName:: ; c656
-	ds 13
+	ds NAME_LENGTH
 
+	ds 2
+
 CurOTMon:: ; c663
 	ds 1
 	
@@ -552,7 +346,6 @@
 ; >10: super-effective
 ;  10: normal
 ; <10: not very effective
-
 ; bit 7: stab
 	ds 1
 
@@ -640,6 +433,7 @@
 	ds 1
 PlayerConfuseCount:: ; c673
 	ds 1
+PlayerToxicCount:: ; c674
 	ds 1
 PlayerDisableCount:: ; c675
 	ds 1
@@ -656,6 +450,7 @@
 	ds 1
 EnemyConfuseCount:: ; c67b
 	ds 1
+EnemyToxicCount:: ; c67c
 	ds 1
 EnemyDisableCount:: ; c67d
 	ds 1
@@ -736,8 +531,15 @@
 PlayerTurnsTaken:: ; c6dd
 	ds 1
 
-	ds 5
+	ds 1
 
+PlayerSubstituteHP:: ; c6df
+	ds 1
+EnemySubstituteHP:: ; c6e0
+	ds 1
+
+	ds 2
+
 CurPlayerMove:: ; c6e3
 	ds 1
 CurEnemyMove:: ; c6e4
@@ -752,8 +554,12 @@
 CurEnemyMoveNum:: ; c6e9
 	ds 1
 
-	ds 10
+	ds 2
 
+wPayDayMoney:: ds 3 ; c6ec
+
+	ds 5
+
 AlreadyDisobeyed:: ; c6f4
 	ds 1
 
@@ -788,15 +594,17 @@
 ; see PlayerScreens
 	ds 1
 
+PlayerSafeguardCount:: ; c701
 	ds 1
-
 PlayerLightScreenCount:: ; c702
 	ds 1
 PlayerReflectCount:: ; c703
 	ds 1
 
-	ds 2
+	ds 1
 
+EnemySafeguardCount:: ; c705
+	ds 1
 EnemyLightScreenCount:: ; c706
 	ds 1
 EnemyReflectCount:: ; c707
@@ -825,8 +633,11 @@
 FailedMessage:: ; c70e
 	ds 1
 
-	ds 3
+	ds 1
 
+wPlayerIsSwitching:: ds 1 ; c710
+wEnemyIsSwitching::  ds 1 ; c711
+
 PlayerUsedMoves:: ; c712
 ; add a move that has been used once by the player
 ; added in order of use
@@ -839,11 +650,14 @@
 LastEnemyMove:: ; c71c
 	ds 1
 
+	ds 23
 
-SECTION "battle",WRAM0[$c734]
 BattleEnded:: ; c734
 	ds 1
 
+	ds 12
+wBattleEnd::
+; c741
 
 SECTION "overworldmap",WRAM0[$c800]
 OverworldMap:: ; c800
@@ -881,7 +695,8 @@
 ; read horizontally from the top row
 ; bit 3: vram bank
 ; bit 0-2: palette id
-	ds 360
+	ds SCREEN_WIDTH * SCREEN_HEIGHT
+AttrMapEnd::
 
 	ds 30
 	
@@ -1083,71 +898,7 @@
 	ds 4
 
 TempMon::
-TempMonSpecies:: ; d10e
-	ds 1
-TempMonItem:: ; d10f
-	ds 1
-TempMonMoves:: ; d110
-TempMonMove1:: ; d110
-	ds 1
-TempMonMove2:: ; d111
-	ds 1
-TempMonMove3:: ; d112
-	ds 1
-TempMonMove4:: ; d113
-	ds 1
-TempMonID:: ; d114
-	ds 2
-TempMonExp:: ; d116
-	ds 3
-TempMonHPExp:: ; d119
-	ds 2
-TempMonAtkExp:: ; d11b
-	ds 2
-TempMonDefExp:: ; d11d
-	ds 2
-TempMonSpdExp:: ; d11f
-	ds 2
-TempMonSpclExp:: ; d121
-	ds 2
-TempMonDVs:: ; d123
-; hp = %1000 for each dv
-	ds 1 ; atk/def
-	ds 1 ; spd/spc
-TempMonPP:: ; d125
-	ds 4
-TempMonHappiness:: ; d129
-	ds 1
-TempMonPokerusStatus:: ; d12a
-	ds 1
-TempMonCaughtData:: ; d12b
-TempMonCaughtTime:: ; d12b
-TempMonCaughtLevel:: ; d12b
-	ds 1
-TempMonCaughtGender:: ; d12c
-TempMonCaughtLocation:: ; d12c
-	ds 1
-TempMonLevel:: ; d12d
-	ds 1
-TempMonStatus:: ; d12e
-	ds 1
-; d12f
-	ds 1
-TempMonHP:: ; d130
-	ds 2
-TempMonMaxHP:: ; d132
-	ds 2
-TempMonAtk:: ; d134
-	ds 2
-TempMonDef:: ; d136
-	ds 2
-TempMonSpd:: ; d138
-	ds 2
-TempMonSpclAtk:: ; d13a
-	ds 2
-TempMonSpclDef:: ; d13c
-	ds 2
-TempMonEnd:: ; d13e
+	party_struct TempMon
 
 	ds 3
 
@@ -1290,7 +1041,7 @@
 	ds 2
 
 EvolvableFlags:: ; d1e8
-	ds 1
+	flag_array PARTY_LENGTH
 
 	ds 1
 
@@ -1305,90 +1056,13 @@
 LinkBattleRNs:: ; d1fa
 	ds 10
 
-TempEnemyMonSpecies:: ; d204
-	ds 1
-TempBattleMonSpecies:: ; d205
-	ds 1
+TempEnemyMonSpecies::  ds 1 ; d204
+TempBattleMonSpecies:: ds 1 ; d205
 
-EnemyMon::
-EnemyMonSpecies:: ; d206
-	ds 1
-EnemyMonItem:: ; d207
-	ds 1
-
-EnemyMonMoves::
-EnemyMonMove1:: ; d208
-	ds 1
-EnemyMonMove2:: ; d209
-	ds 1
-EnemyMonMove3:: ; d20a
-	ds 1
-EnemyMonMove4:: ; d20b
-	ds 1
-EnemyMonMovesEnd::
-
-EnemyMonDVs::
-EnemyMonAtkDefDV:: ; d20c
-	ds 1
-EnemyMonSpdSpclDV:: ; d20d
-	ds 1
-	
-EnemyMonPP::
-EnemyMonPPMove1:: ; d20e
-	ds 1
-EnemyMonPPMove2:: ; d20f
-	ds 1
-EnemyMonPPMove3:: ; d210
-	ds 1
-EnemyMonPPMove4:: ; d211
-	ds 1
-	
-EnemyMonHappiness:: ; d212
-	ds 1
-EnemyMonLevel:: ; d213
-	ds 1
-	
-EnemyMonStatus:: ; d214
-	ds 2
-
-EnemyMonHP::
-EnemyMonHPHi:: ; d216
-	ds 1
-EnemyMonHPLo:: ; d217
-	ds 1
-
-EnemyMonMaxHP::
-EnemyMonMaxHPHi:: ; d218
-	ds 1
-EnemyMonMaxHPLo:: ; d219
-	ds 1
-
-EnemyMonStats::
-EnemyMonAtk:: ; d21a
-	ds 2
-EnemyMonDef:: ; d21c
-	ds 2
-EnemyMonSpd:: ; d21e
-	ds 2
-EnemyMonSpclAtk:: ; d220
-	ds 2
-EnemyMonSpclDef:: ; d222
-	ds 2
-EnemyMonStatsEnd::
-
-EnemyMonType1:: ; d224
-	ds 1
-EnemyMonType2:: ; d225
-	ds 1
-
-EnemyMonBaseStats:: ; d226
-	ds 5
-
-EnemyMonCatchRate:: ; d22b
-	ds 1
-EnemyMonBaseExp:: ; d22c
-	ds 1
-
+EnemyMon:: battle_struct EnemyMon ; d206
+EnemyMonBaseStats:: ds 5 ; d226
+EnemyMonCatchRate:: db ; d22b
+EnemyMonBaseExp::   db ; d22c
 EnemyMonEnd::
 
 
@@ -1492,59 +1166,31 @@
 TimeOfDay:: ; d269
 	ds 1
 
+
 SECTION "OTParty",WRAMX[$d280],BANK[1]
 
-OTPartyCount:: ; d280
-	ds 1 ; number of Pokémon in party
-OTPartySpecies:: ; d281
-	ds 6 ; species of each Pokémon in party
-; d287
-	ds 1 ; any empty slots including the 7th must be FF
-	     ; or the routine will keep going
+OTPartyCount::   ds 1 ; d280
+OTPartySpecies:: ds PARTY_LENGTH ; d281
+OTPartyEnd::     ds 1
 
-OTPartyMon1:: ; d288
-	party_struct OTPartyMon1
-OTPartyMon2:: ; d2b8
-	party_struct OTPartyMon2
-OTPartyMon3:: ; d2e8
-	party_struct OTPartyMon3
-OTPartyMon4:: ; d318
-	party_struct OTPartyMon4
-OTPartyMon5:: ; d348
-	party_struct OTPartyMon5
-OTPartyMon6:: ; d378
-	party_struct OTPartyMon6
+OTPartyMons::
+OTPartyMon1:: party_struct OTPartyMon1 ; d288
+OTPartyMon2:: party_struct OTPartyMon2 ; d2b8
+OTPartyMon3:: party_struct OTPartyMon3 ; d2e8
+OTPartyMon4:: party_struct OTPartyMon4 ; d318
+OTPartyMon5:: party_struct OTPartyMon5 ; d348
+OTPartyMon6:: party_struct OTPartyMon6 ; d378
+OTPartyMonsEnd::
 
+OTPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d3a8
+OTPartyMonNicknames:: ds PKMN_NAME_LENGTH * PARTY_LENGTH ; d3ea
 
-OTPartyMonOT::
-OTPartyMon1OT:: ; d3a8
-	ds 11
-OTPartyMon2OT:: ; d3b3
-	ds 11
-OTPartyMon3OT:: ; d3be
-	ds 11
-OTPartyMon4OT:: ; d3c9
-	ds 11
-OTPartyMon5OT:: ; d3d4
-	ds 11
-OTPartyMon6OT:: ; d3df
-	ds 11
+	ds 4
 
-OTPartyMonNicknames::
-OTPartyMon1Nickname:: ; d3ea
-	ds 11
-OTPartyMon2Nickname:: ; d3f5
-	ds 11
-OTPartyMon3Nickname:: ; d400
-	ds 11
-OTPartyMon4Nickname:: ; d40b
-	ds 11
-OTPartyMon5Nickname:: ; d416
-	ds 11
-OTPartyMon6Nickname:: ; d421
-	ds 11
+wBattleAction:: ds 1 ; d430
 
-SECTION "Map Events", WRAMX[$d432], BANK[1]
+	ds 1
+
 MapStatus:: ; d432
 	ds 1
 MapEventStatus:: ; d433
@@ -1581,16 +1227,11 @@
 PlayerID:: ; d47b
 	ds 2
 
-PlayerName:: ; d47d
-	ds 11
-MomsName:: ; d488
-	ds 11
-RivalName:: ; d493
-	ds 11
-RedsName:: ; d49e
-	ds 11
-GreensName:: ; d4a9
-	ds 11
+PlayerName:: ds NAME_LENGTH ; d47d
+MomsName::   ds NAME_LENGTH ; d488
+RivalName::  ds NAME_LENGTH ; d493
+RedsName::   ds NAME_LENGTH ; d49e
+GreensName:: ds NAME_LENGTH ; d4a9
 
 	ds 2
 
@@ -1729,7 +1370,10 @@
 Money:: ; d84e
 	ds 3
 
-	ds 4
+wMomsMoney:: ; d851
+	ds 3
+wMomSavingMoney:: ; d854
+	ds 1
 
 Coins:: ; d855
 	ds 2
@@ -1736,9 +1380,9 @@
 	
 Badges::
 JohtoBadges:: ; d857
-	ds 1
+	flag_array 8
 KantoBadges:: ; d858
-	ds 1
+	flag_array 8
 	
 SECTION "Items",WRAMX[$d859],BANK[1]
 TMsHMs:: ; d859
@@ -1876,7 +1520,7 @@
 ;PoliceAtElmsLabEvent:: ; db52
 ;SalesmanMahoganyTownEvent:: ; db5c
 ;RedGyaradosEvent:: ; db5c
-	ds 250
+	flag_array 2000
 ; db6c
 
 SECTION "Boxes",WRAMX[$db72],BANK[1]
@@ -1887,35 +1531,7 @@
 	ds 2
 
 ; 8 chars + $50
-wBoxNames::
-Box1Name:: ; db75
-	ds 9
-Box2Name:: ; db7e
-	ds 9
-Box3Name:: ; db87
-	ds 9
-Box4Name:: ; db90
-	ds 9
-Box5Name:: ; db99
-	ds 9
-Box6Name:: ; dba2
-	ds 9
-Box7Name:: ; dbab
-	ds 9
-Box8Name:: ; dbb4
-	ds 9
-Box9Name:: ; dbbd
-	ds 9
-Box10Name:: ; dbc6
-	ds 9
-Box11Name:: ; dbcf
-	ds 9
-Box12Name:: ; dbd8
-	ds 9
-Box13Name:: ; dbe1
-	ds 9
-Box14Name:: ; dbea
-	ds 9
+wBoxNames:: ds 9 * NUM_BOXES ; db75
 
 SECTION "bike", WRAMX[$dbf5],BANK[1]
 BikeFlags:: ; dbf5
@@ -1954,7 +1570,7 @@
 
 SECTION "Visited Spawn Points", WRAMX[$dca5],BANK[1]
 VisitedSpawns:: ; dca5
-	ds 4
+	flag_array 27
 
 SECTION "BackupMapInfo", WRAMX[$dcad],BANK[1]
 
@@ -1983,67 +1599,42 @@
 PartyCount:: ; dcd7
 	ds 1 ; number of Pokémon in party
 PartySpecies:: ; dcd8
-	ds 6 ; species of each Pokémon in party
+	ds PARTY_LENGTH ; species of each Pokémon in party
 PartyEnd:: ; dcde
 	ds 1 ; legacy functions don't check PartyCount
 		 
 PartyMons::
-PartyMon1:: ; dcdf
-	party_struct PartyMon1
-PartyMon2:: ; dd0f
-	party_struct PartyMon2
-PartyMon3:: ; dd3f
-	party_struct PartyMon3
-PartyMon4:: ; dd6f
-	party_struct PartyMon4
-PartyMon5:: ; dd9f
-	party_struct PartyMon5
-PartyMon6:: ; ddcf
-	party_struct PartyMon6
+PartyMon1:: party_struct PartyMon1 ; dcdf
+PartyMon2:: party_struct PartyMon2 ; dd0f
+PartyMon3:: party_struct PartyMon3 ; dd3f
+PartyMon4:: party_struct PartyMon4 ; dd6f
+PartyMon5:: party_struct PartyMon5 ; dd9f
+PartyMon6:: party_struct PartyMon6 ; ddcf
 
-PartyMonOT::
-PartyMon1OT:: ; ddff
-	ds 11
-PartyMon2OT:: ; de0a
-	ds 11
-PartyMon3OT:: ; de15
-	ds 11
-PartyMon4OT:: ; de20
-	ds 11
-PartyMon5OT:: ; de2b
-	ds 11
-PartyMon6OT:: ; de36
-	ds 11
+PartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; ddff
 
-PartyMonNicknames::
-PartyMon1Nickname:: ; de41
-	ds 11
-PartyMon2Nickname:: ; de4c
-	ds 11
-PartyMon3Nickname:: ; de57
-	ds 11
-PartyMon4Nickname:: ; de62
-	ds 11
-PartyMon5Nickname:: ; de6d
-	ds 11
-PartyMon6Nickname:: ; de78
-	ds 11
+PartyMonNicknames:: ds PKMN_NAME_LENGTH * PARTY_LENGTH ; de41
 PartyMonNicknamesEnd::
 
-SECTION "Pokedex",WRAMX[$de99],BANK[1]
+
+SECTION "Pokedex", WRAMX[$de99], BANK[1]
+
 PokedexCaught:: ; de99
-	ds 32
+	flag_array NUM_POKEMON
 EndPokedexCaught::
+
 PokedexSeen:: ; deb9
-	ds 32
+	flag_array NUM_POKEMON
 EndPokedexSeen::
+
 UnownDex:: ; ded9
 	ds 26
 UnlockedUnowns:: ; def3
 	ds 1
 
-SECTION "Breeding",WRAMX[$def5],BANK[1]
-DaycareMan:: ; def5
+	ds 1
+
+wDaycareMan:: ; def5
 ; bit 7: active
 ; bit 6: monsters are compatible
 ; bit 5: egg ready
@@ -2050,116 +1641,69 @@
 ; bit 0: monster 1 in daycare
 	ds 1
 
-BreedMon1::
-BreedMon1Nick:: ; def6
-	ds 11
-BreedMon1OT:: ; df01
-	ds 11
-BreedMon1Stats::
-BreedMon1Species:: ; df0c
-	ds 1
-	ds 31
+wBreedMon1::
+wBreedMon1Nick::  ds PKMN_NAME_LENGTH ; def6
+wBreedMon1OT::    ds NAME_LENGTH ; df01
+wBreedMon1Stats:: box_struct wBreedMon1 ; df0c
 
-DaycareLady:: ; df2c
+wDaycareLady:: ; df2c
 ; bit 7: active
 ; bit 0: monster 2 in daycare
 	ds 1
 
-StepsToEgg:: ; df2d
+wStepsToEgg:: ; df2d
 	ds 1
-DittoInDaycare:: ; df2e
+wDittoInDaycare:: ; df2e
 ;  z: yes
 ; nz: no
 	ds 1
 
-BreedMon2::
-BreedMon2Nick:: ; df2f
-	ds 11
-BreedMon2OT:: ; df3a
-	ds 11
-BreedMon2Stats::
-BreedMon2Species:: ; df45
-	ds 1
-	ds 31
+wBreedMon2::
+wBreedMon2Nick::  ds PKMN_NAME_LENGTH ; df2f
+wBreedMon2OT::    ds NAME_LENGTH ; df3a
+wBreedMon2Stats:: box_struct wBreedMon2 ; df45
 
-EggNick:: ; df65
-; EGG@
-	ds 11
-EggOT:: ; df70
-	ds 11
-EggStats::
-EggSpecies:: ; df7b
-	ds 1
-	ds 31
+wEggNick:: ds PKMN_NAME_LENGTH ; df65
+wEggOT::   ds NAME_LENGTH ; df70
+wEggMon::  box_struct wEggMon ; df7b
 
 	ds 1
 
-wContestMon:: ; df9c
-	party_struct wContestMon
+wContestMon:: party_struct wContestMon ; df9c
 
 	ds 3
 
-RoamMon1Species:: ; dfcf
-	ds 1
-RoamMon1Level:: ; dfd0
-	ds 1
-RoamMon1MapGroup:: ; dfd1
-	ds 1
-RoamMon1MapNumber:: ; dfd2
-	ds 1
-RoamMon1HP:: ; dfd3
-	ds 1
-RoamMon1DVs:: ; dfd4
-	ds 2
+roam_struct: MACRO
+\1Species::   db
+\1Level::     db
+\1MapGroup::  db
+\1MapNumber:: db
+\1HP::        ds 1
+\1DVs::       ds 2
+ENDM
 
-RoamMon2Species:: ; dfd6
-	ds 1
-RoamMon2Level:: ; dfd7
-	ds 1
-RoamMon2MapGroup:: ; dfd8
-	ds 1
-RoamMon2MapNumber:: ; dfd9
-	ds 1
-RoamMon2HP:: ; dfda
-	ds 1
-RoamMon2DVs:: ; dfdb
-	ds 2
+wRoamMon1:: roam_struct wRoamMon1 ; dfcf
+wRoamMon2:: roam_struct wRoamMon2 ; dfd6
+wRoamMon3:: roam_struct wRoamMon3 ; dfdd
 
-RoamMon3Species:: ; dfdd
-	ds 1
-RoamMon3Level:: ; dfde
-	ds 1
-RoamMon3MapGroup:: ; dfdf
-	ds 1
-RoamMon3MapNumber:: ; dfe0
-	ds 1
-RoamMon3HP:: ; dfe1
-	ds 1
-RoamMon3DVs:: ; dfe2
-	ds 2
 
 
-
 SECTION "WRAMBank5",WRAMX[$d000],BANK[5]
 
 ; 8 4-color palettes
-Unkn1Pals:: ; d000
-	ds $40
-Unkn2Pals:: ; d040
-	ds $40
-BGPals:: ; d080
-	ds $40
-OBPals:: ; d0c0
-	ds $40
+Unkn1Pals:: ds 8 * 8 ; d000
+Unkn2Pals:: ds 8 * 8 ; d040
+BGPals::    ds 8 * 8 ; d080
+OBPals::    ds 8 * 8 ; d0c0
 
 LYOverrides:: ; d100
-	ds 144
+	ds SCREEN_HEIGHT_PX
 LYOverridesEnd::
 
 	ds 112
 
 LYOverridesBackup:: ; d200
-	ds 144
+	ds SCREEN_HEIGHT_PX
 LYOverridesBackupEnd::
 
 
@@ -2194,175 +1738,24 @@
 	ds 8
 
 
-SECTION "SRAMBank1",SRAM,BANK[1]
+SECTION "Scratch", SRAM, BANK[0]
 
-SECTION "BoxMons",SRAM[$ad10],BANK[1]
-BoxCount:: ; ad10
-	ds 1
-BoxSpecies:: ; ad11
-	ds 20
-	ds 1
-BoxMons::
-BoxMon1::
-BoxMon1Species:: ; ad26
-	ds 1
-BoxMon1Item:: ; ad27
-	ds 1
-BoxMon1Moves:: ; ad28
-	ds 4
-BoxMon1ID:: ; ad2c
-	ds 2
-BoxMon1Exp:: ; ad2e
-	ds 3
-BoxMon1HPExp:: ; ad31
-	ds 2
-BoxMon1AtkExp:: ; ad33
-	ds 2
-BoxMon1DefExp:: ; ad35
-	ds 2
-BoxMon1SpdExp:: ; ad37
-	ds 2
-BoxMon1SpcExp:: ; ad39
-	ds 2
-BoxMon1DVs:: ; ad3b
-	ds 2
-BoxMon1PP:: ; ad3d
-	ds 4
-BoxMon1Happiness:: ; ad41
-	ds 1
-BoxMon1PokerusStatus:: ; ad42
-	ds 1
-BoxMon1CaughtData::
-BoxMon1CaughtTime::
-BoxMon1CaughtLevel:: ; ad43
-	ds 1
-BoxMon1CaughtGender::
-BoxMon1CaughtLocation:: ; ad44
-	ds 1
-BoxMon1Level:: ; ad45
-	ds 1
 
-BoxMon2:: ; ad46
-	ds 32
-BoxMon3:: ; ad66
-	ds 32
-BoxMon4:: ; ad86
-	ds 32
-BoxMon5:: ; ada6
-	ds 32
-BoxMon6:: ; adc6
-	ds 32
-BoxMon7:: ; ade6
-	ds 32
-BoxMon8:: ; ae06
-	ds 32
-BoxMon9:: ; ae26
-	ds 32
-BoxMon10:: ; ae46
-	ds 32
-BoxMon11:: ; ae66
-	ds 32
-BoxMon12:: ; ae86
-	ds 32
-BoxMon13:: ; aea6
-	ds 32
-BoxMon14:: ; aec6
-	ds 32
-BoxMon15:: ; aee6
-	ds 32
-BoxMon16:: ; af06
-	ds 32
-BoxMon17:: ; af26
-	ds 32
-BoxMon18:: ; af46
-	ds 32
-BoxMon19:: ; af66
-	ds 32
-BoxMon20:: ; af86
-	ds 32
+SECTION "SRAM Bank 1", SRAM, BANK[1]
 
-BoxMonOT::
-BoxMon1OT:: ; afa6
-	ds 11
-BoxMon2OT:: ; afb1
-	ds 11
-BoxMon3OT:: ; afbc
-	ds 11
-BoxMon4OT:: ; afc7
-	ds 11
-BoxMon5OT:: ; afd2
-	ds 11
-BoxMon6OT:: ; afdd
-	ds 11
-BoxMon7OT:: ; afe8
-	ds 11
-BoxMon8OT:: ; aff3
-	ds 11
-BoxMon9OT:: ; affe
-	ds 11
-BoxMon10OT:: ; b009
-	ds 11
-BoxMon11OT:: ; b014
-	ds 11
-BoxMon12OT:: ; b01f
-	ds 11
-BoxMon13OT:: ; b02a
-	ds 11
-BoxMon14OT:: ; b035
-	ds 11
-BoxMon15OT:: ; b040
-	ds 11
-BoxMon16OT:: ; b04b
-	ds 11
-BoxMon17OT:: ; b056
-	ds 11
-BoxMon18OT:: ; b061
-	ds 11
-BoxMon19OT:: ; b06c
-	ds 11
-BoxMon20OT:: ; b077
-	ds 11
+SECTION "BoxMons", SRAM[$ad10], BANK[1]
 
-BoxMonNicknames::
-BoxMon1Nickname:: ; b082
-	ds 11
-BoxMon2Nickname:: ; b08d
-	ds 11
-BoxMon3Nickname:: ; b098
-	ds 11
-BoxMon4Nickname:: ; b0a3
-	ds 11
-BoxMon5Nickname:: ; b0ae
-	ds 11
-BoxMon6Nickname:: ; b0b9
-	ds 11
-BoxMon7Nickname:: ; b0c4
-	ds 11
-BoxMon8Nickname:: ; b0cf
-	ds 11
-BoxMon9Nickname:: ; b0da
-	ds 11
-BoxMon10Nickname:: ; b0e5
-	ds 11
-BoxMon11Nickname:: ; b0f0
-	ds 11
-BoxMon12Nickname:: ; b0fb
-	ds 11
-BoxMon13Nickname:: ; b106
-	ds 11
-BoxMon14Nickname:: ; b111
-	ds 11
-BoxMon15Nickname:: ; b11c
-	ds 11
-BoxMon16Nickname:: ; b127
-	ds 11
-BoxMon17Nickname:: ; b132
-	ds 11
-BoxMon18Nickname:: ; b13d
-	ds 11
-BoxMon19Nickname:: ; b148
-	ds 11
-BoxMon20Nickname:: ; b153
-	ds 11
-BoxMonNicknamesEnd::
+sBoxCount::   ds 1 ; ad10
+sBoxSpecies:: ds MONS_PER_BOX ; ad11
+	ds 1
 
+sBoxMons:: ; ad26
+sBoxMon1:: box_struct sBoxMon1
+sBoxMon2::
+	ds box_struct_length * (MONS_PER_BOX +- 1)
+
+sBoxMonOT:: ds NAME_LENGTH * MONS_PER_BOX ; afa6
+
+sBoxMonNicknames:: ds PKMN_NAME_LENGTH * MONS_PER_BOX ; b082
+sBoxMonNicknamesEnd::
+; b15e
--