shithub: pokecrystal

Download patch

ref: 93916b5536e028d7a50b9b65618aba25be3e8006
parent: 9f017cbab8e6856680c35278829c6388e9fdf697
parent: 2a7ba6685afac73b824f611bbff228ff73cc51da
author: yenatch <yenatch@gmail.com>
date: Sat Dec 30 16:12:53 EST 2017

Merge pull request #449 from xCrystal/master

Misc labeling and cleaning up

--- a/audio/engine.asm
+++ b/audio/engine.asm
@@ -829,7 +829,7 @@
 	ld hl, Channel1PitchWheelAmountFraction - Channel1
 	add hl, bc
 	ld [hl], a ; remainder
-	ld hl, Channel1Field0x25 - Channel1
+	ld hl, Channel1Field25 - Channel1
 	add hl, bc
 	xor a
 	ld [hl], a
@@ -981,12 +981,12 @@
 	add hl, de
 	ld d, h
 	ld e, l
-	; [Channel*Field0x25] += [Channel*PitchWheelAmountFraction]
+	; [Channel*Field25] += [Channel*PitchWheelAmountFraction]
 	; if rollover: Frequency += 1
 	ld hl, Channel1PitchWheelAmountFraction - Channel1
 	add hl, bc
 	ld a, [hl]
-	ld hl, Channel1Field0x25 - Channel1
+	ld hl, Channel1Field25 - Channel1
 	add hl, bc
 	add [hl]
 	ld [hl], a
@@ -1023,7 +1023,7 @@
 	ld a, d
 	sbc 0
 	ld d, a
-	; [Channel*Field0x25] *= 2
+	; [Channel*Field25] *= 2
 	; if rollover: Frequency -= 1
 	ld hl, Channel1PitchWheelAmountFraction - Channel1
 	add hl, bc
@@ -1726,7 +1726,7 @@
 ; seems to have been dummied out
 ; params: 1
 	call GetMusicByte
-	ld hl, Channel1Field0x2c - Channel1
+	ld hl, Channel1Field2c - Channel1
 	add hl, bc
 	ld [hl], a
 	ld hl, Channel1Flags2 - Channel1
@@ -1849,7 +1849,7 @@
 	add hl, bc
 	set SOUND_UNKN_0E, [hl]
 	call GetMusicByte
-	ld hl, Channel1Field0x29 - Channel1
+	ld hl, Channel1Field29 - Channel1
 	add hl, bc
 	ld [hl], a
 	ret
@@ -1885,7 +1885,7 @@
 	add hl, bc
 	set SOUND_UNKN_0D, [hl]
 	call GetMusicByte
-	ld hl, Channel1Field0x2a - Channel1
+	ld hl, Channel1Field2a - Channel1
 	add hl, bc
 	ld [hl], a
 	ret
@@ -2307,7 +2307,7 @@
 	inc hl
 	ld d, [hl]
 	; add ???? to the next result
-	ld hl, Channel1Field0x16 - Channel1
+	ld hl, Channel1Field16 - Channel1
 	add hl, bc
 	ld l, [hl]
 	; multiply Tempo by last result (NoteLength * LOW(delay))
@@ -2316,7 +2316,7 @@
 	ld e, l
 	ld d, h
 	; store result in ????
-	ld hl, Channel1Field0x16 - Channel1
+	ld hl, Channel1Field16 - Channel1
 	add hl, bc
 	ld [hl], e
 	; store result in NoteDuration
@@ -2392,7 +2392,7 @@
 	ld [hl], d
 	; clear ????
 	xor a
-	ld hl, Channel1Field0x16 - Channel1
+	ld hl, Channel1Field16 - Channel1
 	add hl, bc
 	ld [hl], a
 	ret
@@ -2749,7 +2749,7 @@
 	add hl, bc
 	ld [hl], a
 
-	ld hl, Channel1Field0x30 - Channel1 ; $c131 - Channel1
+	ld hl, Channel1Field30 - Channel1 ; $c131 - Channel1
 	add hl, bc
 	ld [hl], a
 
@@ -2760,11 +2760,11 @@
 ; ch3-4
 	ld a, [wSFXDuration]
 
-	ld hl, Channel1Field0x2e - Channel1 ; $c12f - Channel1
+	ld hl, Channel1Field2e - Channel1 ; $c12f - Channel1
 	add hl, bc
 	ld [hl], a
 
-	ld hl, Channel1Field0x2f - Channel1 ; $c130 - Channel1
+	ld hl, Channel1Field2f - Channel1 ; $c130 - Channel1
 	add hl, bc
 	ld [hl], a
 
--- a/constants/battle_anim_constants.asm
+++ b/constants/battle_anim_constants.asm
@@ -708,7 +708,7 @@
 	const BATTLEANIMOAMSET_D7
 
 ; BattleBGEffects indexes (see engine/battle_anims/bg_effects.asm)
-const_value SET 1
+const_value set 1
 	const ANIM_BG_FLASH_INVERTED
 	const ANIM_BG_FLASH_WHITE
 	const ANIM_BG_WHITE_HUES
@@ -764,7 +764,7 @@
 	const ANIM_BG_35
 
 ; AnimObjGFX indexes (see data/battle_anims/object_gfx.asm)
-const_value SET 1
+const_value set 1
 	const ANIM_GFX_HIT
 	const ANIM_GFX_CUT
 	const ANIM_GFX_FIRE
--- a/constants/battle_constants.asm
+++ b/constants/battle_constants.asm
@@ -45,7 +45,7 @@
 ; indexes for:
 ; - PlayerStats and EnemyStats (see wram.asm)
 ; - party_struct and battle_struct members (see macros/wram.asm)
-const_value SET 1
+const_value set 1
 	const STAT_HP
 	const STAT_ATK
 	const STAT_DEF
@@ -65,7 +65,7 @@
 SPDSPCDV_SHINY EQU $AA
 
 ; battle classes (wBattleMode values)
-const_value SET 1
+const_value set 1
 	const WILD_BATTLE
 	const TRAINER_BATTLE
 
@@ -140,7 +140,7 @@
 
 ; status condition bit flags
 SLP EQU %111 ; 0-7 turns
-const_value SET 3
+const_value set 3
 	const PSN
 	const BRN
 	const FRZ
--- a/constants/credits_constants.asm
+++ b/constants/credits_constants.asm
@@ -105,7 +105,7 @@
 	const PAAD_TESTING
 
 ; CreditsScript indexes (see data/credits_script.asm)
-const_value SET -7
+const_value set -7
 	const CREDITS_THEEND
 	const CREDITS_WAIT2
 	const CREDITS_MUSIC
--- a/constants/hardware_constants.asm
+++ b/constants/hardware_constants.asm
@@ -50,6 +50,7 @@
 OAM_Y_FLIP    EQU 6
 OAM_PRIORITY  EQU 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3)
 
+; BP Map attribute flags
 PALETTE_MASK EQU %111
 VRAM_BANK_1  EQU 1 << OAM_TILE_BANK ; $08
 OBP_NUM      EQU 1 << OAM_OBP_NUM   ; $10
@@ -57,6 +58,10 @@
 Y_FLIP       EQU 1 << OAM_Y_FLIP    ; $40
 BEHIND_BG    EQU 1 << OAM_PRIORITY  ; $80
 
+; Other useful constants
+LCDC_DEFAULT EQU %11100011
+LY_VBLANK EQU 144
+
 ; Hardware registers
 rJOYP       EQU $ff00 ; Joypad (R/W)
 rSB         EQU $ff01 ; Serial transfer data (R/W)
@@ -114,6 +119,10 @@
 rWave_e     EQU $ff3e
 rWave_f     EQU $ff3f
 rLCDC       EQU $ff40 ; LCD Control (R/W)
+rLCDC_SPRITES_ENABLE EQU 1 ; 0=Off, 1=On
+rLCDC_SPRITE_SIZE    EQU 2 ; 0=8x8, 1=8x16
+rLCDC_WINDOW_TILEMAP EQU 6 ; 0=9800-9BFF, 1=9C00-9FFF
+rLCDC_ENABLE         EQU 7 ; 0=Off, 1=On
 rSTAT       EQU $ff41 ; LCDC Status (R/W)
 rSCY        EQU $ff42 ; Scroll Y (R/W)
 rSCX        EQU $ff43 ; Scroll X (R/W)
--- a/constants/item_data_constants.asm
+++ b/constants/item_data_constants.asm
@@ -52,7 +52,7 @@
 	const HELD_7
 	const HELD_CLEANSE_TAG
 
-const_value SET 10
+const_value set 10
 	const HELD_HEAL_POISON
 	const HELD_HEAL_FREEZE
 	const HELD_HEAL_BURN
@@ -61,7 +61,7 @@
 	const HELD_HEAL_STATUS
 	const HELD_HEAL_CONFUSION
 
-const_value SET 20
+const_value set 20
 	const HELD_PREVENT_POISON
 	const HELD_PREVENT_BURN
 	const HELD_PREVENT_FREEZE
@@ -69,7 +69,7 @@
 	const HELD_PREVENT_PARALYZE
 	const HELD_PREVENT_CONFUSE
 
-const_value SET 30
+const_value set 30
 	const HELD_30
 	const HELD_ATTACK_UP
 	const HELD_DEFENSE_UP
@@ -80,12 +80,12 @@
 	const HELD_EVASION_UP
 	const HELD_38
 
-const_value SET 40
+const_value set 40
 	const HELD_40
 	const HELD_41
 	const HELD_METAL_POWDER
 
-const_value SET 50
+const_value set 50
 	const HELD_NORMAL_BOOST
 	const HELD_FIGHTING_BOOST
 	const HELD_FLYING_BOOST
@@ -104,7 +104,7 @@
 	const HELD_DARK_BOOST
 	const HELD_STEEL_BOOST
 
-const_value SET 70
+const_value set 70
 	const HELD_CATCH_CHANCE
 	const HELD_71
 	const HELD_ESCAPE
--- a/constants/map_data_constants.asm
+++ b/constants/map_data_constants.asm
@@ -17,7 +17,7 @@
 NUM_MAPHEADER_ATTRIBUTES EQU const_value
 
 ; map environments (wEnvironment)
-const_value SET 1
+const_value set 1
 	const TOWN
 	const ROUTE
 	const INDOOR
@@ -34,7 +34,7 @@
 	const PALETTE_MORN
 	const PALETTE_DARK
 
-; fish groups 
+; fish groups
 	const_def
 	const FISHGROUP_NONE
 	const FISHGROUP_SHORE
@@ -97,10 +97,10 @@
 	const OBJECT_SPRITE_X_OFFSET     ; 19
 	const OBJECT_SPRITE_Y_OFFSET     ; 1a
 	const OBJECT_MOVEMENT_BYTE_INDEX ; 1b
-	const OBJECT_28                  ; 1c
-	const OBJECT_29                  ; 1d
-	const OBJECT_30                  ; 1e
-	const OBJECT_31                  ; 1f
+	const OBJECT_1C                  ; 1c
+	const OBJECT_1D                  ; 1d
+	const OBJECT_1E                  ; 1e
+	const OBJECT_1F                  ; 1f
 	const OBJECT_RANGE               ; 20
 ; 33-39 are not used
 
@@ -217,7 +217,7 @@
 EMOTE_MEM EQU -1
 
 ; FruitTreeItems indexes (see data/items/fruit_trees.asm)
-const_value SET 1
+const_value set 1
 	const FRUITTREE_ROUTE_29      ; 01
 	const FRUITTREE_ROUTE_30_1    ; 02
 	const FRUITTREE_ROUTE_38      ; 03
--- a/constants/map_setup_constants.asm
+++ b/constants/map_setup_constants.asm
@@ -1,6 +1,6 @@
 ; hMapEntryMethod values
 ; MapSetupScripts indexes (see data/maps/setup_scripts.asm)
-const_value SET $f1
+const_value set $f1
 	const MAPSETUP_WARP       ; f1
 	const MAPSETUP_CONTINUE   ; f2
 	const MAPSETUP_RELOADMAP  ; f3
@@ -67,7 +67,7 @@
 map_end EQU -1
 
 ; callback types
-const_value SET 1
+const_value set 1
 	const MAPCALLBACK_TILES
 	const MAPCALLBACK_OBJECTS
 	const MAPCALLBACK_CMDQUEUE
--- a/constants/pokemon_data_constants.asm
+++ b/constants/pokemon_data_constants.asm
@@ -45,7 +45,7 @@
 	const SLOW
 
 ; BaseEggGroups values
-const_value SET 1
+const_value set 1
 	const MONSTER      ; 1
 	const AMPHIBIAN    ; 2
 	const INSECT       ; 3
@@ -103,7 +103,7 @@
 
 
 ; evolution types (used in data/pokemon/evos_attacks.asm)
-const_value SET 1
+const_value set 1
 	const EVOLVE_LEVEL
 	const EVOLVE_ITEM
 	const EVOLVE_TRADE
@@ -111,13 +111,13 @@
 	const EVOLVE_STAT
 
 ; EVOLVE_HAPPINESS triggers
-const_value SET 1
+const_value set 1
 	const TR_ANYTIME
 	const TR_MORNDAY
 	const TR_NITE
 
 ; EVOLVE_STAT triggers
-const_value SET 1
+const_value set 1
 	const ATK_GT_DEF
 	const ATK_LT_DEF
 	const ATK_EQ_DEF
@@ -162,7 +162,7 @@
 	const ANIM_MON_EGG2
 
 ; MonMenuOptions indexes (see engine/mon_menu.asm)
-const_value SET 1
+const_value set 1
 ; moves
 	const MONMENU_CUT        ; 1
 	const MONMENU_FLY        ; 2
--- a/constants/printer_constants.asm
+++ b/constants/printer_constants.asm
@@ -1,5 +1,5 @@
 ; wPrinterStatus
-const_value SET 1
+const_value set 1
 	const PRINTER_STATUS_CHECKING
 	const PRINTER_STATUS_TRANSMITTING
 	const PRINTER_STATUS_PRINTING
--- a/constants/script_constants.asm
+++ b/constants/script_constants.asm
@@ -39,7 +39,7 @@
 RETVAR_EXECUTE EQU (2 << 6)
 
 ; PlayerEventScriptPointers indexes (see engine/events.asm)
-const_value SET -1
+const_value set -1
 	const PLAYEREVENT_MAPSCRIPT
 	const PLAYEREVENT_NONE
 	const PLAYEREVENT_SEENBYTRAINER
--- a/constants/sprite_constants.asm
+++ b/constants/sprite_constants.asm
@@ -106,7 +106,7 @@
 	const SPRITE_STANDING_YOUNGSTER ; 66
 
 ; SpriteMons indexes (see data/sprite_mons.asm)
-const_value SET $80
+const_value set $80
 SPRITE_POKEMON EQU const_value
 	const SPRITE_UNOWN ; 80
 	const SPRITE_GEODUDE ; 81
@@ -145,12 +145,12 @@
 	const SPRITE_HO_OH ; a2
 
 ; special GetMonSprite values (see engine/overworld.asm)
-const_value SET $e0
+const_value set $e0
 	const SPRITE_DAY_CARE_MON_1 ; e0
 	const SPRITE_DAY_CARE_MON_2 ; e1
 
 ; VariableSprites indexes (see wram.asm)
-const_value SET $f0
+const_value set $f0
 SPRITE_VARS EQU const_value
 	const SPRITE_CONSOLE ; f0
 	const SPRITE_DOLL_1 ; f1
--- a/constants/sprite_data_constants.asm
+++ b/constants/sprite_data_constants.asm
@@ -9,7 +9,7 @@
 NUM_SPRITEDATA_FIELDS EQU const_value
 
 ; sprite types
-const_value SET 1
+const_value set 1
 	const WALKING_SPRITE  ; 1
 	const STANDING_SPRITE ; 2
 	const STILL_SPRITE    ; 3
--- a/constants/tileset_constants.asm
+++ b/constants/tileset_constants.asm
@@ -1,5 +1,5 @@
 ; Tilesets indexes (see tilesets/tilesets.asm)
-const_value SET 1
+const_value set 1
 	const TILESET_JOHTO_1              ; 01
 	const TILESET_JOHTO_2              ; 02
 	const TILESET_KANTO                ; 03
--- a/constants/wram_constants.asm
+++ b/constants/wram_constants.asm
@@ -7,7 +7,7 @@
 	const WILDMON    ; 4
 
 ; Options: (bits) ; cfcc
-const_value SET 4
+const_value set 4
 	const NO_TEXT_SCROLL ; 4
 	const STEREO         ; 5
 	const BATTLE_SHIFT   ; 6
@@ -41,7 +41,7 @@
 GBPRINTER_DARKEST  EQU $7f
 
 ; WalkingDirection: ; d043
-const_value SET -1
+const_value set -1
 	const STANDING ; -1
 	const DOWN     ; 0
 	const UP       ; 1
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -8395,11 +8395,11 @@
 	ld b, SCGB_BATTLE_GRAYSCALE
 	call GetSGBLayout
 	ld hl, rLCDC
-	res 6, [hl]
+	res rLCDC_WINDOW_TILEMAP, [hl] ; select 9800-9BFF
 	call InitBattleDisplay
 	call BattleStartMessage
 	ld hl, rLCDC
-	set 6, [hl]
+	set rLCDC_WINDOW_TILEMAP, [hl] ; select 9C00-9FFF
 	xor a
 	ld [hBGMapMode], a
 	call EmptyBattleTextBox
--- a/engine/battle_anims/bg_effects.asm
+++ b/engine/battle_anims/bg_effects.asm
@@ -2066,6 +2066,7 @@
 	dw .cgb_zero
 	dw .cgb_one
 	dw .cgb_two
+
 .cgb_zero
 	call BattleBGEffects_IncrementJumptable
 	ld hl, BG_EFFECT_STRUCT_03
@@ -2313,7 +2314,7 @@
 	ld [hSCY], a
 	xor $ff
 	inc a
-	ld [AnimObject01_YOffset], a
+	ld [AnimObject01YOffset], a
 	ret
 
 BattleBGEffect_1f: ; c8cf9 (32:4cf9)
--- a/engine/billspc.asm
+++ b/engine/billspc.asm
@@ -42,7 +42,6 @@
 	jp hl
 
 .Jumptable: ; e23df (38:63df)
-
 	dw .Init
 	dw .HandleJoypad
 	dw .WhatsUp
@@ -49,7 +48,6 @@
 	dw .Submenu
 	dw BillsPC_EndJumptableLoop
 
-
 .Init: ; e23e9 (38:63e9)
 	xor a
 	ld [hBGMapMode], a
@@ -150,7 +148,6 @@
 	jp hl
 
 BillsPCDepositJumptable: ; e24a1 (38:64a1)
-
 	dw BillsPCDepositFuncDeposit ; Deposit Pokemon
 	dw BillsPCDepositFuncStats ; Pokemon Stats
 	dw BillsPCDepositFuncRelease ; Release Pokemon
@@ -309,7 +306,6 @@
 	jp hl
 
 .Jumptable: ; e25d2 (38:65d2)
-
 	dw .Init
 	dw .Joypad
 	dw .PrepSubmenu
@@ -316,7 +312,6 @@
 	dw BillsPC_Withdraw
 	dw BillsPC_EndJumptableLoop
 
-
 .Init: ; e25dc (38:65dc)
 	ld a, NUM_BOXES + 1
 	ld [wBillsPC_LoadedBox], a
@@ -560,7 +555,6 @@
 ; e27ac
 
 .Jumptable: ; e27ac
-
 	dw .Init
 	dw .Joypad
 	dw .PrepSubmenu
@@ -2029,7 +2023,6 @@
 ; e3245
 
 .Jumptable: ; e3245
-
 	dw .BoxToBox
 	dw .PartyToBox
 	dw .BoxToParty
--- a/engine/card_flip.asm
+++ b/engine/card_flip.asm
@@ -80,7 +80,6 @@
 ; e01a0 (38:41a0)
 
 .Jumptable: ; e01a0
-
 	dw .AskPlayWithThree
 	dw .DeductCoins
 	dw .ChooseACard
@@ -656,7 +655,6 @@
 ; e0553
 
 .Jumptable: ; e0553
-
 	dw .Level1
 	dw .Level2
 	dw .Level3
@@ -833,7 +831,6 @@
 ; e0643
 
 .Jumptable: ; e0643
-
 	dw .Impossible
 	dw .Impossible
 	dw .PikaJiggly
--- a/engine/color.asm
+++ b/engine/color.asm
@@ -617,7 +617,7 @@
 
 ApplyAttrMap:
 	ld a, [rLCDC]
-	bit 7, a
+	bit rLCDC_ENABLE, a
 	jr z, .UpdateVBank1
 	ld a, [hBGMapMode]
 	push af
@@ -1073,7 +1073,7 @@
 	ld bc, $100 tiles
 	call CopyData
 	call DrawDefaultTiles
-	ld a, $e3
+	ld a, LCDC_DEFAULT
 	ld [rLCDC], a
 	ld hl, PalPacket_9d06
 	call PushSGBPals
@@ -1107,7 +1107,7 @@
 	ld bc, 16 palettes
 	call CopyData
 	call DrawDefaultTiles
-	ld a, $e3
+	ld a, LCDC_DEFAULT
 	ld [rLCDC], a
 	ld hl, PalPacket_9d46
 	call PushSGBPals
@@ -1131,7 +1131,7 @@
 	dec b
 	jr nz, .loop
 	call DrawDefaultTiles
-	ld a, $e3
+	ld a, LCDC_DEFAULT
 	ld [rLCDC], a
 	ld hl, PalPacket_9d36
 	call PushSGBPals
--- a/engine/credits.asm
+++ b/engine/credits.asm
@@ -152,9 +152,7 @@
 	jp hl
 ; 109937
 
-
 .Jumptable: ; 109937 (42:5937)
-
 	dw ParseCredits
 	dw Credits_Next
 	dw Credits_Next
@@ -168,7 +166,6 @@
 	dw Credits_UpdateGFXRequestPath
 	dw Credits_RequestGFX
 	dw Credits_LoopBack
-
 
 Credits_Next: ; 109951 (42:5951)
 	ld hl, wJumptableIndex
--- a/engine/dummy_game.asm
+++ b/engine/dummy_game.asm
@@ -34,7 +34,7 @@
 	ld [wJumptableIndex], a
 	ld a, $1
 	ld [hBGMapMode], a
-	ld a, $e3
+	ld a, LCDC_DEFAULT
 	ld [rLCDC], a
 	ld a, $e4
 	call DmgToCgbBGPals
--- a/engine/events/magnet_train.asm
+++ b/engine/events/magnet_train.asm
@@ -303,7 +303,6 @@
 ; 8ce06
 
 .Jumptable: ; 8ce06
-
 	dw .InitPlayerSpriteAnim
 	dw .WaitScene
 	dw .MoveTrain1
--- a/engine/events/overworld.asm
+++ b/engine/events/overworld.asm
@@ -128,7 +128,6 @@
 	ret
 
 .Jumptable: ; c796 (3:4796)
-
 	dw .CheckAble
 	dw .DoCut
 	dw .FailCut
--- a/engine/intro_menu.asm
+++ b/engine/intro_menu.asm
@@ -1035,7 +1035,7 @@
 	ld [rSVBK], a
 
 	ld hl, rLCDC
-	res 2, [hl]
+	res rLCDC_SPRITE_SIZE, [hl] ; 8x8
 	call ClearScreen
 	call WaitBGMap2
 	xor a
--- a/engine/main_menu.asm
+++ b/engine/main_menu.asm
@@ -54,7 +54,6 @@
 	db "MOBILE STUDIUM@"
 
 .Jumptable: ; 0x49d60
-
 	dw MainMenu_Continue
 	dw MainMenu_NewGame
 	dw MainMenu_Options
--- a/engine/map_objects.asm
+++ b/engine/map_objects.asm
@@ -285,7 +285,7 @@
 	ld [hli], a
 	ld [hli], a
 	ld [hli], a
-	ld [hl], a ; OBJECT_30
+	ld [hl], a ; OBJECT_1E
 	ld hl, OBJECT_DIRECTION_WALKING
 	add hl, bc
 	ld [hl], STANDING
@@ -482,22 +482,22 @@
 	ret
 ; 479b
 
-ClearObjectStructField28: ; 479b
-	ld hl, OBJECT_28
+ClearObjectStructField1c: ; 479b
+	ld hl, OBJECT_1C
 	add hl, bc
 	ld [hl], 0
 	ret
 ; 47a2
 
-IncrementObjectStructField28: ; 47a2
-	ld hl, OBJECT_28
+IncrementObjectStructField1c: ; 47a2
+	ld hl, OBJECT_1C
 	add hl, bc
 	inc [hl]
 	ret
 ; 47a8
 
-Object28AnonymousJumptable: ; 47a8
-	ld hl, OBJECT_28
+Field1cAnonymousJumptable: ; 47a8
+	ld hl, OBJECT_1C
 	add hl, bc
 	ld a, [hl]
 	pop hl
@@ -505,15 +505,15 @@
 	ret
 ; 47b0
 
-GetValueObjectStructField28: ; 47b0
-	ld hl, OBJECT_28
+GetValueObjectStructField1c: ; 47b0
+	ld hl, OBJECT_1C
 	add hl, bc
 	ld a, [hl]
 	ret
 ; 47b6
 
-SetValueObjectStructField28: ; 47b6
-	ld hl, OBJECT_28
+SetValueObjectStructField1c: ; 47b6
+	ld hl, OBJECT_1C
 	add hl, bc
 	ld [hl], a
 	ret
@@ -541,7 +541,7 @@
 ; 47dd
 
 MapObjectMovementPattern: ; 47dd
-	call ClearObjectStructField28
+	call ClearObjectStructField1c
 	call GetSpriteMovementFunction
 	ld a, [hl]
 	ld hl, .Pointers
@@ -1002,7 +1002,7 @@
 	ld d, b
 	ld e, c
 	pop bc
-	ld hl, OBJECT_29
+	ld hl, OBJECT_1D
 	add hl, bc
 	ld [hl], e
 	inc hl
@@ -1021,7 +1021,7 @@
 	ld hl, OBJECT_STEP_DURATION
 	add hl, bc
 	ld [hl], e
-	ld hl, OBJECT_30
+	ld hl, OBJECT_1E
 	add hl, bc
 	ld [hl], a
 	ld hl, OBJECT_STEP_TYPE
@@ -1141,7 +1141,7 @@
 ; 4b86
 
 NPCJump: ; 4b86
-	call Object28AnonymousJumptable
+	call Field1cAnonymousJumptable
 ; anonymous dw
 	dw .Jump
 	dw .Land
@@ -1158,7 +1158,7 @@
 	ld hl, OBJECT_FLAGS2
 	add hl, bc
 	res 3, [hl]
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 	ret
 
 .Land:
@@ -1176,7 +1176,7 @@
 ; 4bbf
 
 PlayerJump: ; 4bbf
-	call Object28AnonymousJumptable
+	call Field1cAnonymousJumptable
 ; anonymous dw
 	dw .initjump
 	dw .stepjump
@@ -1186,7 +1186,7 @@
 .initjump
 	ld hl, wPlayerStepFlags
 	set 7, [hl]
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 .stepjump
 	call UpdateJumpPosition
 	call UpdatePlayerStep
@@ -1201,7 +1201,7 @@
 	ld hl, wPlayerStepFlags
 	set 6, [hl]
 	set 4, [hl]
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 	ret
 
 .initland
@@ -1208,7 +1208,7 @@
 	call GetNextTile
 	ld hl, wPlayerStepFlags
 	set 7, [hl]
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 .stepland
 	call UpdateJumpPosition
 	call UpdatePlayerStep
@@ -1226,7 +1226,7 @@
 ; 4c18
 
 TeleportFrom: ; 4c18
-	call Object28AnonymousJumptable
+	call Field1cAnonymousJumptable
 ; anonymous dw
 	dw .InitSpin
 	dw .DoSpin
@@ -1241,7 +1241,7 @@
 	ld hl, OBJECT_STEP_DURATION
 	add hl, bc
 	ld [hl], 16
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 .DoSpin:
 	ld hl, OBJECT_ACTION
 	add hl, bc
@@ -1250,7 +1250,7 @@
 	add hl, bc
 	dec [hl]
 	ret nz
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 	ret
 
 .InitSpinRise:
@@ -1257,7 +1257,7 @@
 	ld hl, OBJECT_STEP_FRAME
 	add hl, bc
 	ld [hl], 0
-	ld hl, OBJECT_31
+	ld hl, OBJECT_1F
 	add hl, bc
 	ld [hl], $10
 	ld hl, OBJECT_STEP_DURATION
@@ -1266,12 +1266,12 @@
 	ld hl, OBJECT_FLAGS2
 	add hl, bc
 	res 3, [hl]
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 .DoSpinRise:
 	ld hl, OBJECT_ACTION
 	add hl, bc
 	ld [hl], OBJECT_ACTION_SPIN
-	ld hl, OBJECT_31
+	ld hl, OBJECT_1F
 	add hl, bc
 	inc [hl]
 	ld a, [hl]
@@ -1296,7 +1296,7 @@
 ; 4c89
 
 TeleportTo: ; 4c89
-	call Object28AnonymousJumptable
+	call Field1cAnonymousJumptable
 ; anonymous dw
 	dw .InitWait
 	dw .DoWait
@@ -1314,7 +1314,7 @@
 	ld hl, OBJECT_STEP_DURATION
 	add hl, bc
 	ld [hl], 16
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 	ret
 ; 4caa
 
@@ -1323,18 +1323,18 @@
 	add hl, bc
 	dec [hl]
 	ret nz
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 .InitDescent:
 	ld hl, OBJECT_STEP_FRAME
 	add hl, bc
 	ld [hl], 0
-	ld hl, OBJECT_31
+	ld hl, OBJECT_1F
 	add hl, bc
 	ld [hl], 0
 	ld hl, OBJECT_STEP_DURATION
 	add hl, bc
 	ld [hl], 16
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 	ret
 ; 4cc9
 
@@ -1342,7 +1342,7 @@
 	ld hl, OBJECT_ACTION
 	add hl, bc
 	ld [hl], OBJECT_ACTION_SPIN
-	ld hl, OBJECT_31
+	ld hl, OBJECT_1F
 	add hl, bc
 	inc [hl]
 	ld a, [hl]
@@ -1357,12 +1357,12 @@
 	add hl, bc
 	dec [hl]
 	ret nz
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 .InitFinalSpin:
 	ld hl, OBJECT_STEP_DURATION
 	add hl, bc
 	ld [hl], 16
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 	ret
 ; 4cf5
 
@@ -1388,7 +1388,7 @@
 ; 4d14
 
 Skyfall: ; 4d14
-	call Object28AnonymousJumptable
+	call Field1cAnonymousJumptable
 ; anonymous dw
 	dw .Init
 	dw .Step
@@ -1403,7 +1403,7 @@
 	ld hl, OBJECT_STEP_DURATION
 	add hl, bc
 	ld [hl], 16
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 .Step:
 	ld hl, OBJECT_STEP_DURATION
 	add hl, bc
@@ -1415,15 +1415,15 @@
 	ld hl, OBJECT_STEP_FRAME
 	add hl, bc
 	ld [hl], 0
-	ld hl, OBJECT_31
+	ld hl, OBJECT_1F
 	add hl, bc
 	ld [hl], 0
 	ld hl, OBJECT_STEP_DURATION
 	add hl, bc
 	ld [hl], 16
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 .Fall:
-	ld hl, OBJECT_31
+	ld hl, OBJECT_1F
 	add hl, bc
 	inc [hl]
 	ld a, [hl]
@@ -1438,7 +1438,7 @@
 	add hl, bc
 	dec [hl]
 	ret nz
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 .Finish:
 	ld hl, OBJECT_STEP_FRAME
 	add hl, bc
@@ -1453,7 +1453,7 @@
 ; 4d7e
 
 GotBiteStep: ; 4d7e
-	call Object28AnonymousJumptable
+	call Field1cAnonymousJumptable
 ; anonymous dw
 	dw .Init
 	dw .Run
@@ -1466,7 +1466,7 @@
 	ld hl, OBJECT_SPRITE_Y_OFFSET
 	add hl, bc
 	ld [hl], 0
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 .Run:
 	ld hl, OBJECT_SPRITE_Y_OFFSET
 	add hl, bc
@@ -1558,7 +1558,7 @@
 ; 4e0c
 
 StepType05: ; 4e0c
-	call Object28AnonymousJumptable
+	call Field1cAnonymousJumptable
 ; anonymous dw
 	dw .Reset
 	dw StepType04
@@ -1569,7 +1569,7 @@
 	ld hl, OBJECT_FACING
 	add hl, bc
 	ld [hl], a
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 StepType04: ; 4e21
 	call MobileFn_4fb2
 	ld hl, OBJECT_DIRECTION_WALKING
@@ -1607,7 +1607,7 @@
 
 PlayerStep: ; 4e56
 ; AnimateStep?
-	call Object28AnonymousJumptable
+	call Field1cAnonymousJumptable
 ; anonymous dw
 	dw .init
 	dw .step
@@ -1615,7 +1615,7 @@
 .init
 	ld hl, wPlayerStepFlags
 	set 7, [hl]
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 .step
 	call UpdatePlayerStep
 	ld hl, OBJECT_STEP_DURATION
@@ -1635,7 +1635,7 @@
 ; 4e83
 
 PlayerOrNPCTurnStep: ; 4e83
-	call Object28AnonymousJumptable
+	call Field1cAnonymousJumptable
 ; anonymous dw
 	dw .init1
 	dw .step1
@@ -1653,15 +1653,15 @@
 	ld hl, OBJECT_STEP_DURATION
 	add hl, bc
 	ld [hl], 2
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 .step1
 	ld hl, OBJECT_STEP_DURATION
 	add hl, bc
 	dec [hl]
 	ret nz
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 .init2
-	ld hl, OBJECT_29 ; new facing
+	ld hl, OBJECT_1D ; new facing
 	add hl, bc
 	ld a, [hl]
 	ld hl, OBJECT_FACING
@@ -1670,7 +1670,7 @@
 	ld hl, OBJECT_STEP_DURATION
 	add hl, bc
 	ld [hl], 2
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 .step2
 	ld hl, OBJECT_STEP_DURATION
 	add hl, bc
@@ -1715,7 +1715,7 @@
 ; 4f04
 
 StepTypeTrackingObject: ; 4f04
-	ld hl, OBJECT_29
+	ld hl, OBJECT_1D
 	add hl, bc
 	ld e, [hl]
 	inc hl
@@ -1750,7 +1750,7 @@
 
 StepType14: ; 4f33
 StepType15: ; 4f33
-	call Object28AnonymousJumptable
+	call Field1cAnonymousJumptable
 ; anonymous dw
 	dw .Init
 	dw .Run
@@ -1757,12 +1757,12 @@
 
 .Init:
 	xor a
-	ld hl, OBJECT_29
+	ld hl, OBJECT_1D
 	add hl, bc
 	ld [hl], a
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 .Run:
-	ld hl, OBJECT_29
+	ld hl, OBJECT_1D
 	add hl, bc
 	ld d, [hl]
 	ld a, [wPlayerStepVectorY]
@@ -1774,7 +1774,7 @@
 	jr z, .ok
 	ld a, [hl]
 	call .GetSign
-	ld hl, OBJECT_29
+	ld hl, OBJECT_1D
 	add hl, bc
 	ld [hl], a
 	ld d, a
@@ -1788,7 +1788,7 @@
 	ret
 
 .GetSign:
-	ld hl, OBJECT_30
+	ld hl, OBJECT_1E
 	add hl, bc
 	and 1
 	ld a, [hl]
@@ -1799,10 +1799,10 @@
 ; 4f77
 
 StepType16: ; 4f77
-	call Object28AnonymousJumptable ; ????
+	call Field1cAnonymousJumptable ; ????
 ; 4f7a
 StepType17: ; 4f7a
-	call Object28AnonymousJumptable
+	call Field1cAnonymousJumptable
 ; anonymous dw
 	dw .null
 	dw .null
@@ -1811,7 +1811,7 @@
 ; 4f83
 
 SkyfallTop: ; 4f83
-	call Object28AnonymousJumptable
+	call Field1cAnonymousJumptable
 ; anonymous dw
 	dw .Init
 	dw .Run
@@ -1823,7 +1823,7 @@
 	ld hl, OBJECT_STEP_DURATION
 	add hl, bc
 	ld [hl], 16
-	call IncrementObjectStructField28
+	call IncrementObjectStructField1c
 
 .Run:
 	ld hl, OBJECT_STEP_DURATION
@@ -1843,7 +1843,7 @@
 ; 4fb2
 
 MobileFn_4fb2: mobile
-	ld hl, OBJECT_29
+	ld hl, OBJECT_1D
 	add hl, bc
 	inc [hl]
 	ld a, [hl]
@@ -1866,7 +1866,7 @@
 UpdateJumpPosition: ; 4fd5
 	call GetStepVector
 	ld a, h
-	ld hl, OBJECT_31
+	ld hl, OBJECT_1F
 	add hl, bc
 	ld e, [hl]
 	add e
--- a/engine/mon_icons.asm
+++ b/engine/mon_icons.asm
@@ -46,7 +46,6 @@
 	dw Mobile_InitPartyMenuBGPal71 ; mobile
 	dw .GetPartyMenuMonIcon ; unused
 
-
 .GetPartyMenuMonIcon: ; 8e862 (23:6862)
 	call InitPartyMenuIcon
 	call .GetPartyMonItemGFX
--- a/engine/movement.asm
+++ b/engine/movement.asm
@@ -727,7 +727,7 @@
 	jr TurnStep
 
 TurnStep: ; 5400
-	ld hl, OBJECT_29 ; new facing
+	ld hl, OBJECT_1D ; new facing
 	add hl, bc
 	ld [hl], a
 
@@ -832,7 +832,7 @@
 
 JumpStep: ; 548a
 	call InitStep
-	ld hl, OBJECT_31
+	ld hl, OBJECT_1F
 	add hl, bc
 	ld [hl], $0
 
--- a/engine/mystery_gift.asm
+++ b/engine/mystery_gift.asm
@@ -116,7 +116,7 @@
 
 .PrintTextAndExit: ; 1049c5 (41:49c5)
 	call PrintText
-	ld a, $e3
+	ld a, LCDC_DEFAULT
 	ld [rLCDC], a
 	ret
 ; 1049cd (41:49cd)
@@ -262,7 +262,7 @@
 	; Delay frame
 .ly_loop
 	ld a, [rLY]
-	cp $90
+	cp LY_VBLANK
 	jr c, .ly_loop
 	ld c, LOW(rRP)
 	ld a, $c0
@@ -281,7 +281,7 @@
 	and b
 	ld b, a
 	ld a, [rLY]
-	cp $90
+	cp LY_VBLANK
 	jr nc, .ly_loop2
 .ly_loop3
 	ld a, [$ff00+c]
@@ -288,7 +288,7 @@
 	and b
 	ld b, a
 	ld a, [rLY]
-	cp $90
+	cp LY_VBLANK
 	jr c, .ly_loop3
 
 	ld a, b
@@ -1497,7 +1497,7 @@
 
 asm_105726: ; 105726 (41:5726)
 	call PrintText
-	ld a, $e3
+	ld a, LCDC_DEFAULT
 	ld [rLCDC], a
 	ret
 ; 10572e (41:572e)
--- a/engine/namingscreen.asm
+++ b/engine/namingscreen.asm
@@ -48,7 +48,7 @@
 	call DisableLCD
 	call LoadNamingScreenGFX
 	call NamingScreen_InitText
-	ld a, $e3
+	ld a, LCDC_DEFAULT
 	ld [rLCDC], a
 	call .GetNamingScreenSetup
 	call WaitBGMap
@@ -1017,7 +1017,7 @@
 	add hl, bc
 	ld [hl], $0
 	call .InitCharset
-	ld a, $e3
+	ld a, LCDC_DEFAULT
 	ld [rLCDC], a
 	call .initwNamingScreenMaxNameLength
 	ld b, SCGB_DIPLOMA
--- a/engine/pack.asm
+++ b/engine/pack.asm
@@ -28,7 +28,6 @@
 ; 10030
 
 .Jumptable: ; 10030 (4:4030)
-
 	dw .InitGFX            ;  0
 	dw .InitItemsPocket    ;  1
 	dw .ItemsPocketMenu    ;  2
@@ -694,7 +693,6 @@
 ; 104c3
 
 .Jumptable: ; 104c3 (4:44c3)
-
 	dw .InitGFX            ;  0
 	dw .InitItemsPocket    ;  1
 	dw .ItemsPocketMenu    ;  2
@@ -865,7 +863,6 @@
 ; 0x10614
 
 .UsableJumptable: ; 10614
-
 	dw .Use
 	dw .Quit
 ; 10618
@@ -885,7 +882,6 @@
 ; 0x10627
 
 .UnusableJumptable: ; 10627
-
 	dw .Quit
 ; 10629
 
@@ -897,7 +893,6 @@
 	ret
 
 .ItemFunctionJumptable: ; 10637 (4:4637)
-
 	dw .Oak
 	dw .Oak
 	dw .Oak
@@ -1002,11 +997,11 @@
 ; 106d1
 
 .Jumptable: ; 106d1 (4:46d1)
-
 	dw .ItemsPocket
 	dw .BallsPocket
 	dw .KeyItemsPocket
 	dw .TMHMPocket
+
 .ItemsPocket: ; 106d9 (4:46d9)
 	xor a
 	call InitPocket
--- a/engine/player_step.asm
+++ b/engine/player_step.asm
@@ -59,7 +59,6 @@
 	ret
 
 .Jumptable: ; d4f2 (3:54f2)
-
 	dw GetMovementPermissions
 	dw BufferScreen
 	dw .mobile
--- a/engine/pokedex.asm
+++ b/engine/pokedex.asm
@@ -184,7 +184,6 @@
 	call Pokedex_LoadPointer
 	jp hl
 
-
 .Jumptable: ; 40115 (10:4115)
 	dw Pokedex_InitMainScreen
 	dw Pokedex_UpdateMainScreen
@@ -201,7 +200,6 @@
 	dw Pokedex_UpdateUnownMode
 	dw Pokedex_Exit
 
-
 Pokedex_IncrementDexPointer: ; 40131 (10:4131)
 	ld hl, wJumptableIndex
 	inc [hl]
@@ -1623,12 +1621,10 @@
 	call Pokedex_LoadPointer
 	jp hl
 
-
 .Jumptable: ; 40bf0 (10:4bf0)
 	dw .NewMode
 	dw .OldMode
 	dw Pokedex_ABCMode
-
 
 .NewMode: ; 40bf6 (10:4bf6)
 	ld de, NewPokedexOrder
--- a/engine/pokegear.asm
+++ b/engine/pokegear.asm
@@ -59,7 +59,7 @@
 	call InitPokegearModeIndicatorArrow
 	ld a, 8
 	call SkipMusic
-	ld a, $e3
+	ld a, LCDC_DEFAULT
 	ld [rLCDC], a
 	call TownMap_InitCursorAndPlayerIconPositions
 	xor a
@@ -285,7 +285,6 @@
 	dw .Map
 	dw .Phone
 	dw .Radio
-
 ; 90e1a
 
 .Clock: ; 90e1a
@@ -1852,7 +1851,7 @@
 	farcall ClearSpriteAnims
 	ld a, 8
 	call SkipMusic
-	ld a, $e3
+	ld a, LCDC_DEFAULT
 	ld [rLCDC], a
 	call TownMap_GetCurrentLandmark
 	ld [wTownMapPlayerIconLandmark], a
--- a/engine/printer_serial.asm
+++ b/engine/printer_serial.asm
@@ -29,9 +29,7 @@
 	jp hl
 ; 84031
 
-
 .Jumptable: ; 84031 (21:4031)
-
 	dw Print_InitPrinterHandshake ; 00
 	dw Printer_CheckConnectionStatus ; 01
 	dw Printer_WaitSerial ; 02
@@ -55,7 +53,6 @@
 	dw Printer_WaitLoopBack ; 12
 	dw Printer_WaitLoopBack_ ; 13
 
-
 Printer_NextSection: ; 84059 (21:4059)
 	ld hl, wJumptableIndex
 	inc [hl]
@@ -471,7 +468,6 @@
 	jp hl
 ; 842ea
 
-
 .Jumptable: ; 842ea (21:42ea)
 	dw Printer_DoNothing ; 00
 
@@ -508,7 +504,6 @@
 	dw Printer_Send0x00 ; 1d
 	dw Printer_ReceiveTowPrinterHandshakeAndSend0x00 ; 1e
 	dw Printer_ReceiveTowPrinterStatusFlagsAndExitSendLoop ; 1f
-
 
 Printer_NextInstruction: ; 8432a (21:432a)
 	ld hl, wPrinterOpcode
--- a/engine/routines/getsquareroot.asm
+++ b/engine/routines/getsquareroot.asm
@@ -23,8 +23,8 @@
 	ret
 
 .Squares: ; 13b98
-root	set 1
+root = 1
 	rept $ff
-	dw root*root
-root	set root+1
+	dw root * root
+root = root + 1
 	endr
--- a/engine/routines/phonering_copytilemapatonce.asm
+++ b/engine/routines/phonering_copytilemapatonce.asm
@@ -17,7 +17,7 @@
 	ld [hMapAnims], a
 .wait
 	ld a, [rLY]
-	cp $8f
+	cp LY_VBLANK - 1
 	jr c, .wait
 
 	di
@@ -31,7 +31,7 @@
 	call .CopyTilemapAtOnce
 .wait2
 	ld a, [rLY]
-	cp $8f
+	cp LY_VBLANK - 1
 	jr c, .wait2
 	ei
 
--- a/engine/slot_machine.asm
+++ b/engine/slot_machine.asm
@@ -8,6 +8,19 @@
 SLOTS_STARYU EQU $14
 REEL_SIZE EQU 15
 
+; Constants for slot_reel offsets (see macros/wram.asm)
+REEL_ACTION        EQUS "(wReel1ReelAction - wReel1)"
+REEL_TILEMAP_ADDR  EQUS "(wReel1TilemapAddr - wReel1)"
+REEL_POSITION      EQUS "(wReel1Position - wReel1)"
+REEL_SPIN_DISTANCE EQUS "(wReel1SpinDistance - wReel1)"
+REEL_SPIN_RATE     EQUS "(wReel1SpinRate - wReel1)"
+REEL_OAM_ADDR      EQUS "(wReel1OAMAddr - wReel1)"
+REEL_X_COORD       EQUS "(wReel1XCoord - wReel1)"
+REEL_MANIP_COUNTER EQUS "(wReel1ManipCounter - wReel1)"
+REEL_MANIP_DELAY   EQUS "(wReel1ManipDelay - wReel1)"
+REEL_FIELD_0B      EQUS "(wReel1Field0b - wReel1)"
+REEL_STOP_DELAY    EQUS "(wReel1StopDelay - wReel1)"
+
 ; SlotsJumptable constants
 	const_def
 	const SLOTS_INIT
@@ -20,8 +33,8 @@
 	const SLOTS_WAIT_REEL3
 	const SLOTS_WAIT_STOP_REEL3
 	const SLOTS_NEXT_09
-	const SLOTS_NEXT_0a
-	const SLOTS_NEXT_0b
+	const SLOTS_NEXT_0A
+	const SLOTS_NEXT_0B
 	const SLOTS_FLASH_IF_WIN
 	const SLOTS_FLASH_SCREEN
 	const SLOTS_GIVE_EARNED_COINS
@@ -76,7 +89,7 @@
 	ld hl, Options
 	res NO_TEXT_SCROLL, [hl]
 	ld hl, rLCDC
-	res 2, [hl]
+	res rLCDC_SPRITE_SIZE, [hl] ; 8x8
 	ret
 
 .InitGFX: ; 926f7 (24:66f7)
@@ -121,7 +134,7 @@
 	call CopyBytes
 
 	ld hl, rLCDC
-	set 2, [hl]
+	set rLCDC_SPRITE_SIZE, [hl] ; 8x16
 	call EnableLCD
 	ld hl, wSlots
 	ld bc, wSlotsEnd - wSlots
@@ -536,7 +549,7 @@
 	ret
 
 Slots_GetCurrentReelState: ; 92a12 (24:6a12)
-	ld hl, wReel1Position - wReel1
+	ld hl, REEL_POSITION
 	add hl, bc
 	ld a, [hl]
 	and a
@@ -547,7 +560,7 @@
 	and $f
 	ld e, a
 	ld d, $0
-	ld hl, wReel1TilemapAddr - wReel1
+	ld hl, REEL_TILEMAP_ADDR
 	add hl, bc
 	ld a, [hli]
 	ld h, [hl]
@@ -655,55 +668,55 @@
 
 Slots_InitReelTiles: ; 92a98 (24:6a98)
 	ld bc, wReel1
-	ld hl, wReel1OAMAddr - wReel1
+	ld hl, REEL_OAM_ADDR
 	add hl, bc
 	ld de, Sprites + 16 * 4
 	ld [hl], e
 	inc hl
 	ld [hl], d
-	ld hl, wReel1TilemapAddr - wReel1
+	ld hl, REEL_TILEMAP_ADDR
 	add hl, bc
 	ld de, Reel1Tilemap
 	ld [hl], e
 	inc hl
 	ld [hl], d
-	ld hl, wReel1XCoord - wReel1
+	ld hl, REEL_X_COORD
 	add hl, bc
 	ld [hl], 6 * 8
 	call .OAM
 
 	ld bc, wReel2
-	ld hl, wReel1OAMAddr - wReel1
+	ld hl, REEL_OAM_ADDR
 	add hl, bc
 	ld de, Sprites + 24 * 4
 	ld [hl], e
 	inc hl
 	ld [hl], d
-	ld hl, wReel1TilemapAddr - wReel1
+	ld hl, REEL_TILEMAP_ADDR
 	add hl, bc
 	ld de, Reel2Tilemap
 	ld [hl], e
 	inc hl
 	ld [hl], d
-	ld hl, wReel1XCoord - wReel1
+	ld hl, REEL_X_COORD
 	add hl, bc
 	ld [hl], 10 * 8
 	call .OAM
 
 	ld bc, wReel3
-	ld hl, wReel1OAMAddr - wReel1
+	ld hl, REEL_OAM_ADDR
 	add hl, bc
 	ld de, Sprites + 32 * 4
 	ld [hl], e
 	inc hl
 	ld [hl], d
-	ld hl, wReel1TilemapAddr - wReel1
+	ld hl, REEL_TILEMAP_ADDR
 	add hl, bc
 	ld de, Reel3Tilemap
 	ld [hl], e
 	inc hl
 	ld [hl], d
-	ld hl, wReel1XCoord - wReel1
+	ld hl, REEL_X_COORD
 	add hl, bc
 	ld [hl], 14 * 8
 	call .OAM
@@ -710,13 +723,13 @@
 	ret
 
 .OAM: ; 92af9 (24:6af9)
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	ld [hl], REEL_ACTION_DO_NOTHING
-	ld hl, wReel1Position - wReel1
+	ld hl, REEL_POSITION
 	add hl, bc
 	ld [hl], REEL_SIZE - 1
-	ld hl, wReel1SpinDistance - wReel1
+	ld hl, REEL_SPIN_DISTANCE
 	add hl, bc
 	ld [hl], REEL_ACTION_DO_NOTHING
 	call Slots_UpdateReelPositionAndOAM
@@ -732,7 +745,7 @@
 	ret
 
 .SpinReel: ; 92b22 (24:6b22)
-	ld hl, wReel1SpinDistance - wReel1
+	ld hl, REEL_SPIN_DISTANCE
 	add hl, bc
 	ld a, [hl]
 	and $f
@@ -739,19 +752,19 @@
 	jr nz, .skip
 	call ReelActionJumptable
 .skip
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld a, [hl]
 	and a
 	ret z
 	ld d, a
-	ld hl, wReel1SpinDistance - wReel1
+	ld hl, REEL_SPIN_DISTANCE
 	add hl, bc
 	add [hl]
 	ld [hl], a
 	and $f
 	jr z, Slots_UpdateReelPositionAndOAM
-	ld hl, wReel1OAMAddr - wReel1
+	ld hl, REEL_OAM_ADDR
 	add hl, bc
 	ld a, [hli]
 	ld h, [hl]
@@ -769,17 +782,17 @@
 	ret
 
 Slots_UpdateReelPositionAndOAM: ; 92b53 (24:6b53)
-	ld hl, wReel1XCoord - wReel1
+	ld hl, REEL_X_COORD
 	add hl, bc
 	ld a, [hl]
 	ld [wCurrReelXCoord], a
 	ld a, 10 * 8
 	ld [wCurrReelYCoord], a
-	ld hl, wReel1Position - wReel1
+	ld hl, REEL_POSITION
 	add hl, bc
 	ld e, [hl]
 	ld d, 0
-	ld hl, wReel1TilemapAddr - wReel1
+	ld hl, REEL_TILEMAP_ADDR
 	add hl, bc
 	ld a, [hli]
 	ld h, [hl]
@@ -788,7 +801,7 @@
 	ld e, l
 	ld d, h
 	call .LoadOAM
-	ld hl, wReel1Position - wReel1
+	ld hl, REEL_POSITION
 	add hl, bc
 	ld a, [hl]
 	inc a
@@ -801,7 +814,7 @@
 	ret
 
 .LoadOAM: ; 92b83 (24:6b83)
-	ld hl, wReel1OAMAddr - wReel1
+	ld hl, REEL_OAM_ADDR
 	add hl, bc
 	ld a, [hli]
 	ld h, [hl]
@@ -862,7 +875,7 @@
 ; 92bd4
 
 ReelActionJumptable: ; 92bd4 (24:6bd4)
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	ld e, [hl]
 	ld d, 0
@@ -910,7 +923,7 @@
 ; 92c17
 
 ReelAction_QuadrupleRate: ; 92c17
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 16
 	ret
@@ -918,7 +931,7 @@
 ; 92c1e
 
 ReelAction_DoubleRate: ; 92c1e
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 8
 	ret
@@ -926,7 +939,7 @@
 ; 92c25
 
 ReelAction_NormalRate: ; 92c25
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 4
 	ret
@@ -934,7 +947,7 @@
 ; 92c2c
 
 ReelAction_HalfRate: ; 92c2c
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 2
 	ret
@@ -942,7 +955,7 @@
 ; 92c33
 
 ReelAction_QuarterRate: ; 92c33
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 1
 	ret
@@ -950,17 +963,17 @@
 ; 92c3a
 
 Slots_StopReel: ; 92c3a
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 0
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	ld [hl], REEL_ACTION_STOP_REEL_IGNORE_JOYPAD
-	ld hl, wReel1StopDelay - wReel1
+	ld hl, REEL_STOP_DELAY
 	add hl, bc
 	ld [hl], 3
 ReelAction_StopReelIgnoreJoypad: ; 92c4c
-	ld hl, wReel1StopDelay - wReel1
+	ld hl, REEL_STOP_DELAY
 	add hl, bc
 	ld a, [hl]
 	and a
@@ -969,7 +982,7 @@
 	ret
 
 .EndReel:
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	ld a, REEL_ACTION_DO_NOTHING
 	ld [hl], a
@@ -979,7 +992,7 @@
 
 ReelAction_StopReel1: ; 92c5e
 ; If no bias: don't manipulate reel.
-; If bias: manipulate reel up to wReel1ManipCounter (i.e. 4) times,
+; If bias: manipulate reel up to wReel1ManipCounter (i.e. 4) slots,
 ; stoping early if the biased symbol shows up anywhere in reel #1,
 ; even if the current bet won't allow lining it up.
 
@@ -986,7 +999,7 @@
 	ld a, [wSlotBias]
 	cp SLOTS_NOBIAS
 	jr z, .NoBias
-	ld hl, wReel1ManipCounter - wReel1
+	ld hl, REEL_MANIP_COUNTER
 	add hl, bc
 	ld a, [hl]
 	and a
@@ -1018,7 +1031,7 @@
 
 ReelAction_StopReel2: ; 92c86
 ; If no bias: don't manipulate reel.
-; If bias: manipulate reel up to wReel2ManipCounter (i.e. 4) times,
+; If bias: manipulate reel up to wReel2ManipCounter (i.e. 4) slots,
 ; stoping early if the biased symbol is lined up in the first two
 ; reels, according to the lines that the current bet allows.
 
@@ -1032,7 +1045,7 @@
 	ld a, [wSlotBias]
 	cp SLOTS_NOBIAS
 	jr z, .NoBias
-	ld hl, wReel1ManipCounter - wReel1
+	ld hl, REEL_MANIP_COUNTER
 	add hl, bc
 	ld a, [hl]
 	and a
@@ -1047,7 +1060,7 @@
 ; 92ca9
 
 ReelAction_StopReel3: ; 92ca9
-; Manipulate the reel up to wReel3ManipCounter (i.e. 4) times,
+; Manipulate the reel up to wReel3ManipCounter (i.e. 4) slots,
 ; stopping early if the bias symbol is lined up for a win.
 ; If not biased to any symbols, stop as soon as nothing is lined up.
 
@@ -1056,7 +1069,7 @@
 	ld hl, wSlotBias
 	cp [hl]
 	jr z, .NoBias
-	ld hl, wReel1ManipCounter - wReel1
+	ld hl, REEL_MANIP_COUNTER
 	add hl, bc
 	ld a, [hl]
 	and a
@@ -1068,7 +1081,7 @@
 	ld a, [wSlotBias]
 	cp SLOTS_NOBIAS
 	jr z, .NoBias
-	ld hl, wReel1ManipCounter - wReel1
+	ld hl, REEL_MANIP_COUNTER
 	add hl, bc
 	ld a, [hl]
 	and a
@@ -1099,13 +1112,13 @@
 .no_match
 	ld a, SFX_STOP_SLOT
 	call Slots_PlaySFX
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	inc [hl] ; REEL_ACTION_WAIT_REEL2_SKIP_TO_7
-	ld hl, wReel1ManipDelay - wReel1
+	ld hl, REEL_MANIP_DELAY
 	add hl, bc
 	ld [hl], 32
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 0
 	ret
@@ -1113,7 +1126,7 @@
 ; 92cf8
 
 ReelAction_WaitReel2SkipTo7: ; 92cf8
-	ld hl, wReel1ManipDelay - wReel1
+	ld hl, REEL_MANIP_DELAY
 	add hl, bc
 	ld a, [hl]
 	and a
@@ -1124,10 +1137,10 @@
 .asm_92d02
 	ld a, SFX_THROW_BALL
 	call Slots_PlaySFX
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	inc [hl] ; REEL_ACTION_FAST_SPIN_REEL2_UNTIL_LINED_UP_7S
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 8
 	ret
@@ -1159,10 +1172,10 @@
 	ld a, SFX_STOP_SLOT
 	call Slots_PlaySFX
 	call Slots_WaitSFX
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	inc [hl] ; REEL_ACTION_WAIT_GOLEM
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 0
 	call Slots_GetNumberOfGolems
@@ -1192,10 +1205,10 @@
 	ret
 
 .one
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	inc [hl] ; REEL_ACTION_END_GOLEM
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 8
 	ret
@@ -1205,10 +1218,10 @@
 ReelAction_EndGolem: ; 92d6e
 	xor a
 	ld [wSlotsDelay], a
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	dec [hl] ; REEL_ACTION_WAIT_GOLEM
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 0
 	ret
@@ -1226,10 +1239,10 @@
 	ld a, SFX_STOP_SLOT
 	call Slots_PlaySFX
 	call Slots_WaitSFX
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	inc [hl] ; REEL_ACTION_WAIT_CHANSEY
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 0
 	push bc
@@ -1247,7 +1260,7 @@
 	ld a, [wSlotsDelay]
 	and a
 	ret z
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	inc [hl] ; REEL_ACTION_WAIT_EGG
 	ld a, 2
@@ -1256,17 +1269,17 @@
 	ld a, [wSlotsDelay]
 	cp $4
 	ret c
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	inc [hl] ; REEL_ACTION_DROP_REEL
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 16
-	ld hl, wReel1ManipDelay - wReel1
+	ld hl, REEL_MANIP_DELAY
 	add hl, bc
 	ld [hl], 17
 ReelAction_DropReel: ; 92dca
-	ld hl, wReel1ManipDelay - wReel1
+	ld hl, REEL_MANIP_DELAY
 	add hl, bc
 	ld a, [hl]
 	and a
@@ -1285,10 +1298,10 @@
 	ret
 
 .EggAgain:
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 0
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	dec [hl]
 	dec [hl] ; REEL_ACTION_WAIT_CHANSEY
@@ -1304,15 +1317,15 @@
 	ld a, SFX_STOP_SLOT
 	call Slots_PlaySFX
 	call Slots_WaitSFX
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	inc [hl] ; REEL_ACTION_CHECK_DROP_REEL
 	call Slots_GetNumberOfGolems
-	ld hl, wReel1ManipDelay - wReel1
+	ld hl, REEL_MANIP_DELAY
 	add hl, bc
 	ld [hl], a
 ReelAction_CheckDropReel: ; 92e10
-	ld hl, wReel1ManipDelay - wReel1
+	ld hl, REEL_MANIP_DELAY
 	add hl, bc
 	ld a, [hl]
 	and a
@@ -1323,17 +1336,17 @@
 
 .spin
 	dec [hl]
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	inc [hl] ; REEL_ACTION_WAIT_DROP_REEL
-	ld hl, wReel1Slot0b - wReel1
+	ld hl, REEL_FIELD_0B
 	add hl, bc
 	ld [hl], 32
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 0
 ReelAction_WaitDropReel: ; 92e31
-	ld hl, wReel1Slot0b - wReel1
+	ld hl, REEL_FIELD_0B
 	add hl, bc
 	ld a, [hl]
 	and a
@@ -1342,10 +1355,10 @@
 	ret
 
 .DropReel:
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	dec [hl]
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 8
 	ret
@@ -1365,17 +1378,17 @@
 	ld a, SFX_STOP_SLOT
 	call Slots_PlaySFX
 	call Slots_WaitSFX
-	ld hl, wReel1SpinRate - wReel1
+	ld hl, REEL_SPIN_RATE
 	add hl, bc
 	ld [hl], 1
-	ld hl, wReel1ReelAction - wReel1
+	ld hl, REEL_ACTION
 	add hl, bc
 	inc [hl] ; REEL_ACTION_WAIT_SLOW_ADVANCE_REEL3
-	ld hl, wReel1ManipDelay - wReel1
+	ld hl, REEL_MANIP_DELAY
 	add hl, bc
 	ld [hl], 16
 ReelAction_WaitSlowAdvanceReel3: ; 92e64
-	ld hl, wReel1ManipDelay - wReel1
+	ld hl, REEL_MANIP_DELAY
 	add hl, bc
 	ld a, [hl]
 	and a
@@ -1437,7 +1450,6 @@
 ; 92ebd
 
 .Jumptable: ; 92ebd
-
 	dw .zero
 	dw .one
 	dw .two
@@ -1552,7 +1564,6 @@
 ; 92f48
 
 .Jumptable: ; 92f48
-
 	dw .zero
 	dw .one
 	dw .two
@@ -1656,7 +1667,7 @@
 ; 92fc0
 
 Slots_GetNumberOfGolems: ; 92fc0
-	ld hl, wReel1Position - wReel1
+	ld hl, REEL_POSITION
 	add hl, bc
 	ld a, [hl]
 	push af
@@ -1676,7 +1687,7 @@
 	jr nz, .not_biased_to_seven
 	ld e, $0
 .loop1
-	ld hl, wReel1Position - wReel1
+	ld hl, REEL_POSITION
 	add hl, bc
 	inc [hl]
 	inc e
@@ -1697,7 +1708,7 @@
 .loop2
 	ld a, e
 	inc e
-	ld hl, wReel1Position - wReel1
+	ld hl, REEL_POSITION
 	add hl, bc
 	add [hl]
 	ld [hl], a
@@ -2032,7 +2043,7 @@
 ; or this code was intended to lead to flipped percentages.
 	ld a, [wKeepSevenBiasChance]
 	and a
-	jr nz, .lowerSevenStreakOdds
+	jr nz, .lower_seven_streak_odds
 	call Random
 	and %0010100
 	ret z ; 25% chance to stick with seven symbol bias
@@ -2040,7 +2051,7 @@
 	ld [wSlotBias], a
 	ret
 
-.lowerSevenStreakOdds
+.lower_seven_streak_odds
 	call Random
 	and %0011100
 	ret z ; 12.5% chance to stick with seven symbol bias
@@ -2080,12 +2091,10 @@
 	jp hl
 
 .Jumptable: ; 9322d (24:722d)
-
 	dw .init
 	dw .fall
 	dw .roll
 
-
 .init ; 93233 (24:7233)
 	ld hl, SPRITEANIMSTRUCT_0E
 	add hl, bc
@@ -2181,11 +2190,9 @@
 	jp hl
 
 .Jumptable: ; 932bc (24:72bc)
-
 	dw .walk
 	dw .one
 	dw .two
-
 
 .walk ; 932c2 (24:72c2)
 	ld hl, SPRITEANIMSTRUCT_XCOORD
--- a/engine/sprite_anims.asm
+++ b/engine/sprite_anims.asm
@@ -50,7 +50,6 @@
 	dw .IntroUnownF
 	dw .IntroSuicuneAway
 
-
 .Null: ; 8d2a1 (23:52a1)
 	ret
 
--- a/engine/stats_screen.asm
+++ b/engine/stats_screen.asm
@@ -534,12 +534,10 @@
 	ret
 
 .Jumptable: ; 4e00d (13:600d)
-
 	dw .PinkPage
 	dw .GreenPage
 	dw .BluePage
 
-
 .PinkPage: ; 4e013 (13:6013)
 	hlcoord 0, 9
 	ld b, $0
@@ -887,7 +885,6 @@
 	dw .BoxMon
 	dw .Tempmon
 	dw .Wildmon
-
 
 .PartyMon: ; 4e2bf (13:62bf)
 	ld a, [CurPartyMon]
--- a/engine/title.asm
+++ b/engine/title.asm
@@ -201,7 +201,7 @@
 
 ; Set sprite size to 8x16
 	ld a, [rLCDC]
-	set 2, a
+	set rLCDC_SPRITE_SIZE, a
 	ld [rLCDC], a
 
 	ld a, +112
--- a/engine/trainer_card.asm
+++ b/engine/trainer_card.asm
@@ -80,7 +80,6 @@
 	dw TrainerCard_Page3_Joypad
 	dw TrainerCard_Quit
 
-
 TrainerCard_IncrementJumptable: ; 251ab (9:51ab)
 	ld hl, wJumptableIndex
 	inc [hl]
--- a/engine/unown_puzzle.asm
+++ b/engine/unown_puzzle.asm
@@ -45,7 +45,7 @@
 	ld [wHoldingUnownPuzzlePiece], a
 	ld [wUnownPuzzleCursorPosition], a
 	ld [wUnownPuzzleHeldPiece], a
-	ld a, $93
+	ld a, %10010011
 	ld [rLCDC], a
 	call WaitBGMap
 	ld b, SCGB_UNOWN_PUZZLE
@@ -85,7 +85,7 @@
 	call ClearBGPalettes
 	call ClearTileMap
 	call ClearSprites
-	ld a, $e3
+	ld a, LCDC_DEFAULT
 	ld [rLCDC], a
 	ret
 ; e124e
@@ -188,7 +188,6 @@
 ; e12d9
 
 .Jumptable: ; e12d9
-
 	dw .Function
 ; e12db
 
--- a/engine/unused_title.asm
+++ b/engine/unused_title.asm
@@ -55,8 +55,8 @@
 
 	call EnableLCD
 	ld a, [rLCDC]
-	set 1, a
-	set 2, a
+	set rLCDC_SPRITES_ENABLE, a
+	set rLCDC_SPRITE_SIZE, a
 	ld [rLCDC], a
 
 	call DelayFrame
--- a/gfx/font.asm
+++ b/gfx/font.asm
@@ -107,7 +107,7 @@
 	ld hl, vTiles1
 	lb bc, BANK(Font), $80
 	ld a, [rLCDC]
-	bit 7, a
+	bit rLCDC_ENABLE, a
 	jp z, Copy1bpp
 
 	ld de, Font
--- a/home/copy.asm
+++ b/home/copy.asm
@@ -3,7 +3,7 @@
 
 Get2bpp_2:: ; dc9
 	ld a, [rLCDC]
-	bit 7, a
+	bit rLCDC_ENABLE, a
 	jp z, Copy2bpp
 
 	homecall _Get2bpp
@@ -13,7 +13,7 @@
 
 Get1bpp_2:: ; ddc
 	ld a, [rLCDC]
-	bit 7, a
+	bit rLCDC_ENABLE, a
 	jp z, Copy1bpp
 
 	homecall _Get1bpp
@@ -361,7 +361,7 @@
 
 Get2bpp:: ; f82
 	ld a, [rLCDC]
-	bit 7, a
+	bit rLCDC_ENABLE, a
 	jp nz, Request2bpp
 
 Copy2bpp:: ; f89
@@ -392,7 +392,7 @@
 
 Get1bpp:: ; f9d
 	ld a, [rLCDC]
-	bit 7, a
+	bit rLCDC_ENABLE, a
 	jp nz, Request1bpp
 
 Copy1bpp:: ; fa4
--- a/home/init.asm
+++ b/home/init.asm
@@ -62,7 +62,7 @@
 
 .wait
 	ld a, [rLY]
-	cp 145
+	cp LY_VBLANK + 1
 	jr nz, .wait
 
 	xor a
@@ -125,7 +125,7 @@
 	ld [hWX], a
 	ld [rWX], a
 
-	ld a, %11100011
+	ld a, LCDC_DEFAULT ; %11100011
 	; LCD on
 	; Win tilemap 1
 	; Win on
--- a/home/lcd.asm
+++ b/home/lcd.asm
@@ -43,7 +43,7 @@
 
 ; Don't need to do anything if the LCD is already off
 	ld a, [rLCDC]
-	bit 7, a ; lcd enable
+	bit rLCDC_ENABLE, a
 	ret z
 
 	xor a
@@ -58,11 +58,11 @@
 .wait
 ; Wait until VBlank would normally happen
 	ld a, [rLY]
-	cp 145
+	cp LY_VBLANK + 1
 	jr nz, .wait
 
 	ld a, [rLCDC]
-	and %01111111 ; lcd enable off
+	and $ff ^ (1 << rLCDC_ENABLE)
 	ld [rLCDC], a
 
 	xor a
@@ -75,7 +75,7 @@
 
 EnableLCD:: ; 58a
 	ld a, [rLCDC]
-	set 7, a ; lcd enable
+	set rLCDC_ENABLE, a
 	ld [rLCDC], a
 	ret
 ; 591
--- a/home/text.asm
+++ b/home/text.asm
@@ -31,7 +31,7 @@
 
 	; Update the BG Map.
 	ld a, [rLCDC]
-	bit 7, a
+	bit rLCDC_ENABLE, a
 	ret z
 	jp WaitBGMap
 ; fdb
--- a/home/video.asm
+++ b/home/video.asm
@@ -291,9 +291,9 @@
 
 ; Back out if we're too far into VBlank
 	ld a, [rLY]
-	cp 144
+	cp LY_VBLANK
 	ret c
-	cp 146
+	cp LY_VBLANK + 2
 	ret nc
 
 ; Copy [Requested1bpp] 1bpp tiles from [Requested1bppSource] to [Requested1bppDest]
@@ -372,9 +372,9 @@
 
 ; Back out if we're too far into VBlank
 	ld a, [rLY]
-	cp 144
+	cp LY_VBLANK
 	ret c
-	cp 146
+	cp LY_VBLANK + 2
 	ret nc
 	jr _Serve2bppRequest
 
@@ -454,9 +454,9 @@
 
 ; Back out if we're too far into VBlank
 	ld a, [rLY]
-	cp 144
+	cp LY_VBLANK
 	ret c
-	cp 151
+	cp LY_VBLANK + 7
 	ret nc
 
 	ld a, [hROMBank]
--- a/macros/wram.asm
+++ b/macros/wram.asm
@@ -149,7 +149,7 @@
 \1Octave::            db ; 7-0 (0 is highest)
 \1PitchOffset::       db ; raises existing octaves (to repeat phrases)
 \1NoteDuration::      db ; frames remaining for the current note
-\1Field0x16::         ds 1 ; c117
+\1Field16::           ds 1 ; c117
                       ds 1 ; c118
 \1LoopCount::         db
 \1Tempo::             dw
@@ -162,16 +162,16 @@
 \1PitchWheelTarget::  dw ; frequency endpoint for pitch wheel
 \1PitchWheelAmount::  db ; c124
 \1PitchWheelAmountFraction::   db ; c125
-\1Field0x25::         db ; c126
+\1Field25::           db ; c126
                       ds 1 ; c127
 \1CryPitch::          dw
-\1Field0x29::         ds 1
-\1Field0x2a::         ds 2
-\1Field0x2c::         ds 1
+\1Field29::           ds 1
+\1Field2a::           ds 2
+\1Field2c::           ds 1
 \1NoteLength::        db ; frames per 16th note
-\1Field0x2e::         ds 1 ; c12f
-\1Field0x2f::         ds 1 ; c130
-\1Field0x30::         ds 1 ; c131
+\1Field2e::           ds 1 ; c12f
+\1Field2f::           ds 1 ; c130
+\1Field30::           ds 1 ; c131
                       ds 1 ; c132
 ENDM
 
@@ -277,10 +277,10 @@
 \1XCoord::       db
 \1ManipCounter:: db
 \1ManipDelay::   db
-\1Slot0b::       ds 1
-\1Slot0c::       ds 1
-\1Slot0d::       ds 1
-\1Slot0e::       ds 1
+\1Field0b::      ds 1
+\1Field0c::      ds 1
+\1Field0d::      ds 1
+\1Field0e::      ds 1
 \1StopDelay::    db
 ENDM
 
@@ -313,10 +313,10 @@
 \1SpriteXOffset::     db
 \1SpriteYOffset::     db
 \1MovementByteIndex:: db
-\1Object28::          ds 1
-\1Object29::          ds 1
-\1Object30::          ds 1
-\1Object31::          ds 1
+\1Field1c::           ds 1
+\1Field1d::           ds 1
+\1Field1e::           ds 1
+\1Field1f::           ds 1
 \1Range::             db
 	ds 7
 \1StructEnd::
@@ -351,44 +351,44 @@
 \1Duration::       db
 \1DurationOffset:: db
 \1FrameIndex::     db
-\1Sprite0b::       ds 1
-\1Sprite0c::       ds 1
-\1Sprite0d::       ds 1
-\1Sprite0e::       ds 1
-\1Sprite0f::       ds 1
+\1JumptableIndex:: db
+\1Field0c::        ds 1
+\1Field0d::        ds 1
+\1Field0e::        ds 1
+\1Field0f::        ds 1
 ENDM
 
 battle_anim_struct: MACRO
 ; Placeholder until we can figure out what it all means
-\1_Index::              db
-\1_Anim01::             ds 1
-\1_Anim02::             ds 1
-\1_FramesetIndex::      db
-\1_FunctionIndex::      db
-\1_Anim05::             ds 1
-\1_TileID::             db
-\1_XCoord::             db
-\1_YCoord::             db
-\1_XOffset::            db
-\1_YOffset::            db
-\1_Anim0b::             ds 1
-\1_Anim0c::             ds 1
-\1_Anim0d::             ds 1
-\1_AnonJumptableIndex:: db
-\1_Anim0f::             ds 1
-\1_Anim10::             ds 1
-\1_Anim11::             ds 1
-\1_Anim12::             ds 1
-\1_Anim13::             ds 1
-\1_Anim14::             ds 1
-\1_Anim15::             ds 1
-\1_Anim16::             ds 1
-\1_Anim17::             ds 1
+\1Index::              db
+\1Field01::            ds 1
+\1Field02::            ds 1
+\1FramesetID::         db
+\1Function::           db
+\1Palette::            db
+\1TileID::             db
+\1XCoord::             db
+\1YCoord::             db
+\1XOffset::            db
+\1YOffset::            db
+\1Field0b::            ds 1
+\1Duration::           db
+\1Frame::              db
+\1AnonJumptableIndex:: db
+\1Field0f::            ds 1
+\1Field10::            ds 1
+\1Field11::            ds 1
+\1Field12::            ds 1
+\1Field13::            ds 1
+\1Field14::            ds 1
+\1Field15::            ds 1
+\1Field16::            ds 1
+\1Field17::            ds 1
 ENDM
 
 battle_bg_effect: MACRO
-\1_Function:: db
-\1_01::       ds 1
-\1_02::       ds 1
-\1_03::       ds 1
+\1Function:: db
+\1Field01::  ds 1
+\1Field02::  ds 1
+\1Field03::  ds 1
 ENDM
--- a/mobile/mobile_42.asm
+++ b/mobile/mobile_42.asm
@@ -381,7 +381,6 @@
 ; 10828a
 
 .Jumptable: ; 10828a
-
 	dw GetMobileTradeAnimByte ; 00
 	dw MobileTradeAnim_ShowPlayerMonToBeSent ; 01
 	dw MobileTradeAnim_02 ; 02
--- a/mobile/mobile_45_sprite_engine.asm
+++ b/mobile/mobile_45_sprite_engine.asm
@@ -411,7 +411,7 @@
 .wait_for_vblank
 ; Wait until a vblank would occur had interrupts not just been disabled.
 	ld a, [rLY]
-	cp $91
+	cp LY_VBLANK + 1
 	jr nz, .wait_for_vblank
 
 	ld a, $d0
--- a/mobile/mobile_46.asm
+++ b/mobile/mobile_46.asm
@@ -7398,6 +7398,7 @@
 
 .RunJumptable:
 	jumptable .Jumptable, wJumptableIndex
+
 .Jumptable:
 	dw Function11b66d
 	dw Function11b6b3