summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/battle/core.asm4
-rw-r--r--engine/battle_anims/bg_effects.asm3
-rwxr-xr-xengine/billspc.asm7
-rwxr-xr-xengine/card_flip.asm3
-rw-r--r--engine/color.asm8
-rw-r--r--engine/credits.asm3
-rwxr-xr-xengine/dummy_game.asm2
-rwxr-xr-xengine/events/magnet_train.asm1
-rwxr-xr-xengine/events/overworld.asm1
-rwxr-xr-xengine/intro_menu.asm2
-rwxr-xr-xengine/main_menu.asm1
-rw-r--r--engine/map_objects.asm128
-rwxr-xr-xengine/mon_icons.asm1
-rw-r--r--engine/movement.asm4
-rwxr-xr-xengine/mystery_gift.asm10
-rwxr-xr-xengine/namingscreen.asm4
-rw-r--r--engine/pack.asm7
-rwxr-xr-xengine/player_step.asm1
-rw-r--r--engine/pokedex.asm4
-rwxr-xr-xengine/pokegear.asm5
-rwxr-xr-xengine/printer_serial.asm5
-rw-r--r--engine/routines/getsquareroot.asm6
-rw-r--r--engine/routines/phonering_copytilemapatonce.asm4
-rwxr-xr-xengine/slot_machine.asm187
-rwxr-xr-xengine/sprite_anims.asm1
-rwxr-xr-xengine/stats_screen.asm3
-rw-r--r--engine/title.asm2
-rwxr-xr-xengine/trainer_card.asm1
-rwxr-xr-xengine/unown_puzzle.asm5
-rw-r--r--engine/unused_title.asm4
30 files changed, 193 insertions, 224 deletions
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 2937755a6..08021fc8b 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -8395,11 +8395,11 @@ BattleIntro: ; 3f4dd
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
diff --git a/engine/battle_anims/bg_effects.asm b/engine/battle_anims/bg_effects.asm
index c1a2bef4b..ffdce532e 100644
--- a/engine/battle_anims/bg_effects.asm
+++ b/engine/battle_anims/bg_effects.asm
@@ -2066,6 +2066,7 @@ BattleBGEffect_1c: ; c8b00 (32:4b00)
dw .cgb_zero
dw .cgb_one
dw .cgb_two
+
.cgb_zero
call BattleBGEffects_IncrementJumptable
ld hl, BG_EFFECT_STRUCT_03
@@ -2313,7 +2314,7 @@ BattleBGEffect_2e: ; c8ce1 (32:4ce1)
ld [hSCY], a
xor $ff
inc a
- ld [AnimObject01_YOffset], a
+ ld [AnimObject01YOffset], a
ret
BattleBGEffect_1f: ; c8cf9 (32:4cf9)
diff --git a/engine/billspc.asm b/engine/billspc.asm
index 8fe578a07..f94f495c6 100755
--- a/engine/billspc.asm
+++ b/engine/billspc.asm
@@ -42,14 +42,12 @@ _DepositPKMN: ; e2391 (38:6391)
jp hl
.Jumptable: ; e23df (38:63df)
-
dw .Init
dw .HandleJoypad
dw .WhatsUp
dw .Submenu
dw BillsPC_EndJumptableLoop
-
.Init: ; e23e9 (38:63e9)
xor a
ld [hBGMapMode], a
@@ -150,7 +148,6 @@ _DepositPKMN: ; e2391 (38:6391)
jp hl
BillsPCDepositJumptable: ; e24a1 (38:64a1)
-
dw BillsPCDepositFuncDeposit ; Deposit Pokemon
dw BillsPCDepositFuncStats ; Pokemon Stats
dw BillsPCDepositFuncRelease ; Release Pokemon
@@ -309,14 +306,12 @@ _WithdrawPKMN: ; e2583 (38:6583)
jp hl
.Jumptable: ; e25d2 (38:65d2)
-
dw .Init
dw .Joypad
dw .PrepSubmenu
dw BillsPC_Withdraw
dw BillsPC_EndJumptableLoop
-
.Init: ; e25dc (38:65dc)
ld a, NUM_BOXES + 1
ld [wBillsPC_LoadedBox], a
@@ -560,7 +555,6 @@ _MovePKMNWithoutMail: ; e2759
; e27ac
.Jumptable: ; e27ac
-
dw .Init
dw .Joypad
dw .PrepSubmenu
@@ -2029,7 +2023,6 @@ MovePKMNWitoutMail_InsertMon: ; e31e7
; e3245
.Jumptable: ; e3245
-
dw .BoxToBox
dw .PartyToBox
dw .BoxToParty
diff --git a/engine/card_flip.asm b/engine/card_flip.asm
index f03db190d..515f0ce79 100755
--- a/engine/card_flip.asm
+++ b/engine/card_flip.asm
@@ -80,7 +80,6 @@ _CardFlip: ; e00ee (38:40ee)
; e01a0 (38:41a0)
.Jumptable: ; e01a0
-
dw .AskPlayWithThree
dw .DeductCoins
dw .ChooseACard
@@ -656,7 +655,6 @@ CardFlip_BlankDiscardedCardSlot: ; e0534
; e0553
.Jumptable: ; e0553
-
dw .Level1
dw .Level2
dw .Level3
@@ -833,7 +831,6 @@ CardFlip_CheckWinCondition: ; e0637
; e0643
.Jumptable: ; e0643
-
dw .Impossible
dw .Impossible
dw .PikaJiggly
diff --git a/engine/color.asm b/engine/color.asm
index 1f563df53..262bccbbb 100644
--- a/engine/color.asm
+++ b/engine/color.asm
@@ -617,7 +617,7 @@ ApplyPals:
ApplyAttrMap:
ld a, [rLCDC]
- bit 7, a
+ bit rLCDC_ENABLE, a
jr z, .UpdateVBank1
ld a, [hBGMapMode]
push af
@@ -1073,7 +1073,7 @@ SGBBorder_PushBGPals:
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 @@ SGBBorder_MorePalPushing:
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 @@ SGBBorder_YetMorePalPushing:
dec b
jr nz, .loop
call DrawDefaultTiles
- ld a, $e3
+ ld a, LCDC_DEFAULT
ld [rLCDC], a
ld hl, PalPacket_9d36
call PushSGBPals
diff --git a/engine/credits.asm b/engine/credits.asm
index e38ba8dc5..051729531 100644
--- a/engine/credits.asm
+++ b/engine/credits.asm
@@ -152,9 +152,7 @@ Credits_Jumptable: ; 109926
jp hl
; 109937
-
.Jumptable: ; 109937 (42:5937)
-
dw ParseCredits
dw Credits_Next
dw Credits_Next
@@ -169,7 +167,6 @@ Credits_Jumptable: ; 109926
dw Credits_RequestGFX
dw Credits_LoopBack
-
Credits_Next: ; 109951 (42:5951)
ld hl, wJumptableIndex
inc [hl]
diff --git a/engine/dummy_game.asm b/engine/dummy_game.asm
index 4a1972ec3..aecaa7425 100755
--- a/engine/dummy_game.asm
+++ b/engine/dummy_game.asm
@@ -34,7 +34,7 @@ _DummyGame: ; e1e5b (38:5e5b)
ld [wJumptableIndex], a
ld a, $1
ld [hBGMapMode], a
- ld a, $e3
+ ld a, LCDC_DEFAULT
ld [rLCDC], a
ld a, $e4
call DmgToCgbBGPals
diff --git a/engine/events/magnet_train.asm b/engine/events/magnet_train.asm
index 585912391..cf010fb1d 100755
--- a/engine/events/magnet_train.asm
+++ b/engine/events/magnet_train.asm
@@ -303,7 +303,6 @@ MagnetTrain_Jumptable: ; 8cdf7
; 8ce06
.Jumptable: ; 8ce06
-
dw .InitPlayerSpriteAnim
dw .WaitScene
dw .MoveTrain1
diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm
index 8c238cb9c..17ec54bb1 100755
--- a/engine/events/overworld.asm
+++ b/engine/events/overworld.asm
@@ -128,7 +128,6 @@ CutFunction: ; c785
ret
.Jumptable: ; c796 (3:4796)
-
dw .CheckAble
dw .DoCut
dw .FailCut
diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm
index faa5748dd..7d17b62e5 100755
--- a/engine/intro_menu.asm
+++ b/engine/intro_menu.asm
@@ -1035,7 +1035,7 @@ StartTitleScreen: ; 6219
ld [rSVBK], a
ld hl, rLCDC
- res 2, [hl]
+ res rLCDC_SPRITE_SIZE, [hl] ; 8x8
call ClearScreen
call WaitBGMap2
xor a
diff --git a/engine/main_menu.asm b/engine/main_menu.asm
index a88f60bbf..cbd516cd7 100755
--- a/engine/main_menu.asm
+++ b/engine/main_menu.asm
@@ -54,7 +54,6 @@ MainMenu: ; 49cdc
db "MOBILE STUDIUM@"
.Jumptable: ; 0x49d60
-
dw MainMenu_Continue
dw MainMenu_NewGame
dw MainMenu_Options
diff --git a/engine/map_objects.asm b/engine/map_objects.asm
index bfeefa467..fe3c13a13 100644
--- a/engine/map_objects.asm
+++ b/engine/map_objects.asm
@@ -285,7 +285,7 @@ EndSpriteMovement: ; 467b
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 @@ MovementAnonymousJumptable: ; 4793
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 @@ Object28AnonymousJumptable: ; 47a8
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 @@ ObjectMovementReset: ; 47bc
; 47dd
MapObjectMovementPattern: ; 47dd
- call ClearObjectStructField28
+ call ClearObjectStructField1c
call GetSpriteMovementFunction
ld a, [hl]
ld hl, .Pointers
@@ -1002,7 +1002,7 @@ MapObjectMovementPattern: ; 47dd
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 @@ MapObjectMovementPattern: ; 47dd
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 @@ WaitStep_InPlace: ; 4b79
; 4b86
NPCJump: ; 4b86
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .Jump
dw .Land
@@ -1158,7 +1158,7 @@ NPCJump: ; 4b86
ld hl, OBJECT_FLAGS2
add hl, bc
res 3, [hl]
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
ret
.Land:
@@ -1176,7 +1176,7 @@ NPCJump: ; 4b86
; 4bbf
PlayerJump: ; 4bbf
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .initjump
dw .stepjump
@@ -1186,7 +1186,7 @@ PlayerJump: ; 4bbf
.initjump
ld hl, wPlayerStepFlags
set 7, [hl]
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.stepjump
call UpdateJumpPosition
call UpdatePlayerStep
@@ -1201,14 +1201,14 @@ PlayerJump: ; 4bbf
ld hl, wPlayerStepFlags
set 6, [hl]
set 4, [hl]
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
ret
.initland
call GetNextTile
ld hl, wPlayerStepFlags
set 7, [hl]
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.stepland
call UpdateJumpPosition
call UpdatePlayerStep
@@ -1226,7 +1226,7 @@ PlayerJump: ; 4bbf
; 4c18
TeleportFrom: ; 4c18
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .InitSpin
dw .DoSpin
@@ -1241,7 +1241,7 @@ TeleportFrom: ; 4c18
ld hl, OBJECT_STEP_DURATION
add hl, bc
ld [hl], 16
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.DoSpin:
ld hl, OBJECT_ACTION
add hl, bc
@@ -1250,14 +1250,14 @@ TeleportFrom: ; 4c18
add hl, bc
dec [hl]
ret nz
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
ret
.InitSpinRise:
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 @@ TeleportFrom: ; 4c18
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 @@ TeleportFrom: ; 4c18
; 4c89
TeleportTo: ; 4c89
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .InitWait
dw .DoWait
@@ -1314,7 +1314,7 @@ TeleportTo: ; 4c89
ld hl, OBJECT_STEP_DURATION
add hl, bc
ld [hl], 16
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
ret
; 4caa
@@ -1323,18 +1323,18 @@ TeleportTo: ; 4c89
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 @@ TeleportTo: ; 4c89
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 @@ TeleportTo: ; 4c89
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 @@ TeleportTo: ; 4c89
; 4d14
Skyfall: ; 4d14
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .Init
dw .Step
@@ -1403,7 +1403,7 @@ Skyfall: ; 4d14
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 @@ Skyfall: ; 4d14
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 @@ Skyfall: ; 4d14
add hl, bc
dec [hl]
ret nz
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.Finish:
ld hl, OBJECT_STEP_FRAME
add hl, bc
@@ -1453,7 +1453,7 @@ Skyfall: ; 4d14
; 4d7e
GotBiteStep: ; 4d7e
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .Init
dw .Run
@@ -1466,7 +1466,7 @@ GotBiteStep: ; 4d7e
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 @@ StepTypeBump: ; 4dff
; 4e0c
StepType05: ; 4e0c
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .Reset
dw StepType04
@@ -1569,7 +1569,7 @@ StepType05: ; 4e0c
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 @@ StepType07: ; 4e47
PlayerStep: ; 4e56
; AnimateStep?
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .init
dw .step
@@ -1615,7 +1615,7 @@ PlayerStep: ; 4e56
.init
ld hl, wPlayerStepFlags
set 7, [hl]
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.step
call UpdatePlayerStep
ld hl, OBJECT_STEP_DURATION
@@ -1635,7 +1635,7 @@ PlayerStep: ; 4e56
; 4e83
PlayerOrNPCTurnStep: ; 4e83
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .init1
dw .step1
@@ -1653,15 +1653,15 @@ PlayerOrNPCTurnStep: ; 4e83
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 @@ PlayerOrNPCTurnStep: ; 4e83
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 @@ StepType0f: ; 4ecd
; 4f04
StepTypeTrackingObject: ; 4f04
- ld hl, OBJECT_29
+ ld hl, OBJECT_1D
add hl, bc
ld e, [hl]
inc hl
@@ -1750,19 +1750,19 @@ StepTypeTrackingObject: ; 4f04
StepType14: ; 4f33
StepType15: ; 4f33
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .Init
dw .Run
.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 @@ StepType15: ; 4f33
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 @@ StepType15: ; 4f33
ret
.GetSign:
- ld hl, OBJECT_30
+ ld hl, OBJECT_1E
add hl, bc
and 1
ld a, [hl]
@@ -1799,10 +1799,10 @@ StepType15: ; 4f33
; 4f77
StepType16: ; 4f77
- call Object28AnonymousJumptable ; ????
+ call Field1cAnonymousJumptable ; ????
; 4f7a
StepType17: ; 4f7a
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .null
dw .null
@@ -1811,7 +1811,7 @@ StepType17: ; 4f7a
; 4f83
SkyfallTop: ; 4f83
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .Init
dw .Run
@@ -1823,7 +1823,7 @@ SkyfallTop: ; 4f83
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 @@ SkyfallTop: ; 4f83
; 4fb2
MobileFn_4fb2: mobile
- ld hl, OBJECT_29
+ ld hl, OBJECT_1D
add hl, bc
inc [hl]
ld a, [hl]
@@ -1866,7 +1866,7 @@ MobileFn_4fb2: mobile
UpdateJumpPosition: ; 4fd5
call GetStepVector
ld a, h
- ld hl, OBJECT_31
+ ld hl, OBJECT_1F
add hl, bc
ld e, [hl]
add e
diff --git a/engine/mon_icons.asm b/engine/mon_icons.asm
index 695e28770..316ff3bac 100755
--- a/engine/mon_icons.asm
+++ b/engine/mon_icons.asm
@@ -46,7 +46,6 @@ LoadMenuMonIcon: ; 8e83f
dw Mobile_InitPartyMenuBGPal71 ; mobile
dw .GetPartyMenuMonIcon ; unused
-
.GetPartyMenuMonIcon: ; 8e862 (23:6862)
call InitPartyMenuIcon
call .GetPartyMonItemGFX
diff --git a/engine/movement.asm b/engine/movement.asm
index bec089978..3ba48d60d 100644
--- a/engine/movement.asm
+++ b/engine/movement.asm
@@ -727,7 +727,7 @@ Movement_turn_step_right: ; 53fc
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 @@ SlideStep: ; 5468
JumpStep: ; 548a
call InitStep
- ld hl, OBJECT_31
+ ld hl, OBJECT_1F
add hl, bc
ld [hl], $0
diff --git a/engine/mystery_gift.asm b/engine/mystery_gift.asm
index e6d4504c2..67ce10168 100755
--- a/engine/mystery_gift.asm
+++ b/engine/mystery_gift.asm
@@ -116,7 +116,7 @@ DoMysteryGift: ; 1048ba (41:48ba)
.PrintTextAndExit: ; 1049c5 (41:49c5)
call PrintText
- ld a, $e3
+ ld a, LCDC_DEFAULT
ld [rLCDC], a
ret
; 1049cd (41:49cd)
@@ -262,7 +262,7 @@ Function104a95: ; 104a95 (41:4a95)
; Delay frame
.ly_loop
ld a, [rLY]
- cp $90
+ cp LY_VBLANK
jr c, .ly_loop
ld c, LOW(rRP)
ld a, $c0
@@ -281,14 +281,14 @@ Function104a95: ; 104a95 (41:4a95)
and b
ld b, a
ld a, [rLY]
- cp $90
+ cp LY_VBLANK
jr nc, .ly_loop2
.ly_loop3
ld a, [$ff00+c]
and b
ld b, a
ld a, [rLY]
- cp $90
+ cp LY_VBLANK
jr c, .ly_loop3
ld a, b
@@ -1497,7 +1497,7 @@ Function10571a: ; 10571a (41:571a)
asm_105726: ; 105726 (41:5726)
call PrintText
- ld a, $e3
+ ld a, LCDC_DEFAULT
ld [rLCDC], a
ret
; 10572e (41:572e)
diff --git a/engine/namingscreen.asm b/engine/namingscreen.asm
index a01c02c31..177f06f73 100755
--- a/engine/namingscreen.asm
+++ b/engine/namingscreen.asm
@@ -48,7 +48,7 @@ NamingScreen: ; 116c1
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 @@ _ComposeMailMessage: ; 11e75 (mail?)
add hl, bc
ld [hl], $0
call .InitCharset
- ld a, $e3
+ ld a, LCDC_DEFAULT
ld [rLCDC], a
call .initwNamingScreenMaxNameLength
ld b, SCGB_DIPLOMA
diff --git a/engine/pack.asm b/engine/pack.asm
index b4f6d4ef1..047924cb0 100644
--- a/engine/pack.asm
+++ b/engine/pack.asm
@@ -28,7 +28,6 @@ Pack: ; 10000
; 10030
.Jumptable: ; 10030 (4:4030)
-
dw .InitGFX ; 0
dw .InitItemsPocket ; 1
dw .ItemsPocketMenu ; 2
@@ -694,7 +693,6 @@ BattlePack: ; 10493
; 104c3
.Jumptable: ; 104c3 (4:44c3)
-
dw .InitGFX ; 0
dw .InitItemsPocket ; 1
dw .ItemsPocketMenu ; 2
@@ -865,7 +863,6 @@ TMHMSubmenu: ; 105dc (4:45dc)
; 0x10614
.UsableJumptable: ; 10614
-
dw .Use
dw .Quit
; 10618
@@ -885,7 +882,6 @@ TMHMSubmenu: ; 105dc (4:45dc)
; 0x10627
.UnusableJumptable: ; 10627
-
dw .Quit
; 10629
@@ -897,7 +893,6 @@ TMHMSubmenu: ; 105dc (4:45dc)
ret
.ItemFunctionJumptable: ; 10637 (4:4637)
-
dw .Oak
dw .Oak
dw .Oak
@@ -1002,11 +997,11 @@ DepositSellPack: ; 106be
; 106d1
.Jumptable: ; 106d1 (4:46d1)
-
dw .ItemsPocket
dw .BallsPocket
dw .KeyItemsPocket
dw .TMHMPocket
+
.ItemsPocket: ; 106d9 (4:46d9)
xor a
call InitPocket
diff --git a/engine/player_step.asm b/engine/player_step.asm
index c20bc09e9..996a9b422 100755
--- a/engine/player_step.asm
+++ b/engine/player_step.asm
@@ -59,7 +59,6 @@ HandlePlayerStep: ; d4e5 (3:54e5)
ret
.Jumptable: ; d4f2 (3:54f2)
-
dw GetMovementPermissions
dw BufferScreen
dw .mobile
diff --git a/engine/pokedex.asm b/engine/pokedex.asm
index 95f9404f9..0297cf840 100644
--- a/engine/pokedex.asm
+++ b/engine/pokedex.asm
@@ -184,7 +184,6 @@ Pokedex_RunJumptable: ; 4010b
call Pokedex_LoadPointer
jp hl
-
.Jumptable: ; 40115 (10:4115)
dw Pokedex_InitMainScreen
dw Pokedex_UpdateMainScreen
@@ -201,7 +200,6 @@ Pokedex_RunJumptable: ; 4010b
dw Pokedex_UpdateUnownMode
dw Pokedex_Exit
-
Pokedex_IncrementDexPointer: ; 40131 (10:4131)
ld hl, wJumptableIndex
inc [hl]
@@ -1623,13 +1621,11 @@ Pokedex_OrderMonsByMode: ; 40bdc
call Pokedex_LoadPointer
jp hl
-
.Jumptable: ; 40bf0 (10:4bf0)
dw .NewMode
dw .OldMode
dw Pokedex_ABCMode
-
.NewMode: ; 40bf6 (10:4bf6)
ld de, NewPokedexOrder
ld hl, wPokedexOrder
diff --git a/engine/pokegear.asm b/engine/pokegear.asm
index aff64ef6c..dba071b28 100755
--- a/engine/pokegear.asm
+++ b/engine/pokegear.asm
@@ -59,7 +59,7 @@ PokeGear: ; 90b8d (24:4b8d)
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 @@ InitPokegearTilemap: ; 90da8 (24:4da8)
dw .Map
dw .Phone
dw .Radio
-
; 90e1a
.Clock: ; 90e1a
@@ -1852,7 +1851,7 @@ _TownMap: ; 9191c
farcall ClearSpriteAnims
ld a, 8
call SkipMusic
- ld a, $e3
+ ld a, LCDC_DEFAULT
ld [rLCDC], a
call TownMap_GetCurrentLandmark
ld [wTownMapPlayerIconLandmark], a
diff --git a/engine/printer_serial.asm b/engine/printer_serial.asm
index 06891db5b..02d0595fa 100755
--- a/engine/printer_serial.asm
+++ b/engine/printer_serial.asm
@@ -29,9 +29,7 @@ PrinterJumptableIteration: ; 84022
jp hl
; 84031
-
.Jumptable: ; 84031 (21:4031)
-
dw Print_InitPrinterHandshake ; 00
dw Printer_CheckConnectionStatus ; 01
dw Printer_WaitSerial ; 02
@@ -55,7 +53,6 @@ PrinterJumptableIteration: ; 84022
dw Printer_WaitLoopBack ; 12
dw Printer_WaitLoopBack_ ; 13
-
Printer_NextSection: ; 84059 (21:4059)
ld hl, wJumptableIndex
inc [hl]
@@ -471,7 +468,6 @@ _PrinterReceive:: ; 842db
jp hl
; 842ea
-
.Jumptable: ; 842ea (21:42ea)
dw Printer_DoNothing ; 00
@@ -509,7 +505,6 @@ _PrinterReceive:: ; 842db
dw Printer_ReceiveTowPrinterHandshakeAndSend0x00 ; 1e
dw Printer_ReceiveTowPrinterStatusFlagsAndExitSendLoop ; 1f
-
Printer_NextInstruction: ; 8432a (21:432a)
ld hl, wPrinterOpcode
inc [hl]
diff --git a/engine/routines/getsquareroot.asm b/engine/routines/getsquareroot.asm
index 009d9f4fe..0ba2e50a5 100644
--- a/engine/routines/getsquareroot.asm
+++ b/engine/routines/getsquareroot.asm
@@ -23,8 +23,8 @@ GetSquareRoot: ; 13b87
ret
.Squares: ; 13b98
-root set 1
+root = 1
rept $ff
- dw root*root
-root set root+1
+ dw root * root
+root = root + 1
endr
diff --git a/engine/routines/phonering_copytilemapatonce.asm b/engine/routines/phonering_copytilemapatonce.asm
index b1a726675..cefe9a66d 100644
--- a/engine/routines/phonering_copytilemapatonce.asm
+++ b/engine/routines/phonering_copytilemapatonce.asm
@@ -17,7 +17,7 @@ PhoneRing_CopyTilemapAtOnce: ; 4d188
ld [hMapAnims], a
.wait
ld a, [rLY]
- cp $8f
+ cp LY_VBLANK - 1
jr c, .wait
di
@@ -31,7 +31,7 @@ PhoneRing_CopyTilemapAtOnce: ; 4d188
call .CopyTilemapAtOnce
.wait2
ld a, [rLY]
- cp $8f
+ cp LY_VBLANK - 1
jr c, .wait2
ei
diff --git a/engine/slot_machine.asm b/engine/slot_machine.asm
index d77eb6a1a..aea08f16a 100755
--- a/engine/slot_machine.asm
+++ b/engine/slot_machine.asm
@@ -8,6 +8,19 @@ SLOTS_SQUIRTLE EQU $10
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 @@ REEL_SIZE EQU 15
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 @@ _SlotMachine:
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 @@ _SlotMachine:
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 @@ Slots_CheckCoinCaseFull: ; 92a04 (24:6a04)
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 @@ Slots_GetCurrentReelState: ; 92a12 (24:6a12)
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,68 +668,68 @@ Slots_StopReel3: ; 92a60 (24:6a60)
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
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,26 +745,26 @@ Slots_SpinReels: ; 92b0f (24:6b0f)
ret
.SpinReel: ; 92b22 (24:6b22)
- ld hl, wReel1SpinDistance - wReel1
+ ld hl, REEL_SPIN_DISTANCE
add hl, bc
ld a, [hl]
and $f
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 @@ Slots_SpinReels: ; 92b0f (24:6b0f)
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 @@ Slots_UpdateReelPositionAndOAM: ; 92b53 (24:6b53)
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 @@ Slots_UpdateReelPositionAndOAM: ; 92b53 (24:6b53)
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 @@ Function92bbe: ; 92bbe
; 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 @@ ReelAction_DoNothing: ; 92c16
; 92c17
ReelAction_QuadrupleRate: ; 92c17
- ld hl, wReel1SpinRate - wReel1
+ ld hl, REEL_SPIN_RATE
add hl, bc
ld [hl], 16
ret
@@ -918,7 +931,7 @@ ReelAction_QuadrupleRate: ; 92c17
; 92c1e
ReelAction_DoubleRate: ; 92c1e
- ld hl, wReel1SpinRate - wReel1
+ ld hl, REEL_SPIN_RATE
add hl, bc
ld [hl], 8
ret
@@ -926,7 +939,7 @@ ReelAction_DoubleRate: ; 92c1e
; 92c25
ReelAction_NormalRate: ; 92c25
- ld hl, wReel1SpinRate - wReel1
+ ld hl, REEL_SPIN_RATE
add hl, bc
ld [hl], 4
ret
@@ -934,7 +947,7 @@ ReelAction_NormalRate: ; 92c25
; 92c2c
ReelAction_HalfRate: ; 92c2c
- ld hl, wReel1SpinRate - wReel1
+ ld hl, REEL_SPIN_RATE
add hl, bc
ld [hl], 2
ret
@@ -942,7 +955,7 @@ ReelAction_HalfRate: ; 92c2c
; 92c33
ReelAction_QuarterRate: ; 92c33
- ld hl, wReel1SpinRate - wReel1
+ ld hl, REEL_SPIN_RATE
add hl, bc
ld [hl], 1
ret
@@ -950,17 +963,17 @@ ReelAction_QuarterRate: ; 92c33
; 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 @@ ReelAction_StopReelIgnoreJoypad: ; 92c4c
ret
.EndReel:
- ld hl, wReel1ReelAction - wReel1
+ ld hl, REEL_ACTION
add hl, bc
ld a, REEL_ACTION_DO_NOTHING
ld [hl], a
@@ -979,14 +992,14 @@ ReelAction_StopReelIgnoreJoypad: ; 92c4c
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.
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_StopReel1: ; 92c5e
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 @@ ReelAction_StopReel2: ; 92c86
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 @@ ReelAction_StopReel2: ; 92c86
; 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 @@ ReelAction_StopReel3: ; 92ca9
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 @@ ReelAction_StopReel3: ; 92ca9
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 @@ ReelAction_SetUpReel2SkipTo7: ; 92cd2
.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 @@ ReelAction_SetUpReel2SkipTo7: ; 92cd2
; 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 @@ ReelAction_WaitReel2SkipTo7: ; 92cf8
.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 @@ ReelAction_InitGolem: ; 92d20
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 @@ ReelAction_WaitGolem: ; 92d4f
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_WaitGolem: ; 92d4f
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 @@ ReelAction_InitChansey: ; 92d7e
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 @@ ReelAction_WaitChansey: ; 92da4
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 @@ ReelAction_WaitEgg: ; 92db3
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 @@ ReelAction_DropReel: ; 92dca
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 @@ ReelAction_Unused: ; 92df7
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 @@ ReelAction_CheckDropReel: ; 92e10
.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 @@ ReelAction_WaitDropReel: ; 92e31
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 @@ ReelAction_StartSlowAdvanceReel3: ; 92e47
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 @@ Slots_CheckMatchedFirstTwoReels: ; 92e94
; 92ebd
.Jumptable: ; 92ebd
-
dw .zero
dw .one
dw .two
@@ -1552,7 +1564,6 @@ Slots_CheckMatchedAllThreeReels: ; 92f1d
; 92f48
.Jumptable: ; 92f48
-
dw .zero
dw .one
dw .two
@@ -1656,7 +1667,7 @@ Slots_CopyReelState: ; 92fb4
; 92fc0
Slots_GetNumberOfGolems: ; 92fc0
- ld hl, wReel1Position - wReel1
+ ld hl, REEL_POSITION
add hl, bc
ld a, [hl]
push af
@@ -1676,7 +1687,7 @@ Slots_GetNumberOfGolems: ; 92fc0
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 @@ Slots_GetNumberOfGolems: ; 92fc0
.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 @@ endr
; 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 @@ endr
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 @@ Slots_AnimateGolem: ; 9321d (24:721d)
jp hl
.Jumptable: ; 9322d (24:722d)
-
dw .init
dw .fall
dw .roll
-
.init ; 93233 (24:7233)
ld hl, SPRITEANIMSTRUCT_0E
add hl, bc
@@ -2181,12 +2190,10 @@ Slots_AnimateChansey: ; 932ac (24:72ac)
jp hl
.Jumptable: ; 932bc (24:72bc)
-
dw .walk
dw .one
dw .two
-
.walk ; 932c2 (24:72c2)
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
diff --git a/engine/sprite_anims.asm b/engine/sprite_anims.asm
index edd1daf32..9fb78a5d7 100755
--- a/engine/sprite_anims.asm
+++ b/engine/sprite_anims.asm
@@ -50,7 +50,6 @@ DoAnimFrame: ; 8d24b
dw .IntroUnownF
dw .IntroSuicuneAway
-
.Null: ; 8d2a1 (23:52a1)
ret
diff --git a/engine/stats_screen.asm b/engine/stats_screen.asm
index fa124e1b3..9f632f388 100755
--- a/engine/stats_screen.asm
+++ b/engine/stats_screen.asm
@@ -534,12 +534,10 @@ StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6)
ret
.Jumptable: ; 4e00d (13:600d)
-
dw .PinkPage
dw .GreenPage
dw .BluePage
-
.PinkPage: ; 4e013 (13:6013)
hlcoord 0, 9
ld b, $0
@@ -888,7 +886,6 @@ StatsScreen_GetAnimationParam: ; 4e2ad (13:62ad)
dw .Tempmon
dw .Wildmon
-
.PartyMon: ; 4e2bf (13:62bf)
ld a, [CurPartyMon]
ld hl, PartyMon1
diff --git a/engine/title.asm b/engine/title.asm
index 2ea588cd0..6b015300f 100644
--- a/engine/title.asm
+++ b/engine/title.asm
@@ -201,7 +201,7 @@ _TitleScreen: ; 10ed67
; Set sprite size to 8x16
ld a, [rLCDC]
- set 2, a
+ set rLCDC_SPRITE_SIZE, a
ld [rLCDC], a
ld a, +112
diff --git a/engine/trainer_card.asm b/engine/trainer_card.asm
index 2905e8eb3..87cab0103 100755
--- a/engine/trainer_card.asm
+++ b/engine/trainer_card.asm
@@ -80,7 +80,6 @@ TrainerCard: ; 25105
dw TrainerCard_Page3_Joypad
dw TrainerCard_Quit
-
TrainerCard_IncrementJumptable: ; 251ab (9:51ab)
ld hl, wJumptableIndex
inc [hl]
diff --git a/engine/unown_puzzle.asm b/engine/unown_puzzle.asm
index 525345e68..ee76f817c 100755
--- a/engine/unown_puzzle.asm
+++ b/engine/unown_puzzle.asm
@@ -45,7 +45,7 @@ UnownPuzzle: ; e1190
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 @@ UnownPuzzle: ; e1190
call ClearBGPalettes
call ClearTileMap
call ClearSprites
- ld a, $e3
+ ld a, LCDC_DEFAULT
ld [rLCDC], a
ret
; e124e
@@ -188,7 +188,6 @@ UnownPuzzleJumptable: ; e12ca
; e12d9
.Jumptable: ; e12d9
-
dw .Function
; e12db
diff --git a/engine/unused_title.asm b/engine/unused_title.asm
index ca508b593..650e17863 100644
--- a/engine/unused_title.asm
+++ b/engine/unused_title.asm
@@ -55,8 +55,8 @@ UnusedTitleScreen: ; 10c000
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